render timeline with takahe posts
This commit is contained in:
parent
250f13eb5a
commit
3bf583930e
14 changed files with 322 additions and 128 deletions
|
@ -1,29 +1,34 @@
|
||||||
section.replies {
|
.post {
|
||||||
border-left: 1px solid var(--pico-muted-color);
|
|
||||||
margin-left: var(--pico-spacing);
|
|
||||||
padding-left: var(--pico-spacing);
|
|
||||||
margin-bottom: 0 !important;
|
|
||||||
>div {
|
|
||||||
margin-bottom: calc(var(--pico-spacing));
|
|
||||||
}
|
|
||||||
p {
|
p {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0.5em;
|
||||||
}
|
}
|
||||||
details {
|
section.replies {
|
||||||
summary {
|
border-left: 1px solid var(--pico-muted-color);
|
||||||
text-decoration: underline;
|
margin-left: var(--pico-spacing);
|
||||||
|
padding-left: var(--pico-spacing);
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
>div {
|
||||||
|
margin-bottom: calc(var(--pico-spacing));
|
||||||
}
|
}
|
||||||
}
|
p {
|
||||||
form {
|
margin-bottom: 0;
|
||||||
margin-bottom: 0;
|
|
||||||
select {
|
|
||||||
width: min-content;
|
|
||||||
}
|
}
|
||||||
button{
|
details {
|
||||||
height: calc(1rem * var(--pico-line-height) + var(--pico-form-element-spacing-vertical) * 2 + var(--pico-border-width) * 2)
|
summary {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
details.dropdown > summary::after {
|
form {
|
||||||
display: none;
|
margin-bottom: 0;
|
||||||
|
select {
|
||||||
|
width: min-content;
|
||||||
|
}
|
||||||
|
button{
|
||||||
|
height: calc(1rem * var(--pico-line-height) + var(--pico-form-element-spacing-vertical) * 2 + var(--pico-border-width) * 2)
|
||||||
|
}
|
||||||
|
details.dropdown > summary::after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
.sidebar {
|
.sidebar {
|
||||||
article {
|
article {
|
||||||
padding: calc(var(--pico-block-spacing-horizontal));
|
padding: calc(var(--pico-block-spacing-horizontal));
|
||||||
|
article {
|
||||||
|
box-shadow: unset;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
details {
|
details {
|
||||||
|
@ -77,7 +80,7 @@
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
|
|
||||||
section,
|
section,
|
||||||
article,
|
>section>article,
|
||||||
details {
|
details {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
@import '_legacy.sass';
|
@import '_legacy.sass';
|
||||||
@import '_legacy2.scss';
|
@import '_legacy2.scss';
|
||||||
@import '_collection.scss';
|
@import '_collection.scss';
|
||||||
@import '_feed.scss';
|
|
||||||
@import '_card.scss';
|
@import '_card.scss';
|
||||||
@import '_gallery.scss';
|
@import '_gallery.scss';
|
||||||
@import '_sidebar.scss';
|
@import '_sidebar.scss';
|
||||||
|
|
|
@ -128,6 +128,10 @@ class Piece(PolymorphicModel, UserOwnedObjectMixin):
|
||||||
"takahe.Post", related_name="pieces", through="PiecePost"
|
"takahe.Post", related_name="pieces", through="PiecePost"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def classname(self) -> str:
|
||||||
|
return self.__class__.__name__.lower()
|
||||||
|
|
||||||
def get_mastodon_crosspost_url(self):
|
def get_mastodon_crosspost_url(self):
|
||||||
return (
|
return (
|
||||||
(self.metadata or {}).get("shared_link")
|
(self.metadata or {}).get("shared_link")
|
||||||
|
|
|
@ -210,9 +210,13 @@ class Note(Content):
|
||||||
if len(lines) < 3 or lines[-2].strip() not in _separaters:
|
if len(lines) < 3 or lines[-2].strip() not in _separaters:
|
||||||
return content, None, None
|
return content, None, None
|
||||||
progress_type, progress_value = cls.extract_progress(lines[-1])
|
progress_type, progress_value = cls.extract_progress(lines[-1])
|
||||||
# if progress_value is None and not lines[-2].startswith("https://"):
|
# if progress_value is None and not lines[-1].startswith("https://"):
|
||||||
# return content, None, None
|
# return content, None, None
|
||||||
return "\n".join(lines[:-2]), progress_type, progress_value
|
return ( # remove one extra empty line generated from <p> tags
|
||||||
|
"\n".join(lines[: (-3 if lines[-3] == "" else -2)]),
|
||||||
|
progress_type,
|
||||||
|
progress_value,
|
||||||
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def extract_progress(cls, content) -> tuple[str | None, str | None]:
|
def extract_progress(cls, content) -> tuple[str | None, str | None]:
|
||||||
|
@ -224,7 +228,7 @@ class Note(Content):
|
||||||
return None, ""
|
return None, ""
|
||||||
m = m.groupdict()
|
m = m.groupdict()
|
||||||
typ_ = "percentage" if m["postfix"] == "%" else m.get("prefix", "")
|
typ_ = "percentage" if m["postfix"] == "%" else m.get("prefix", "")
|
||||||
match typ_:
|
match typ_.lower():
|
||||||
case "p" | "pg" | "page":
|
case "p" | "pg" | "page":
|
||||||
typ = Note.ProgressType.PAGE
|
typ = Note.ProgressType.PAGE
|
||||||
case "ch" | "chapter":
|
case "ch" | "chapter":
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{% load humanize %}
|
{% load humanize %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% for post in posts %}
|
{% for post in posts %}
|
||||||
<section class="activity">
|
<section class="activity post">
|
||||||
<div style="display:flex;">
|
<div style="display:flex;">
|
||||||
<div>
|
<div>
|
||||||
<div class="avatar" style="margin:0.6em 0.6em 0.6em 0;">
|
<div class="avatar" style="margin:0.6em 0.6em 0.6em 0;">
|
||||||
|
|
|
@ -264,6 +264,12 @@ class NoteTest(TestCase):
|
||||||
self.assertEqual(t, Note.ProgressType.PAGE)
|
self.assertEqual(t, Note.ProgressType.PAGE)
|
||||||
self.assertEqual(v, "1")
|
self.assertEqual(v, "1")
|
||||||
|
|
||||||
|
c0 = "test \n - \nP 99"
|
||||||
|
c, t, v = Note.strip_footer(c0)
|
||||||
|
self.assertEqual(c, "test ")
|
||||||
|
self.assertEqual(t, Note.ProgressType.PAGE)
|
||||||
|
self.assertEqual(v, "99")
|
||||||
|
|
||||||
c0 = "test \n - \n pt 1 "
|
c0 = "test \n - \n pt 1 "
|
||||||
c, t, v = Note.strip_footer(c0)
|
c, t, v = Note.strip_footer(c0)
|
||||||
self.assertEqual(c, "test ")
|
self.assertEqual(c, "test ")
|
||||||
|
|
|
@ -53,7 +53,7 @@ def post_boost(request: AuthedHttpRequest, post_id: int):
|
||||||
post = Takahe.get_post(post_id)
|
post = Takahe.get_post(post_id)
|
||||||
if not post:
|
if not post:
|
||||||
raise BadRequest(_("Invalid parameter"))
|
raise BadRequest(_("Invalid parameter"))
|
||||||
if request.user.mastodon_site:
|
if request.user.mastodon_site and request.user.preference.mastodon_repost_mode == 1:
|
||||||
boost_toot_later(request.user, post.object_uri)
|
boost_toot_later(request.user, post.object_uri)
|
||||||
else:
|
else:
|
||||||
Takahe.boost_post(post_id, request.user.identity.pk)
|
Takahe.boost_post(post_id, request.user.identity.pk)
|
||||||
|
|
|
@ -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-16 21:51-0400\n"
|
"POT-Creation-Date: 2024-06-18 00:07-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"
|
||||||
|
@ -15,15 +15,15 @@ msgstr ""
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
#: boofilsic/settings.py:393
|
#: boofilsic/settings.py:394
|
||||||
msgid "English"
|
msgid "English"
|
||||||
msgstr "英语"
|
msgstr "英语"
|
||||||
|
|
||||||
#: boofilsic/settings.py:394
|
#: boofilsic/settings.py:395
|
||||||
msgid "Simplified Chinese"
|
msgid "Simplified Chinese"
|
||||||
msgstr "简体中文"
|
msgstr "简体中文"
|
||||||
|
|
||||||
#: boofilsic/settings.py:395
|
#: boofilsic/settings.py:396
|
||||||
msgid "Traditional Chinese"
|
msgid "Traditional Chinese"
|
||||||
msgstr "繁体中文"
|
msgstr "繁体中文"
|
||||||
|
|
||||||
|
@ -401,27 +401,27 @@ msgstr "元数据"
|
||||||
msgid "cover"
|
msgid "cover"
|
||||||
msgstr "封面"
|
msgstr "封面"
|
||||||
|
|
||||||
#: catalog/common/models.py:620
|
#: catalog/common/models.py:628
|
||||||
msgid "source site"
|
msgid "source site"
|
||||||
msgstr "来源站点"
|
msgstr "来源站点"
|
||||||
|
|
||||||
#: catalog/common/models.py:622
|
#: catalog/common/models.py:630
|
||||||
msgid "ID on source site"
|
msgid "ID on source site"
|
||||||
msgstr "来源站点标识"
|
msgstr "来源站点标识"
|
||||||
|
|
||||||
#: catalog/common/models.py:624
|
#: catalog/common/models.py:632
|
||||||
msgid "source url"
|
msgid "source url"
|
||||||
msgstr "来源站点网址"
|
msgstr "来源站点网址"
|
||||||
|
|
||||||
#: catalog/common/models.py:640
|
#: catalog/common/models.py:648
|
||||||
msgid "IdType of the source site"
|
msgid "IdType of the source site"
|
||||||
msgstr "来源站点的主要标识类型"
|
msgstr "来源站点的主要标识类型"
|
||||||
|
|
||||||
#: catalog/common/models.py:646
|
#: catalog/common/models.py:654
|
||||||
msgid "Primary Id on the source site"
|
msgid "Primary Id on the source site"
|
||||||
msgstr "来源站点的主要标识数据"
|
msgstr "来源站点的主要标识数据"
|
||||||
|
|
||||||
#: catalog/common/models.py:649
|
#: catalog/common/models.py:657
|
||||||
msgid "url to the resource"
|
msgid "url to the resource"
|
||||||
msgstr "指向外部资源的网址"
|
msgstr "指向外部资源的网址"
|
||||||
|
|
||||||
|
@ -675,6 +675,7 @@ msgstr "显示更多"
|
||||||
#: catalog/templates/_item_reviews.html:47
|
#: catalog/templates/_item_reviews.html:47
|
||||||
#: catalog/templates/podcast_episode_data.html:44
|
#: catalog/templates/podcast_episode_data.html:44
|
||||||
#: social/templates/events.html:43 social/templates/feed_data.html:44
|
#: social/templates/events.html:43 social/templates/feed_data.html:44
|
||||||
|
#: social/templates/feed_events.html:114
|
||||||
msgid "nothing more."
|
msgid "nothing more."
|
||||||
msgstr "没有更多内容了。"
|
msgstr "没有更多内容了。"
|
||||||
|
|
||||||
|
@ -1538,6 +1539,7 @@ msgid "Set a username."
|
||||||
msgstr "设置用户名"
|
msgstr "设置用户名"
|
||||||
|
|
||||||
#: common/templates/_sidebar.html:53
|
#: common/templates/_sidebar.html:53
|
||||||
|
#: users/templates/users/profile_actions.html:29
|
||||||
msgid "approving followers manually"
|
msgid "approving followers manually"
|
||||||
msgstr "已开启关注审核"
|
msgstr "已开启关注审核"
|
||||||
|
|
||||||
|
@ -1746,64 +1748,64 @@ msgstr "仅关注者"
|
||||||
msgid "Mentioned Only"
|
msgid "Mentioned Only"
|
||||||
msgstr "自己和提到的人"
|
msgstr "自己和提到的人"
|
||||||
|
|
||||||
#: journal/models/note.py:33
|
#: journal/models/note.py:35
|
||||||
msgid "Page"
|
msgid "Page"
|
||||||
msgstr "页码"
|
msgstr "页码"
|
||||||
|
|
||||||
#: journal/models/note.py:34
|
#: journal/models/note.py:36
|
||||||
msgid "Chapter"
|
msgid "Chapter"
|
||||||
msgstr "章节"
|
msgstr "章节"
|
||||||
|
|
||||||
#: journal/models/note.py:37
|
#: journal/models/note.py:39
|
||||||
msgid "Part"
|
msgid "Part"
|
||||||
msgstr "分部"
|
msgstr "分部"
|
||||||
|
|
||||||
#: journal/models/note.py:38
|
#: journal/models/note.py:40
|
||||||
msgid "Episode"
|
msgid "Episode"
|
||||||
msgstr "单集"
|
msgstr "单集"
|
||||||
|
|
||||||
#: journal/models/note.py:39
|
#: journal/models/note.py:41
|
||||||
msgid "Track"
|
msgid "Track"
|
||||||
msgstr "曲目"
|
msgstr "曲目"
|
||||||
|
|
||||||
#: journal/models/note.py:40
|
#: journal/models/note.py:42
|
||||||
msgid "Cycle"
|
msgid "Cycle"
|
||||||
msgstr "周目"
|
msgstr "周目"
|
||||||
|
|
||||||
#: journal/models/note.py:41
|
#: journal/models/note.py:43
|
||||||
msgid "Timestamp"
|
msgid "Timestamp"
|
||||||
msgstr "时间戳"
|
msgstr "时间戳"
|
||||||
|
|
||||||
#: journal/models/note.py:42
|
#: journal/models/note.py:44
|
||||||
msgid "Percentage"
|
msgid "Percentage"
|
||||||
msgstr "百分比"
|
msgstr "百分比"
|
||||||
|
|
||||||
#: journal/models/note.py:59
|
#: journal/models/note.py:61
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Page {value}"
|
msgid "Page {value}"
|
||||||
msgstr "第{value}页"
|
msgstr "第{value}页"
|
||||||
|
|
||||||
#: journal/models/note.py:60
|
#: journal/models/note.py:62
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Chapter {value}"
|
msgid "Chapter {value}"
|
||||||
msgstr "第{value}章"
|
msgstr "第{value}章"
|
||||||
|
|
||||||
#: journal/models/note.py:63
|
#: journal/models/note.py:65
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Part {value}"
|
msgid "Part {value}"
|
||||||
msgstr "第{value}部"
|
msgstr "第{value}部"
|
||||||
|
|
||||||
#: journal/models/note.py:64
|
#: journal/models/note.py:66
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Episode {value}"
|
msgid "Episode {value}"
|
||||||
msgstr "第{value}集"
|
msgstr "第{value}集"
|
||||||
|
|
||||||
#: journal/models/note.py:65
|
#: journal/models/note.py:67
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Track {value}"
|
msgid "Track {value}"
|
||||||
msgstr "第{value}首"
|
msgstr "第{value}首"
|
||||||
|
|
||||||
#: journal/models/note.py:66
|
#: journal/models/note.py:68
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Cycle {value}"
|
msgid "Cycle {value}"
|
||||||
msgstr "{value}周目"
|
msgstr "{value}周目"
|
||||||
|
@ -2671,7 +2673,7 @@ msgstr "列表未找到"
|
||||||
msgid "Content too long for your Fediverse instance."
|
msgid "Content too long for your Fediverse instance."
|
||||||
msgstr "内容过长,超出了你的联邦实例的限制。"
|
msgstr "内容过长,超出了你的联邦实例的限制。"
|
||||||
|
|
||||||
#: journal/views/mark.py:163 journal/views/note.py:94
|
#: journal/views/mark.py:163 journal/views/note.py:98
|
||||||
#: journal/views/review.py:30
|
#: journal/views/review.py:30
|
||||||
msgid "Content not found"
|
msgid "Content not found"
|
||||||
msgstr "内容未找到"
|
msgstr "内容未找到"
|
||||||
|
@ -2688,11 +2690,11 @@ msgstr "笔记内容"
|
||||||
msgid "Content Warning (optional)"
|
msgid "Content Warning (optional)"
|
||||||
msgstr "剧透或敏感内容提示(选填)"
|
msgstr "剧透或敏感内容提示(选填)"
|
||||||
|
|
||||||
#: journal/views/note.py:62
|
#: journal/views/note.py:66
|
||||||
msgid "Progress Type (optional)"
|
msgid "Progress Type (optional)"
|
||||||
msgstr "进度类型(选填)"
|
msgstr "进度类型(选填)"
|
||||||
|
|
||||||
#: journal/views/note.py:102
|
#: journal/views/note.py:106
|
||||||
msgid "Invalid form data"
|
msgid "Invalid form data"
|
||||||
msgstr "无效表单信息。"
|
msgstr "无效表单信息。"
|
||||||
|
|
||||||
|
@ -2792,6 +2794,7 @@ msgid "target site domain name"
|
||||||
msgstr "目标实例域名"
|
msgstr "目标实例域名"
|
||||||
|
|
||||||
#: social/templates/activity/comment_child_item.html:12
|
#: social/templates/activity/comment_child_item.html:12
|
||||||
|
#: social/templates/feed_events.html:34
|
||||||
msgid "play"
|
msgid "play"
|
||||||
msgstr "播放"
|
msgstr "播放"
|
||||||
|
|
||||||
|
@ -2816,6 +2819,7 @@ msgstr "赞了 <a href=\"%(owner_url)s\">%(owner_name)s</a> 的收藏单"
|
||||||
#: social/templates/activity/mark_item.html:19
|
#: social/templates/activity/mark_item.html:19
|
||||||
#: social/templates/activity/review_item.html:12
|
#: social/templates/activity/review_item.html:12
|
||||||
#: social/templates/activity/review_item.html:19
|
#: social/templates/activity/review_item.html:19
|
||||||
|
#: social/templates/feed_events.html:45
|
||||||
msgid "mark"
|
msgid "mark"
|
||||||
msgstr "标记"
|
msgstr "标记"
|
||||||
|
|
||||||
|
@ -2983,11 +2987,19 @@ msgstr ""
|
||||||
msgid "Activities from those you follow"
|
msgid "Activities from those you follow"
|
||||||
msgstr "好友动态"
|
msgstr "好友动态"
|
||||||
|
|
||||||
#: social/templates/feed_data.html:48
|
#: social/templates/feed_data.html:48 social/templates/feed_events.html:118
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Find and mark some books/movies/podcasts/games, <a href=\"%(import_url)s\">import your data</a> from Goodreads/Letterboxd/Douban, follow some fellow %(site_name)s users on the fediverse, so their recent activities and yours will show up here."
|
msgid "Find and mark some books/movies/podcasts/games, <a href=\"%(import_url)s\">import your data</a> from Goodreads/Letterboxd/Douban, follow some fellow %(site_name)s users on the fediverse, so their recent activities and yours will show up here."
|
||||||
msgstr "搜索并标记一些书影音/播客/游戏,<a href=\"%(import_url)s\">导入你的豆瓣、Letterboxd或Goodreads记录</a>,去联邦宇宙(长毛象)关注一些正在使用%(site_name)s的用户,这里就会显示你和她们的近期动态。"
|
msgstr "搜索并标记一些书影音/播客/游戏,<a href=\"%(import_url)s\">导入你的豆瓣、Letterboxd或Goodreads记录</a>,去联邦宇宙(长毛象)关注一些正在使用%(site_name)s的用户,这里就会显示你和她们的近期动态。"
|
||||||
|
|
||||||
|
#: social/templates/feed_events.html:19
|
||||||
|
msgid "boosted"
|
||||||
|
msgstr "转播了"
|
||||||
|
|
||||||
|
#: social/templates/feed_events.html:64
|
||||||
|
msgid "wrote a note"
|
||||||
|
msgstr "写了笔记"
|
||||||
|
|
||||||
#: social/templates/notification.html:28
|
#: social/templates/notification.html:28
|
||||||
msgid "mention"
|
msgid "mention"
|
||||||
msgstr "提及"
|
msgstr "提及"
|
||||||
|
@ -3741,63 +3753,63 @@ msgstr "已屏蔽"
|
||||||
msgid "user profile"
|
msgid "user profile"
|
||||||
msgstr "用户资料"
|
msgstr "用户资料"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:32
|
#: users/templates/users/profile_actions.html:39
|
||||||
msgid "original home"
|
msgid "original home"
|
||||||
msgstr "原始主页"
|
msgstr "原始主页"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:63
|
#: users/templates/users/profile_actions.html:72
|
||||||
msgid "accept follow request"
|
msgid "accept follow request"
|
||||||
msgstr "接受关注请求"
|
msgstr "接受关注请求"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:65
|
#: users/templates/users/profile_actions.html:74
|
||||||
msgid "sure to accept follow request?"
|
msgid "sure to accept follow request?"
|
||||||
msgstr "确定接受关注请求吗?"
|
msgstr "确定接受关注请求吗?"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:73
|
#: users/templates/users/profile_actions.html:82
|
||||||
msgid "reject follow request"
|
msgid "reject follow request"
|
||||||
msgstr "拒绝关注请求"
|
msgstr "拒绝关注请求"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:75
|
#: users/templates/users/profile_actions.html:84
|
||||||
msgid "sure to reject follow request?"
|
msgid "sure to reject follow request?"
|
||||||
msgstr "确定拒绝关注请求吗?"
|
msgstr "确定拒绝关注请求吗?"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:85
|
#: users/templates/users/profile_actions.html:94
|
||||||
msgid "click to unfollow"
|
msgid "click to unfollow"
|
||||||
msgstr "点击可取消关注"
|
msgstr "点击可取消关注"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:87
|
#: users/templates/users/profile_actions.html:96
|
||||||
msgid "sure to unfollow?"
|
msgid "sure to unfollow?"
|
||||||
msgstr "确定取消关注该用户吗?"
|
msgstr "确定取消关注该用户吗?"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:96
|
#: users/templates/users/profile_actions.html:105
|
||||||
msgid "click to cancel follow request"
|
msgid "click to cancel follow request"
|
||||||
msgstr "点击可取消关注请求"
|
msgstr "点击可取消关注请求"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:98
|
#: users/templates/users/profile_actions.html:107
|
||||||
msgid "sure to cancel follow request?"
|
msgid "sure to cancel follow request?"
|
||||||
msgstr "确定取消关注请求吗?"
|
msgstr "确定取消关注请求吗?"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:107
|
#: users/templates/users/profile_actions.html:116
|
||||||
msgid "click to follow"
|
msgid "click to follow"
|
||||||
msgstr "点击可关注"
|
msgstr "点击可关注"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:108
|
#: users/templates/users/profile_actions.html:117
|
||||||
msgid "sure to follow?"
|
msgid "sure to follow?"
|
||||||
msgstr "确定关注该用户吗?"
|
msgstr "确定关注该用户吗?"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:118
|
|
||||||
msgid "click to mute"
|
|
||||||
msgstr "点击可取消屏蔽"
|
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:127
|
#: users/templates/users/profile_actions.html:127
|
||||||
|
msgid "click to mute"
|
||||||
|
msgstr "点击可静音"
|
||||||
|
|
||||||
|
#: users/templates/users/profile_actions.html:136
|
||||||
msgid "click to unmute"
|
msgid "click to unmute"
|
||||||
msgstr "点击可取消静音"
|
msgstr "点击可取消静音"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:137
|
#: users/templates/users/profile_actions.html:146
|
||||||
msgid "click to block"
|
msgid "click to block"
|
||||||
msgstr "点击可屏蔽"
|
msgstr "点击可屏蔽"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:138
|
#: users/templates/users/profile_actions.html:147
|
||||||
msgid "sure to block?"
|
msgid "sure to block?"
|
||||||
msgstr "确定屏蔽该用户吗?"
|
msgstr "确定屏蔽该用户吗?"
|
||||||
|
|
||||||
|
|
|
@ -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-16 21:51-0400\n"
|
"POT-Creation-Date: 2024-06-18 00:07-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"
|
||||||
|
@ -15,15 +15,15 @@ msgstr ""
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
#: boofilsic/settings.py:393
|
#: boofilsic/settings.py:394
|
||||||
msgid "English"
|
msgid "English"
|
||||||
msgstr "英語"
|
msgstr "英語"
|
||||||
|
|
||||||
#: boofilsic/settings.py:394
|
#: boofilsic/settings.py:395
|
||||||
msgid "Simplified Chinese"
|
msgid "Simplified Chinese"
|
||||||
msgstr "簡體中文"
|
msgstr "簡體中文"
|
||||||
|
|
||||||
#: boofilsic/settings.py:395
|
#: boofilsic/settings.py:396
|
||||||
msgid "Traditional Chinese"
|
msgid "Traditional Chinese"
|
||||||
msgstr "繁體中文"
|
msgstr "繁體中文"
|
||||||
|
|
||||||
|
@ -401,27 +401,27 @@ msgstr "元數據"
|
||||||
msgid "cover"
|
msgid "cover"
|
||||||
msgstr "封面"
|
msgstr "封面"
|
||||||
|
|
||||||
#: catalog/common/models.py:620
|
#: catalog/common/models.py:628
|
||||||
msgid "source site"
|
msgid "source site"
|
||||||
msgstr "來源站點"
|
msgstr "來源站點"
|
||||||
|
|
||||||
#: catalog/common/models.py:622
|
#: catalog/common/models.py:630
|
||||||
msgid "ID on source site"
|
msgid "ID on source site"
|
||||||
msgstr "來源站點標識"
|
msgstr "來源站點標識"
|
||||||
|
|
||||||
#: catalog/common/models.py:624
|
#: catalog/common/models.py:632
|
||||||
msgid "source url"
|
msgid "source url"
|
||||||
msgstr "來源站點網址"
|
msgstr "來源站點網址"
|
||||||
|
|
||||||
#: catalog/common/models.py:640
|
#: catalog/common/models.py:648
|
||||||
msgid "IdType of the source site"
|
msgid "IdType of the source site"
|
||||||
msgstr "來源站點的主要標識類型"
|
msgstr "來源站點的主要標識類型"
|
||||||
|
|
||||||
#: catalog/common/models.py:646
|
#: catalog/common/models.py:654
|
||||||
msgid "Primary Id on the source site"
|
msgid "Primary Id on the source site"
|
||||||
msgstr "來源站點的主要標識數據"
|
msgstr "來源站點的主要標識數據"
|
||||||
|
|
||||||
#: catalog/common/models.py:649
|
#: catalog/common/models.py:657
|
||||||
msgid "url to the resource"
|
msgid "url to the resource"
|
||||||
msgstr "指向外部資源的網址"
|
msgstr "指向外部資源的網址"
|
||||||
|
|
||||||
|
@ -675,6 +675,7 @@ msgstr "顯示更多"
|
||||||
#: catalog/templates/_item_reviews.html:47
|
#: catalog/templates/_item_reviews.html:47
|
||||||
#: catalog/templates/podcast_episode_data.html:44
|
#: catalog/templates/podcast_episode_data.html:44
|
||||||
#: social/templates/events.html:43 social/templates/feed_data.html:44
|
#: social/templates/events.html:43 social/templates/feed_data.html:44
|
||||||
|
#: social/templates/feed_events.html:114
|
||||||
msgid "nothing more."
|
msgid "nothing more."
|
||||||
msgstr "沒有更多內容了。"
|
msgstr "沒有更多內容了。"
|
||||||
|
|
||||||
|
@ -1538,6 +1539,7 @@ msgid "Set a username."
|
||||||
msgstr "設置用戶名"
|
msgstr "設置用戶名"
|
||||||
|
|
||||||
#: common/templates/_sidebar.html:53
|
#: common/templates/_sidebar.html:53
|
||||||
|
#: users/templates/users/profile_actions.html:29
|
||||||
msgid "approving followers manually"
|
msgid "approving followers manually"
|
||||||
msgstr "已開啓關注審覈"
|
msgstr "已開啓關注審覈"
|
||||||
|
|
||||||
|
@ -1746,64 +1748,64 @@ msgstr "僅關注者"
|
||||||
msgid "Mentioned Only"
|
msgid "Mentioned Only"
|
||||||
msgstr "自己和提到的人"
|
msgstr "自己和提到的人"
|
||||||
|
|
||||||
#: journal/models/note.py:33
|
#: journal/models/note.py:35
|
||||||
msgid "Page"
|
msgid "Page"
|
||||||
msgstr "頁碼"
|
msgstr "頁碼"
|
||||||
|
|
||||||
#: journal/models/note.py:34
|
#: journal/models/note.py:36
|
||||||
msgid "Chapter"
|
msgid "Chapter"
|
||||||
msgstr "章節"
|
msgstr "章節"
|
||||||
|
|
||||||
#: journal/models/note.py:37
|
#: journal/models/note.py:39
|
||||||
msgid "Part"
|
msgid "Part"
|
||||||
msgstr "分部"
|
msgstr "分部"
|
||||||
|
|
||||||
#: journal/models/note.py:38
|
#: journal/models/note.py:40
|
||||||
msgid "Episode"
|
msgid "Episode"
|
||||||
msgstr "單集"
|
msgstr "單集"
|
||||||
|
|
||||||
#: journal/models/note.py:39
|
#: journal/models/note.py:41
|
||||||
msgid "Track"
|
msgid "Track"
|
||||||
msgstr "曲目"
|
msgstr "曲目"
|
||||||
|
|
||||||
#: journal/models/note.py:40
|
#: journal/models/note.py:42
|
||||||
msgid "Cycle"
|
msgid "Cycle"
|
||||||
msgstr "周目"
|
msgstr "周目"
|
||||||
|
|
||||||
#: journal/models/note.py:41
|
#: journal/models/note.py:43
|
||||||
msgid "Timestamp"
|
msgid "Timestamp"
|
||||||
msgstr "時間戳"
|
msgstr "時間戳"
|
||||||
|
|
||||||
#: journal/models/note.py:42
|
#: journal/models/note.py:44
|
||||||
msgid "Percentage"
|
msgid "Percentage"
|
||||||
msgstr "百分比"
|
msgstr "百分比"
|
||||||
|
|
||||||
#: journal/models/note.py:59
|
#: journal/models/note.py:61
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Page {value}"
|
msgid "Page {value}"
|
||||||
msgstr "第{value}頁"
|
msgstr "第{value}頁"
|
||||||
|
|
||||||
#: journal/models/note.py:60
|
#: journal/models/note.py:62
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Chapter {value}"
|
msgid "Chapter {value}"
|
||||||
msgstr "第{value}章"
|
msgstr "第{value}章"
|
||||||
|
|
||||||
#: journal/models/note.py:63
|
#: journal/models/note.py:65
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Part {value}"
|
msgid "Part {value}"
|
||||||
msgstr "第{value}部"
|
msgstr "第{value}部"
|
||||||
|
|
||||||
#: journal/models/note.py:64
|
#: journal/models/note.py:66
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Episode {value}"
|
msgid "Episode {value}"
|
||||||
msgstr "第{value}集"
|
msgstr "第{value}集"
|
||||||
|
|
||||||
#: journal/models/note.py:65
|
#: journal/models/note.py:67
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Track {value}"
|
msgid "Track {value}"
|
||||||
msgstr "第{value}首"
|
msgstr "第{value}首"
|
||||||
|
|
||||||
#: journal/models/note.py:66
|
#: journal/models/note.py:68
|
||||||
#, python-brace-format
|
#, python-brace-format
|
||||||
msgid "Cycle {value}"
|
msgid "Cycle {value}"
|
||||||
msgstr "{value}周目"
|
msgstr "{value}周目"
|
||||||
|
@ -2671,7 +2673,7 @@ msgstr "列表未找到"
|
||||||
msgid "Content too long for your Fediverse instance."
|
msgid "Content too long for your Fediverse instance."
|
||||||
msgstr "內容過長,超出了你的聯邦實例的限制。"
|
msgstr "內容過長,超出了你的聯邦實例的限制。"
|
||||||
|
|
||||||
#: journal/views/mark.py:163 journal/views/note.py:94
|
#: journal/views/mark.py:163 journal/views/note.py:98
|
||||||
#: journal/views/review.py:30
|
#: journal/views/review.py:30
|
||||||
msgid "Content not found"
|
msgid "Content not found"
|
||||||
msgstr "內容未找到"
|
msgstr "內容未找到"
|
||||||
|
@ -2688,11 +2690,11 @@ msgstr "筆記內容"
|
||||||
msgid "Content Warning (optional)"
|
msgid "Content Warning (optional)"
|
||||||
msgstr "劇透或敏感內容提示(選填)"
|
msgstr "劇透或敏感內容提示(選填)"
|
||||||
|
|
||||||
#: journal/views/note.py:62
|
#: journal/views/note.py:66
|
||||||
msgid "Progress Type (optional)"
|
msgid "Progress Type (optional)"
|
||||||
msgstr "進度類型(選填)"
|
msgstr "進度類型(選填)"
|
||||||
|
|
||||||
#: journal/views/note.py:102
|
#: journal/views/note.py:106
|
||||||
msgid "Invalid form data"
|
msgid "Invalid form data"
|
||||||
msgstr "無效表單信息。"
|
msgstr "無效表單信息。"
|
||||||
|
|
||||||
|
@ -2792,6 +2794,7 @@ msgid "target site domain name"
|
||||||
msgstr "目標實例域名"
|
msgstr "目標實例域名"
|
||||||
|
|
||||||
#: social/templates/activity/comment_child_item.html:12
|
#: social/templates/activity/comment_child_item.html:12
|
||||||
|
#: social/templates/feed_events.html:34
|
||||||
msgid "play"
|
msgid "play"
|
||||||
msgstr "播放"
|
msgstr "播放"
|
||||||
|
|
||||||
|
@ -2816,6 +2819,7 @@ msgstr "讚了 <a href=\"%(owner_url)s\">%(owner_name)s</a> 的收藏單"
|
||||||
#: social/templates/activity/mark_item.html:19
|
#: social/templates/activity/mark_item.html:19
|
||||||
#: social/templates/activity/review_item.html:12
|
#: social/templates/activity/review_item.html:12
|
||||||
#: social/templates/activity/review_item.html:19
|
#: social/templates/activity/review_item.html:19
|
||||||
|
#: social/templates/feed_events.html:45
|
||||||
msgid "mark"
|
msgid "mark"
|
||||||
msgstr "標記"
|
msgstr "標記"
|
||||||
|
|
||||||
|
@ -2983,11 +2987,23 @@ msgstr ""
|
||||||
msgid "Activities from those you follow"
|
msgid "Activities from those you follow"
|
||||||
msgstr "好友動態"
|
msgstr "好友動態"
|
||||||
|
|
||||||
#: social/templates/feed_data.html:48
|
#: social/templates/feed_data.html:48 social/templates/feed_events.html:118
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "Find and mark some books/movies/podcasts/games, <a href=\"%(import_url)s\">import your data</a> from Goodreads/Letterboxd/Douban, follow some fellow %(site_name)s users on the fediverse, so their recent activities and yours will show up here."
|
msgid "Find and mark some books/movies/podcasts/games, <a href=\"%(import_url)s\">import your data</a> from Goodreads/Letterboxd/Douban, follow some fellow %(site_name)s users on the fediverse, so their recent activities and yours will show up here."
|
||||||
msgstr "搜索並標記一些書影音/播客/遊戲,<a href=\"%(import_url)s\">導入你的豆瓣、Letterboxd或Goodreads記錄</a>,去聯邦宇宙(長毛象)關注一些正在使用%(site_name)s的用戶,這裏就會顯示你和她們的近期動態。"
|
msgstr "搜索並標記一些書影音/播客/遊戲,<a href=\"%(import_url)s\">導入你的豆瓣、Letterboxd或Goodreads記錄</a>,去聯邦宇宙(長毛象)關注一些正在使用%(site_name)s的用戶,這裏就會顯示你和她們的近期動態。"
|
||||||
|
|
||||||
|
#: social/templates/feed_events.html:19
|
||||||
|
#, fuzzy
|
||||||
|
#| msgid "boost"
|
||||||
|
msgid "boosted"
|
||||||
|
msgstr "轉播"
|
||||||
|
|
||||||
|
#: social/templates/feed_events.html:64
|
||||||
|
#, fuzzy
|
||||||
|
#| msgid "create a new post"
|
||||||
|
msgid "wrote a note"
|
||||||
|
msgstr "另發新帖文"
|
||||||
|
|
||||||
#: social/templates/notification.html:28
|
#: social/templates/notification.html:28
|
||||||
msgid "mention"
|
msgid "mention"
|
||||||
msgstr "提及"
|
msgstr "提及"
|
||||||
|
@ -3741,63 +3757,63 @@ msgstr "已屏蔽"
|
||||||
msgid "user profile"
|
msgid "user profile"
|
||||||
msgstr "用戶資料"
|
msgstr "用戶資料"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:32
|
#: users/templates/users/profile_actions.html:39
|
||||||
msgid "original home"
|
msgid "original home"
|
||||||
msgstr "原始主頁"
|
msgstr "原始主頁"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:63
|
#: users/templates/users/profile_actions.html:72
|
||||||
msgid "accept follow request"
|
msgid "accept follow request"
|
||||||
msgstr "接受關注請求"
|
msgstr "接受關注請求"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:65
|
#: users/templates/users/profile_actions.html:74
|
||||||
msgid "sure to accept follow request?"
|
msgid "sure to accept follow request?"
|
||||||
msgstr "確定接受關注請求嗎?"
|
msgstr "確定接受關注請求嗎?"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:73
|
#: users/templates/users/profile_actions.html:82
|
||||||
msgid "reject follow request"
|
msgid "reject follow request"
|
||||||
msgstr "拒絕關注請求"
|
msgstr "拒絕關注請求"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:75
|
#: users/templates/users/profile_actions.html:84
|
||||||
msgid "sure to reject follow request?"
|
msgid "sure to reject follow request?"
|
||||||
msgstr "確定拒絕關注請求嗎?"
|
msgstr "確定拒絕關注請求嗎?"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:85
|
#: users/templates/users/profile_actions.html:94
|
||||||
msgid "click to unfollow"
|
msgid "click to unfollow"
|
||||||
msgstr "點擊可取消關注"
|
msgstr "點擊可取消關注"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:87
|
#: users/templates/users/profile_actions.html:96
|
||||||
msgid "sure to unfollow?"
|
msgid "sure to unfollow?"
|
||||||
msgstr "確定取消關注該用戶嗎?"
|
msgstr "確定取消關注該用戶嗎?"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:96
|
#: users/templates/users/profile_actions.html:105
|
||||||
msgid "click to cancel follow request"
|
msgid "click to cancel follow request"
|
||||||
msgstr "點擊可取消關注請求"
|
msgstr "點擊可取消關注請求"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:98
|
#: users/templates/users/profile_actions.html:107
|
||||||
msgid "sure to cancel follow request?"
|
msgid "sure to cancel follow request?"
|
||||||
msgstr "確定取消關注請求嗎?"
|
msgstr "確定取消關注請求嗎?"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:107
|
#: users/templates/users/profile_actions.html:116
|
||||||
msgid "click to follow"
|
msgid "click to follow"
|
||||||
msgstr "點擊可關注"
|
msgstr "點擊可關注"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:108
|
#: users/templates/users/profile_actions.html:117
|
||||||
msgid "sure to follow?"
|
msgid "sure to follow?"
|
||||||
msgstr "確定關注該用戶嗎?"
|
msgstr "確定關注該用戶嗎?"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:118
|
|
||||||
msgid "click to mute"
|
|
||||||
msgstr "點擊可取消屏蔽"
|
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:127
|
#: users/templates/users/profile_actions.html:127
|
||||||
|
msgid "click to mute"
|
||||||
|
msgstr "點擊可靜音"
|
||||||
|
|
||||||
|
#: users/templates/users/profile_actions.html:136
|
||||||
msgid "click to unmute"
|
msgid "click to unmute"
|
||||||
msgstr "點擊可取消靜音"
|
msgstr "點擊可取消靜音"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:137
|
#: users/templates/users/profile_actions.html:146
|
||||||
msgid "click to block"
|
msgid "click to block"
|
||||||
msgstr "點擊可屏蔽"
|
msgstr "點擊可屏蔽"
|
||||||
|
|
||||||
#: users/templates/users/profile_actions.html:138
|
#: users/templates/users/profile_actions.html:147
|
||||||
msgid "sure to block?"
|
msgid "sure to block?"
|
||||||
msgstr "確定屏蔽該用戶嗎?"
|
msgstr "確定屏蔽該用戶嗎?"
|
||||||
|
|
||||||
|
|
124
social/templates/feed_events.html
Normal file
124
social/templates/feed_events.html
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
{% load bleach_tags %}
|
||||||
|
{% load static %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% load l10n %}
|
||||||
|
{% load humanize %}
|
||||||
|
{% load mastodon %}
|
||||||
|
{% load thumb %}
|
||||||
|
{% load user_actions %}
|
||||||
|
{% load duration %}
|
||||||
|
{% for event in events %}
|
||||||
|
{% with event.subject_post as post %}
|
||||||
|
<section class="activity post">
|
||||||
|
{% if event.type == "boost" %}
|
||||||
|
<div class="boosted">
|
||||||
|
<i class="fa-solid fa-retweet"
|
||||||
|
title="{{ event.published|naturaldelta }}"></i>
|
||||||
|
<a href="{{ event.subject_identity.url }}"
|
||||||
|
class="nickname"
|
||||||
|
title="@{{ event.subject_identity.handle }}">{{ event.subject_identity.name }}</a>
|
||||||
|
{% trans 'boosted' %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
<div style="display:flex;">
|
||||||
|
<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="timestamp">{{ post.published|naturaldelta }}</span>
|
||||||
|
{% if post.piece and post.piece.item and post.piece.item.classname != 'tvepisode' %}
|
||||||
|
<span>
|
||||||
|
{% if post.piece.item.classname == 'podcastepisode' %}
|
||||||
|
<a title="{% trans "play" %}"
|
||||||
|
class="episode"
|
||||||
|
data-uuid="{{ post.piece.item.uuid }}"
|
||||||
|
data-media="{{ post.piece.item.media_url }}"
|
||||||
|
data-cover="{{ post.piece.item.cover_url|default:post.piece.item.parent_item.cover.url }}"
|
||||||
|
data-title="{{ post.piece.item.title }}"
|
||||||
|
data-album="{{ post.piece.item.parent_item.title }}"
|
||||||
|
data-hosts="{{ post.piece.item.parent_item.hosts|join:' / ' }}"
|
||||||
|
{% if request.user.is_authenticated %} data-comment-href="{% url 'journal:comment' post.piece.item.uuid %}" {% endif %}
|
||||||
|
data-position="{{ post.piece.metadata.position | default:0 }}"><i class="fa-solid fa-circle-play"></i></a>
|
||||||
|
{% else %}
|
||||||
|
<a title="{% trans "mark" %}"
|
||||||
|
hx-get="{% url 'journal:mark' post.piece.item.uuid %}?shelf_type=wishlist"
|
||||||
|
hx-target="body"
|
||||||
|
hx-swap="beforeend">
|
||||||
|
<i class="fa-regular fa-bookmark"></i>
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
{% include "action_reply_post.html" %}
|
||||||
|
{% include "action_like_post.html" %}
|
||||||
|
{% include "action_boost_post.html" %}
|
||||||
|
{% include "action_open_post.html" %}
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<a href="{{ post.author.url }}"
|
||||||
|
class="nickname"
|
||||||
|
title="@{{ post.author.handle }}">{{ post.author.name }}</a>
|
||||||
|
{% if post.piece and post.piece.classname == 'note' %}
|
||||||
|
{% trans "wrote a note" %}
|
||||||
|
{% endif %}
|
||||||
|
</span>
|
||||||
|
<div>{{ post.summary|default:'' }}</div>
|
||||||
|
<div {% if post.summary or post.sensitive %}class="spoiler" _="on click toggle .revealed on me"{% endif %}>
|
||||||
|
<div class="attachments">
|
||||||
|
{% for attachment in post.attachments.all %}
|
||||||
|
{% if attachment.is_image %}
|
||||||
|
<a href="#img_{{ post.pk }}_{{ loop.index }}">
|
||||||
|
<img src="{{ attachment.thumbnail_url.relative }}"
|
||||||
|
alt="image attachment"
|
||||||
|
class="preview">
|
||||||
|
</a>
|
||||||
|
<a href="#" class="lightbox" id="img_{{ post.pk }}_{{ loop.index }}">
|
||||||
|
<span style="background-image: url('{{ attachment.full_url.relative }}')"></span>
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% if post.piece and post.piece.classname == 'note' %}
|
||||||
|
<blockquote class="tldr"
|
||||||
|
_="on click toggle .tldr on me"
|
||||||
|
style="margin:0;
|
||||||
|
padding-top:0;
|
||||||
|
padding-bottom:0">
|
||||||
|
{{ post.content|bleach:"a,p,span,br,div,img"|default:"" }}
|
||||||
|
</blockquote>
|
||||||
|
{% else %}
|
||||||
|
{{ post.content|bleach:"a,p,span,br,div,img"|default:"" }}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% if post.piece %}
|
||||||
|
{% if post.piece.item %}
|
||||||
|
<article>{% include "_item_card.html" with item=post.piece.item allow_embed=1 %}</article>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="replies_{{ post.pk }}"></div>
|
||||||
|
</section>
|
||||||
|
{% endwith %}
|
||||||
|
{% if forloop.last %}
|
||||||
|
<div class="htmx-indicator"
|
||||||
|
style="margin-left: 60px"
|
||||||
|
hx-get="{% url 'social:data' %}?last={{ event.pk }}"
|
||||||
|
hx-trigger="revealed"
|
||||||
|
hx-swap="outerHTML">
|
||||||
|
<i class="fa-solid fa-compact-disc fa-spin loading"></i>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% empty %}
|
||||||
|
{% if request.GET.last %}
|
||||||
|
<div class="empty">{% trans 'nothing more.' %}</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="empty">
|
||||||
|
{% url 'users:data' as import_url %}
|
||||||
|
{% blocktrans %}Find and mark some books/movies/podcasts/games, <a href="{{ import_url }}">import your data</a> from Goodreads/Letterboxd/Douban, follow some fellow {{ site_name }} users on the fediverse, so their recent activities and yours will show up here.{% endblocktrans %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
|
@ -5,6 +5,7 @@ from django.views.decorators.http import require_http_methods
|
||||||
|
|
||||||
from catalog.models import *
|
from catalog.models import *
|
||||||
from journal.models import *
|
from journal.models import *
|
||||||
|
from takahe.models import TimelineEvent
|
||||||
from takahe.utils import Takahe
|
from takahe.utils import Takahe
|
||||||
|
|
||||||
from .models import *
|
from .models import *
|
||||||
|
@ -57,15 +58,28 @@ def feed(request):
|
||||||
@login_required
|
@login_required
|
||||||
@require_http_methods(["GET"])
|
@require_http_methods(["GET"])
|
||||||
def data(request):
|
def data(request):
|
||||||
return render(
|
since_id = int(request.GET.get("last", 0))
|
||||||
request,
|
events = TimelineEvent.objects.filter(
|
||||||
"feed_data.html",
|
identity_id=request.user.identity.pk,
|
||||||
{
|
type__in=[TimelineEvent.Types.post, TimelineEvent.Types.boost],
|
||||||
"activities": ActivityManager(request.user.identity).get_timeline(
|
).order_by("-id")
|
||||||
before_time=request.GET.get("last")
|
if since_id:
|
||||||
)[:PAGE_SIZE],
|
events = events.filter(id__lt=since_id)
|
||||||
},
|
return render(request, "feed_events.html", {"events": events})
|
||||||
)
|
|
||||||
|
|
||||||
|
# @login_required
|
||||||
|
# @require_http_methods(["GET"])
|
||||||
|
# def data(request):
|
||||||
|
# return render(
|
||||||
|
# request,
|
||||||
|
# "feed_data.html",
|
||||||
|
# {
|
||||||
|
# "activities": ActivityManager(request.user.identity).get_timeline(
|
||||||
|
# before_time=request.GET.get("last")
|
||||||
|
# )[:PAGE_SIZE],
|
||||||
|
# },
|
||||||
|
# )
|
||||||
|
|
||||||
|
|
||||||
@require_http_methods(["GET"])
|
@require_http_methods(["GET"])
|
||||||
|
|
|
@ -1084,7 +1084,7 @@ class Post(models.Model):
|
||||||
def piece(self):
|
def piece(self):
|
||||||
from journal.models import Piece, ShelfMember
|
from journal.models import Piece, ShelfMember
|
||||||
|
|
||||||
pcs = Piece.objects.filter(post_id=self.pk)
|
pcs = Piece.objects.filter(posts=self.pk)
|
||||||
if len(pcs) == 1:
|
if len(pcs) == 1:
|
||||||
return pcs[0]
|
return pcs[0]
|
||||||
return next((p for p in pcs if p.__class__ == ShelfMember), None)
|
return next((p for p in pcs if p.__class__ == ShelfMember), None)
|
||||||
|
|
|
@ -24,6 +24,13 @@
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if identity.locked %}
|
||||||
|
<span>
|
||||||
|
<a title="{% trans "approving followers manually" %}">
|
||||||
|
<i class="fa-solid fa-user-shield"></i>
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
{% if not identity.local %}
|
{% if not identity.local %}
|
||||||
<span>
|
<span>
|
||||||
<a href="{{ identity.profile_uri }}"
|
<a href="{{ identity.profile_uri }}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue