Files
Cedar-Django/closedverse_main/templates/closedverse_main/elements/community_post.html
T
some weird guy 1b33a2aad1 oh god
- Merge with closedverse-video-support
- user_tools moved to forms.py
- community_tools moved to forms.py
2023-08-19 17:17:00 -07:00

105 lines
6.1 KiB
HTML

{% if not post.is_rm %}
{% load closedverse_tags %}<div id="post-{{ post.id }}" {% if post.spoils and not post.is_mine or not post.creator.is_active %}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 not post.creator.is_active 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>
{% if not post.creator.is_active %}
<p style="color: #f00;">Banned</p>
{% endif %}
<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>
{% if post.drawing %}
<span class="spoiler">(handwritten)</span>
{% endif %}
</p>
<div class="body post-content">
{% if post.yt_vid %}
<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>
{% elif post.discord_vid %}
<div class="screenshot-container video"><video src="{{ post.url }}" height="48"></video></div>
{% endif %}
{% if post.drawing %}
<p class="post-content-memo"><img src="{{ post.drawing }}" class="post-memo"></p>
{% else %}
{% 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 %}
{% endif %}
{% if post.screenshot %}<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.screenshot }}"></a>{% endif %}
{% if post.video %}<div class="screenshot-container still-image"><video class="vidya" controls src="{{ post.video }}" style="max-width:100%;max-height: 450px;"></video></div>{% endif %}
{% if post.spoils and not post.is_mine and post.creator.is_active %}
<div class="hidden-content"><p>This post contains spoilers.</p>
<button type="button" class="hidden-content-button">View Post</button>
</div>
{% endif %}
{% if not post.creator.is_active %}
<div class="hidden-content"><p>Content hidden because its creator was banned. </p>
{% if post.creator.get_warned_reason %}
<p>Reason: {{post.creator.get_warned_reason}}
{% endif %}
<button type="button" class="hidden-content-button">View Anyway</button>
</p></div>
{% elif post.user_is_blocked %}
<div class="hidden-content"><p>Content hidden because you've blocked this user.</p>
<button type="button" class="hidden-content-button">View Anyway</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 and post.recent_comment.creator.is_active %}
<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 %}