show avatar in posts

This commit is contained in:
Your Name 2024-06-03 21:55:00 -04:00 committed by Henri Dickson
parent 059c95f2c3
commit feef968fb9
7 changed files with 133 additions and 142 deletions

View file

@ -196,6 +196,7 @@ form img {
display: inline-block; display: inline-block;
img { img {
max-width: unset;
border-radius: 50%; border-radius: 50%;
height: calc(1rem * var(--pico-line-height) + var(--pico-nav-link-spacing-vertical) * 2 - var(--pico-border-width) * 2); height: calc(1rem * var(--pico-line-height) + var(--pico-nav-link-spacing-vertical) * 2 - var(--pico-border-width) * 2);
width: calc(1rem * var(--pico-line-height) + var(--pico-nav-link-spacing-vertical) * 2 - var(--pico-border-width) * 2); width: calc(1rem * var(--pico-line-height) + var(--pico-nav-link-spacing-vertical) * 2 - var(--pico-border-width) * 2);

View file

@ -18,6 +18,18 @@
</footer> </footer>
<div class="player"></div> <div class="player"></div>
<script> <script>
$(function () {
function _sidebar_auto_collapse(mm){
if (mm.matches) {
$('.auto-collapse').removeAttr('open')
} else {
$('.auto-collapse').attr('open', '')
}
}
var mm = window.matchMedia("(max-width: 768px)")
mm.addListener(_sidebar_auto_collapse);
_sidebar_auto_collapse(mm);
});
document.body.addEventListener('htmx:configRequest', (event) => { document.body.addEventListener('htmx:configRequest', (event) => {
event.detail.headers['X-CSRFToken'] = '{{ csrf_token }}'; event.detail.headers['X-CSRFToken'] = '{{ csrf_token }}';
}) })

View file

@ -231,17 +231,3 @@
</section> </section>
{% endif %} {% endif %}
</aside> </aside>
<script>
$(function () {
function _sidebar_auto_collapse(mm){
if (mm.matches) {
$('.auto-collapse').removeAttr('open')
} else {
$('.auto-collapse').attr('open', '')
}
}
var mm = window.matchMedia("(max-width: 768px)")
mm.addListener(_sidebar_auto_collapse);
_sidebar_auto_collapse(mm);
});
</script>

View file

@ -62,17 +62,3 @@
</article> </article>
</section> </section>
</aside> </aside>
<script>
$(function () {
function _sidebar_auto_collapse(mm){
if (mm.matches) {
$('.auto-collapse').removeAttr('open')
} else {
$('.auto-collapse').attr('open', '')
}
}
var mm = window.matchMedia("(max-width: 768px)")
mm.addListener(_sidebar_auto_collapse);
_sidebar_auto_collapse(mm);
});
</script>

View file

@ -4,7 +4,13 @@
{% load i18n %} {% load i18n %}
{% for post in posts %} {% for post in posts %}
<section class="activity"> <section class="activity">
<div style="display:flex;">
<div> <div>
<div class="avatar" style="margin:0.6em 0.6em 0.6em 0;">
<img src="{{ post.author.icon_uri }}" alt="@{{ post.author.handle }}" />
</div>
</div>
<div style="flex-grow:1;">
<span class="action"> <span class="action">
<span class="timestamp">{{ post.created|naturaldelta }}</span> <span class="timestamp">{{ post.created|naturaldelta }}</span>
{% include "action_reply_post.html" %} {% include "action_reply_post.html" %}
@ -12,8 +18,7 @@
{% include "action_boost_post.html" %} {% include "action_boost_post.html" %}
{% include "action_open_post.html" %} {% include "action_open_post.html" %}
</span> </span>
<!--span class="avatar" style="margin:0.5em;"> <img src="{{ post.author.icon_uri }}" alt="cover" /> </span --> <span>
<span style="">
<a href="{{ post.author.url }}" <a href="{{ post.author.url }}"
class="nickname" class="nickname"
title="@{{ post.author.handle }}">{{ post.author.name }}</a> title="@{{ post.author.handle }}">{{ post.author.name }}</a>
@ -33,6 +38,7 @@
{{ post.content|bleach:"a,p,span,br,div,img"|default:"" }} {{ post.content|bleach:"a,p,span,br,div,img"|default:"" }}
</div> </div>
</div> </div>
</div>
<div id="replies_{{ post.pk }}"></div> <div id="replies_{{ post.pk }}"></div>
</section> </section>
{% empty %} {% empty %}

View file

@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-03 17:32-0400\n" "POT-Creation-Date: 2024-06-03 21:53-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -667,7 +667,7 @@ msgstr "不再提示"
#: catalog/templates/_item_comments_by_episode.html:78 #: catalog/templates/_item_comments_by_episode.html:78
#: catalog/templates/_item_reviews.html:43 #: catalog/templates/_item_reviews.html:43
#: catalog/templates/podcast_episode_data.html:41 #: catalog/templates/podcast_episode_data.html:41
#: common/templates/_sidebar.html:231 #: common/templates/_sidebar.html:203
msgid "show more" msgid "show more"
msgstr "显示更多" msgstr "显示更多"
@ -1093,6 +1093,40 @@ msgstr "显示"
msgid "hide" msgid "hide"
msgstr "隐藏" msgstr "隐藏"
#: catalog/templates/discover.html:155 common/templates/_sidebar.html:14
msgid "Unread Announcements"
msgstr "未读公告"
#: catalog/templates/discover.html:161 common/templates/_sidebar.html:20
msgid "mark all as read"
msgstr "全部标为已读"
#: catalog/templates/discover.html:170
msgid "Popular Posts"
msgstr "热门帖文"
#: catalog/templates/discover.html:178
#: common/templates/_sidebar_anonymous.html:51
msgid "Popular Tags"
msgstr "热门标签"
#: catalog/templates/discover.html:185 catalog/templates/item_base.html:236
#: catalog/templates/item_mark_list.html:54
#: catalog/templates/item_review_list.html:50 common/templates/_sidebar.html:98
#: common/templates/_sidebar.html:198
#: common/templates/_sidebar_anonymous.html:43
#: common/templates/_sidebar_anonymous.html:58
#: journal/templates/collection_items.html:8 journal/templates/posts.html:43
#: journal/templates/profile.html:109 journal/templates/profile.html:151
#: journal/templates/profile.html:187
#: journal/templates/user_collection_list.html:51
#: journal/templates/user_item_list_base.html:25
#: journal/templates/user_tag_list.html:29 social/templates/events.html:45
#: users/templates/users/announcements.html:54
#: users/templates/users/relationship_list.html:11
msgid "nothing so far."
msgstr "暂无内容。"
#: catalog/templates/edition.html:36 #: catalog/templates/edition.html:36
msgid "publication date" msgid "publication date"
msgstr "发行时间" msgstr "发行时间"
@ -1163,23 +1197,6 @@ msgstr "评分人数不足"
msgid "overview" msgid "overview"
msgstr "简介" msgstr "简介"
#: catalog/templates/item_base.html:236
#: catalog/templates/item_mark_list.html:54
#: catalog/templates/item_review_list.html:50 common/templates/_sidebar.html:37
#: common/templates/_sidebar.html:126 common/templates/_sidebar.html:226
#: common/templates/_sidebar_anonymous.html:43
#: common/templates/_sidebar_anonymous.html:58
#: journal/templates/collection_items.html:8 journal/templates/posts.html:39
#: journal/templates/profile.html:109 journal/templates/profile.html:151
#: journal/templates/profile.html:187
#: journal/templates/user_collection_list.html:51
#: journal/templates/user_item_list_base.html:25
#: journal/templates/user_tag_list.html:29 social/templates/events.html:45
#: users/templates/users/announcements.html:54
#: users/templates/users/relationship_list.html:11
msgid "nothing so far."
msgstr "暂无内容。"
#: catalog/templates/item_base.html:243 #: catalog/templates/item_base.html:243
msgid "comments" msgid "comments"
msgstr "短评" msgstr "短评"
@ -1523,52 +1540,35 @@ msgstr "注册或登录"
msgid "Set a username." msgid "Set a username."
msgstr "设置用户名" msgstr "设置用户名"
#: common/templates/_sidebar.html:14 #: common/templates/_sidebar.html:53
msgid "Unread Announcements"
msgstr "未读公告"
#: common/templates/_sidebar.html:20
msgid "mark all as read"
msgstr "全部标为已读"
#: common/templates/_sidebar.html:30
#: common/templates/_sidebar_anonymous.html:51
msgid "Popular Tags"
msgstr "热门标签"
#: common/templates/_sidebar.html:48
msgid "Popular Posts"
msgstr "热门帖文"
#: common/templates/_sidebar.html:81
msgid "approving followers manually" msgid "approving followers manually"
msgstr "已开启关注审核" msgstr "已开启关注审核"
#: common/templates/_sidebar.html:111 #: common/templates/_sidebar.html:83
msgid "Current Targets" msgid "Current Targets"
msgstr "当前目标" msgstr "当前目标"
#: common/templates/_sidebar.html:124 #: common/templates/_sidebar.html:96
msgid "Set a collection as target, its progress will show up here." msgid "Set a collection as target, its progress will show up here."
msgstr "将自己或他人的收藏单设为目标,这里就会显示进度" msgstr "将自己或他人的收藏单设为目标,这里就会显示进度"
#: common/templates/_sidebar.html:137 #: common/templates/_sidebar.html:109
msgid "Recent podcast episodes" msgid "Recent podcast episodes"
msgstr "近期播客节目" msgstr "近期播客节目"
#: common/templates/_sidebar.html:172 #: common/templates/_sidebar.html:144
msgid "Currently reading" msgid "Currently reading"
msgstr "正在阅读" msgstr "正在阅读"
#: common/templates/_sidebar.html:195 #: common/templates/_sidebar.html:167
msgid "Currently watching" msgid "Currently watching"
msgstr "正在追看" msgstr "正在追看"
#: common/templates/_sidebar.html:218 #: common/templates/_sidebar.html:190
msgid "Common Tags" msgid "Common Tags"
msgstr "常用标签" msgstr "常用标签"
#: common/templates/_sidebar.html:242 #: common/templates/_sidebar.html:214
msgid "Recent Posts" msgid "Recent Posts"
msgstr "近期帖文" msgstr "近期帖文"

View file

@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-06-03 17:32-0400\n" "POT-Creation-Date: 2024-06-03 21:53-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -667,7 +667,7 @@ msgstr "不再提示"
#: catalog/templates/_item_comments_by_episode.html:78 #: catalog/templates/_item_comments_by_episode.html:78
#: catalog/templates/_item_reviews.html:43 #: catalog/templates/_item_reviews.html:43
#: catalog/templates/podcast_episode_data.html:41 #: catalog/templates/podcast_episode_data.html:41
#: common/templates/_sidebar.html:231 #: common/templates/_sidebar.html:203
msgid "show more" msgid "show more"
msgstr "顯示更多" msgstr "顯示更多"
@ -1093,6 +1093,40 @@ msgstr "顯示"
msgid "hide" msgid "hide"
msgstr "隱藏" msgstr "隱藏"
#: catalog/templates/discover.html:155 common/templates/_sidebar.html:14
msgid "Unread Announcements"
msgstr "未讀公告"
#: catalog/templates/discover.html:161 common/templates/_sidebar.html:20
msgid "mark all as read"
msgstr "全部標爲已讀"
#: catalog/templates/discover.html:170
msgid "Popular Posts"
msgstr "熱門帖文"
#: catalog/templates/discover.html:178
#: common/templates/_sidebar_anonymous.html:51
msgid "Popular Tags"
msgstr "熱門標籤"
#: catalog/templates/discover.html:185 catalog/templates/item_base.html:236
#: catalog/templates/item_mark_list.html:54
#: catalog/templates/item_review_list.html:50 common/templates/_sidebar.html:98
#: common/templates/_sidebar.html:198
#: common/templates/_sidebar_anonymous.html:43
#: common/templates/_sidebar_anonymous.html:58
#: journal/templates/collection_items.html:8 journal/templates/posts.html:43
#: journal/templates/profile.html:109 journal/templates/profile.html:151
#: journal/templates/profile.html:187
#: journal/templates/user_collection_list.html:51
#: journal/templates/user_item_list_base.html:25
#: journal/templates/user_tag_list.html:29 social/templates/events.html:45
#: users/templates/users/announcements.html:54
#: users/templates/users/relationship_list.html:11
msgid "nothing so far."
msgstr "暫無內容。"
#: catalog/templates/edition.html:36 #: catalog/templates/edition.html:36
msgid "publication date" msgid "publication date"
msgstr "發行時間" msgstr "發行時間"
@ -1163,23 +1197,6 @@ msgstr "評分人數不足"
msgid "overview" msgid "overview"
msgstr "簡介" msgstr "簡介"
#: catalog/templates/item_base.html:236
#: catalog/templates/item_mark_list.html:54
#: catalog/templates/item_review_list.html:50 common/templates/_sidebar.html:37
#: common/templates/_sidebar.html:126 common/templates/_sidebar.html:226
#: common/templates/_sidebar_anonymous.html:43
#: common/templates/_sidebar_anonymous.html:58
#: journal/templates/collection_items.html:8 journal/templates/posts.html:39
#: journal/templates/profile.html:109 journal/templates/profile.html:151
#: journal/templates/profile.html:187
#: journal/templates/user_collection_list.html:51
#: journal/templates/user_item_list_base.html:25
#: journal/templates/user_tag_list.html:29 social/templates/events.html:45
#: users/templates/users/announcements.html:54
#: users/templates/users/relationship_list.html:11
msgid "nothing so far."
msgstr "暫無內容。"
#: catalog/templates/item_base.html:243 #: catalog/templates/item_base.html:243
msgid "comments" msgid "comments"
msgstr "短評" msgstr "短評"
@ -1523,52 +1540,35 @@ msgstr "註冊或登錄"
msgid "Set a username." msgid "Set a username."
msgstr "設置用戶名" msgstr "設置用戶名"
#: common/templates/_sidebar.html:14 #: common/templates/_sidebar.html:53
msgid "Unread Announcements"
msgstr "未讀公告"
#: common/templates/_sidebar.html:20
msgid "mark all as read"
msgstr "全部標爲已讀"
#: common/templates/_sidebar.html:30
#: common/templates/_sidebar_anonymous.html:51
msgid "Popular Tags"
msgstr "熱門標籤"
#: common/templates/_sidebar.html:48
msgid "Popular Posts"
msgstr "熱門帖文"
#: common/templates/_sidebar.html:81
msgid "approving followers manually" msgid "approving followers manually"
msgstr "已開啓關注審覈" msgstr "已開啓關注審覈"
#: common/templates/_sidebar.html:111 #: common/templates/_sidebar.html:83
msgid "Current Targets" msgid "Current Targets"
msgstr "當前目標" msgstr "當前目標"
#: common/templates/_sidebar.html:124 #: common/templates/_sidebar.html:96
msgid "Set a collection as target, its progress will show up here." msgid "Set a collection as target, its progress will show up here."
msgstr "將自己或他人的收藏單設爲目標,這裏就會顯示進度" msgstr "將自己或他人的收藏單設爲目標,這裏就會顯示進度"
#: common/templates/_sidebar.html:137 #: common/templates/_sidebar.html:109
msgid "Recent podcast episodes" msgid "Recent podcast episodes"
msgstr "近期播客節目" msgstr "近期播客節目"
#: common/templates/_sidebar.html:172 #: common/templates/_sidebar.html:144
msgid "Currently reading" msgid "Currently reading"
msgstr "正在閱讀" msgstr "正在閱讀"
#: common/templates/_sidebar.html:195 #: common/templates/_sidebar.html:167
msgid "Currently watching" msgid "Currently watching"
msgstr "正在追看" msgstr "正在追看"
#: common/templates/_sidebar.html:218 #: common/templates/_sidebar.html:190
msgid "Common Tags" msgid "Common Tags"
msgstr "常用標籤" msgstr "常用標籤"
#: common/templates/_sidebar.html:242 #: common/templates/_sidebar.html:214
msgid "Recent Posts" msgid "Recent Posts"
msgstr "近期帖文" msgstr "近期帖文"