Skip to content

Commit

Permalink
Move image attachments on posts into the content warning block. (join…
Browse files Browse the repository at this point in the history
…takahe#148)

Also adds alt text to image attachments.
  • Loading branch information
TkTech authored Dec 8, 2022
1 parent a576c5b commit 39bcd7a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ table.metadata td.name {
}

.post .attachments {
margin: 10px 0 10px 64px;
padding-top: 4px;
}

.post .attachments a.image {
Expand Down
22 changes: 12 additions & 10 deletions templates/activities/_post.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@

<div class="content {% if post.summary %}hidden{% endif %}">
{{ post.safe_content_local }}

{% if post.attachments.exists %}
<div class="attachments">
{% for attachment in post.attachments.all %}
{% if attachment.is_image %}
<a href="{{ attachment.full_url }}" class="image">
<img src="{{ attachment.thumbnail_url }}" title="{{ attachment.name }}" alt="{{ attachment.name }}" />
</a>
{% endif %}
{% endfor %}
</div>
{% endif %}
</div>

{% if post.edited %}
Expand All @@ -78,15 +90,5 @@
</div>
{% endif %}

{% if post.attachments.exists %}
<div class="attachments">
{% for attachment in post.attachments.all %}
{% if attachment.is_image %}
<a href="{{ attachment.full_url }}" class="image"><img src="{{ attachment.thumbnail_url }}" title="{{ attachment.name }}"></a>
{% endif %}
{% endfor %}
</div>
{% endif %}

<a class="whole-box" href="{{ post.urls.view }}" tabindex="-1"></a>
</div>

0 comments on commit 39bcd7a

Please sign in to comment.