Files
Cedar-Django/closedverse_main/templates/closedverse_main/elements/community_post.html
T
2023-10-19 16:16:35 -07:00

90 lines
5.5 KiB
HTML

{% if not post.is_rm %}
{% load closedverse_tags %}<div id="post-{{ post.id }}" {% if post.spoils and not post.is_mine %}data-href-hidden{% else %}data-href{% endif %}="{% if post.is_reply %}{% url "main:comment-view" post.id %}{% else %}{% url "main:post-view" post.id %}{% endif %}" class="post post-subtype-default trigger{% if post.spoils and not post.is_mine or post.user_is_blocked %} hidden test-hidden{% endif %}{% if type == 2 %} post-list-outline{% endif %}" tabindex="0">
{% if with_community_container %}
<p class="community-container">
{% if post.is_reply %}
<a class="test-community-link" href="{% url "main:post-view" post.original_post_id %}"><img src="{% avatar post.original_post.creator post.original_post.feeling %}" class="community-icon">
<span class="reply symbol"></span>Comment on {{ post.original_post.creator.nickname }}'s post</a>
{% else %}
<a class="test-community-link" {% if post.community.clickable %}href="{% url "main:community-view" post.community_id %}"{% endif %}><img src="{{ post.community.icon }}" class="community-icon">{{ post.community.name }}</a>
{% endif %}
</p>
{% endif %}
{% user_icon_container post.creator post.feeling %}
{% if post.creator == post.community.creator %}
<span class="owner-label">Community Owner</span>
{% endif %}
<p class="user-name"><a href="{% url "main:user-view" post.creator.username %}"{% if post.creator.color %}style=color:{{ post.creator.color }}{% endif %}>{{ post.creator.nickname }}</a></p>
<p class="timestamp-container">
<span class="spoiler-status{% if post.spoils %} spoiler{% endif %}">Spoilers·</span>
{% if post.has_edit %}
<span class="spoiler">Edited</span>·
{% endif %}
<a class="timestamp" {% if post.spoils and not post.is_mine %}data-href-hidden{% else %}href{% endif %}="{% if post.is_reply %}{% url "main:comment-view" post.id %}{% else %}{% url "main:post-view" post.id %}{% endif %}">{% time post.created %}</a>
</p>
<div class="body post-content">
{% if post.yt_vid and not post.file_type == 2 %}
<a href="{% url "main:post-view" post.id %}" class="screenshot-container video"><img height="48" src="https://i.ytimg.com/vi/{{ post.yt_vid }}/default.jpg"></a>
{% endif %}
{% if post.has_line_trun %}
<p class="post-content-text">{{ post.body|truncatechars:200 }}</p>
{% else %}
<p class="post-content-text">{{ post.body|truncatechars:200|linebreaksbr }}</p>
{% endif %}
{% if post.file %}
{% if post.file_type == 1 %}<a class="screenshot-container still-image" href="{% if post.is_reply %}{% url "main:comment-view" post.id %}{% else %}{% url "main:post-view" post.id %}{% endif %}"><img src="{{ post.file.url }}"></a>
{% elif post.file_type == 2 %}<div class="screenshot-container still-image"><video controls src="{{ post.file.url }}" style="max-width:100%;max-height: 450px;"></video></div>
{% elif post.file_type == 3 %}<div class="screenshot-container audio"><audio controls src="{{ post.file.url }}"></audio></div>
{% else %}<a>File attached</a>
{% endif %}
{% endif %}
{% if post.user_is_blocked %}
<div class="hidden-content"><p>Content hidden because you've blocked this user.{% if post.user_is_blocked %} Oh yeah, and spoilers too I guess.{% endif %}</p>
<button type="button" class="hidden-content-button">View Anyway</button>
</div>
{% elif post.spoils and not post.is_mine %}
<div class="hidden-content"><p>This post contains spoilers.</p>
<button type="button" class="hidden-content-button">View Post</button>
</div>
{% endif %}
<div class="post-meta">
<button type="button" {% if not post.can_yeah %}disabled{% endif %} class="symbol submit yeah-button
{% if post.has_yeah %}empathy-added{% endif %}
" data-feeling="" data-action="{% if post.is_reply %}{% url "main:comment-add-yeah" post.id %}{% else %}{% url "main:post-add-yeah" post.id %}{% endif %}" data-url-id="{{ post.id }}"><span class="yeah-button-text">{% empathy_txt post.feeling post.has_yeah %}</span></button>
{% if post.url %}
<a class="link-confirm symbol button" href="{{ post.url }}"></a>
{% endif %}
<div class="empathy symbol"><span class="symbol-label">Yeahs</span><span class="empathy-count">{{ post.number_yeahs }}</span></div>
{% if not post.original_post %}
<div class="reply symbol"><span class="symbol-label">Comments</span><span class="reply-count">{{ post.number_comments }}</span></div>
{% endif %}
</div>
{% if post.recent_comment %}
<div class="recent-reply-content">
{% if post.number_comments > 1 %}
<div class="recent-reply-read-more-container" tabindex="0">
View all comments ({{ post.number_comments }})
</div>
{% endif %}
<div tabindex="0" class="recent-reply trigger">
{% user_icon_container post.recent_comment.creator post.recent_comment.feeling %}
<p class="user-name"><a href="{% url "main:user-view" post.recent_comment.creator.username %}">{{ post.recent_comment.creator.nickname }}</a></p>
<p class="timestamp-container">
<a class="timestamp" href="{% url "main:comment-view" post.recent_comment.id %}">{% time post.recent_comment.created %}</a>
</p>
<div class="body">
<div class="post-content">
{% if post.recent_comment.drawing %}
<p class="recent-reply-content-memo"><img src="{{ post.recent_comment.drawing }}" class="recent-reply-memo"></p>
{% else %}
<p class="recent-reply-content-text">{{ post.recent_comment.body }}</p>
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}
</div>
</div>
{% endif %}