Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor UI tweak #817

Merged
merged 2 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions FEDERATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Federation

see [doc](docs/internals/federation.md) for FEP-67ff related information.
2 changes: 1 addition & 1 deletion catalog/common/jsondata.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def from_json(self: "fields.Field", value): # type:ignore
if isinstance(value, list):
return value
else: # backward compatible with dirty legacy data
logger.error(f"ArrayField has irregular value: {self.name}: {value}")
# logger.error(f"ArrayField has irregular value: {self.name}: {value}")
return [value]
return []

Expand Down
1 change: 0 additions & 1 deletion common/models/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def __init__(self, query: str, page: int = 1, page_size: int = 0):

def is_valid(self):
"""Check if the parsed query is valid"""
print(self.page, self.max_pages, self.q, self.filter_by)
return (
self.page > 0
and self.page <= self.max_pages
Expand Down
10 changes: 4 additions & 6 deletions common/templates/_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@
<option {% if request.GET.c == 'performance' or '/performance/' in request.path %}selected{% endif %}
value="performance">{% trans 'Performance' %}</option>
{% endif %}
{% if request.user.is_authenticated %}
<option {% if request.GET.c == 'journal' or '/users/' in request.path %}selected{% endif %}
value="journal">{% trans 'Journal' %}</option>
<option {% if request.GET.c == 'timeline' or '/timeline/' in request.path %}selected{% endif %}
value="timeline">{% trans 'Posts' %}</option>
{% endif %}
<option {% if request.GET.c == 'journal' %}selected{% endif %}
value="journal">{% trans 'Journal' %}</option>
<option {% if request.GET.c == 'timeline' %}selected{% endif %}
value="timeline">{% trans 'Posts' %}</option>
</select>
<input type="submit" value="&#xf002;" class="fa-solid" />
</form>
Expand Down
19 changes: 15 additions & 4 deletions docs/internals/federation.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# Federation

## ActivityPub
## Supported federation protocols and standards

NeoDB's ActivityPub implementation is based on [Takahē](https://jointakahe.org), with some change to enable interchange of additional information between NeoDB instances.
- [ActivityPub](https://www.w3.org/TR/activitypub/) (Server-to-Server)
- [WebFinger](https://webfinger.net/)
- [Http Signatures](https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures)
- [NodeInfo](https://nodeinfo.diaspora.software/)

## Supported FEPs

- [FEP-f1d5: NodeInfo in Fediverse Software](https://codeberg.org/fediverse/fep/src/branch/main/fep/f1d5/fep-f1d5.md)

### NodeInfo
## NodeInfo

NeoDB instances can be identified from user agent string (`NeoDB/x.x (+https://example.org)`) and its nodeinfo, e.g. https://neodb.social/nodeinfo/2.0/ :
NeoDB instances can be identified from user agent string (`NeoDB/x.x (+https://example.org)`) and `protocols` in its nodeinfo, e.g. https://neodb.social/nodeinfo/2.0/ :
```json
{
"version": "2.0",
Expand All @@ -21,6 +28,10 @@ NeoDB instances can be identified from user agent string (`NeoDB/x.x (+https://e
```


## ActivityPub

NeoDB's ActivityPub implementation is based on [Takahē](https://jointakahe.org), with some change to enable interchange of additional information between NeoDB instances.

### Activity

NeoDB add additional fields to `Note` activity:
Expand Down
20 changes: 12 additions & 8 deletions journal/templates/_list_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,15 @@
{% if mark.shelf %}
<section>
<div class="action">
{% include "action_open_post.html" with post=mark.shelfmember.latest_post %}
<span class="timestamp">{{ mark.created_time|date }}</span>
</div>
<div>
{% comment %} <a href="{{mark.owner.url }}" title="@{{ mark.owner.handle }}">{{ mark.owner.display_name }}</a> {% endcomment %}
<span>{{ mark.status_label }}</span>
{% if mark.rating_grade %}{{ mark.rating_grade|rating_star }}{% endif %}
<span>{{ mark.comment.html|safe }}</span>
</div>
<span class="tag-list">
{% for tag in mark.tags %}
{% if forloop.counter <= 5 %}
Expand All @@ -57,19 +64,15 @@
{% endif %}
{% endfor %}
</span>
<div>
{% comment %} <a href="{{mark.owner.url }}" title="@{{ mark.owner.handle }}">{{ mark.owner.display_name }}</a> {% endcomment %}
<span>{{ mark.status_label }}</span>
{% if mark.rating_grade %}{{ mark.rating_grade|rating_star }}{% endif %}
<span>{{ mark.comment.html|safe }}</span>
</div>
{% if mark.comment.latest_post %}<div id="replies_{{ mark.comment.latest_post.pk }}"></div>{% endif %}
</section>
{% endif %}
{% if mark.review %}
<section>
<span class="action">
<div class="action">
{% include "action_open_post.html" with post=mark.review.latest_post %}
<span class="timestamp">{{ mark.review.created_time|date }}</span>
</span>
</div>
<div class="tldr">
{% trans "Review" %}
<span>
Expand All @@ -78,6 +81,7 @@
-
{{ mark.review.plain_content }}
</div>
{% if mark.review.latest_post %}<div id="replies_{{ mark.review.latest_post.pk }}"></div>{% endif %}
</section>
{% endif %}
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions locale/zh_Hans/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2517,7 +2517,7 @@ msgstr ""
" <i class=\"fa-solid fa-puzzle-piece\"></i> &nbsp; %(site_name)s 致力于提供一个涵盖书籍、影视、音乐、游戏、播客的自由开放互联的收藏评论空间。 你可以在这里记录你的收藏和想法,以及发现新的内容和朋友。\n"
"</p>\n"
"<p>\n"
" <i class=\"fa-solid fa-globe\"></i> &nbsp; 登录%(site_name)s的最佳方式通过联邦宇宙(Fediverse,有时也被称为<em data-tooltip=\"除了最常见的长毛象,另外也有Pleroma、GoToSocial、Takahē、Catodon等联邦宇宙实例服务\">长毛象</em>,一种分布式社交网络)实例账号,如果你还没有注册过,可先<a href=\"https://joinmastodon.org/zh/servers\" target=\"_blank\">选择实例并注册</a>。\n"
" <i class=\"fa-solid fa-globe\"></i> &nbsp; 登录%(site_name)s的最佳方式通过<em data-tooltip=\"除了最常见的长毛象,另外也有Pleroma、GoToSocial、Takahē、Firefish、Catodon等联邦宇宙实例服务\">联邦宇宙(Fediverse,一种分布式社交网络)</em>实例账号,如果你还没有注册过,可先<a href=\"https://joinmastodon.org/zh/servers\" target=\"_blank\">选择实例并注册</a>。\n"
"</p>\n"
"<p>\n"
" <i class=\"fa-solid fa-envelope\"></i> &nbsp; 如果还没准备好注册联邦宇宙也没问题,你可以在登录页面选择电子邮件注册,未来再连接到联邦宇宙。\n"
Expand Down Expand Up @@ -4256,7 +4256,7 @@ msgstr "推荐输入电子邮件地址作为备用登录方式。"

#: users/templates/users/account.html:73 users/templates/users/login.html:69
msgid "Fediverse (Mastodon)"
msgstr "联邦宇宙(有时也被称为长毛象)"
msgstr "联邦宇宙(Mastodon API)"

#: users/templates/users/account.html:79
msgid "Verified Identity"
Expand Down
Loading