From d3b7f6ccbbf4e6e127d8e733364ce1585c8a8cb9 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Thu, 18 Aug 2022 20:53:51 +0200 Subject: [PATCH] Template fixes --- app/main.py | 5 ++--- app/templates/followers.html | 2 ++ app/templates/following.html | 2 ++ app/templates/utils.html | 10 ++++++++++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/main.py b/app/main.py index cdbb0d0..d4d6366 100644 --- a/app/main.py +++ b/app/main.py @@ -79,13 +79,11 @@ _RESIZED_CACHE: MutableMapping[tuple[str, int], tuple[bytes, str, Any]] = LFUCac # - fix issue with followers from a blocked server (skip it?) # - CORS webfinger endpoint # - allow to share old notes -# - allow to interact with object not in anybox (i.e. like from a lookup) # - only show 10 most recent threads in DMs # - prevent double accept/double follow # - UI support for updating posts # - indieauth tweaks # - API for posting notes -# - allow to block servers # - FT5 text search # - support update post with history? # - cleanup tasks @@ -435,6 +433,7 @@ async def following( select(models.Following) .options(joinedload(models.Following.actor)) .order_by(models.Following.created_at.desc()) + .limit(20) ) ) .unique() @@ -815,7 +814,7 @@ async def wellknown_webfinger(resource: str) -> JSONResponse: { "rel": "http://webfinger.net/rel/profile-page", "type": "text/html", - "href": ID, + "href": ID + "/", }, {"rel": "self", "type": "application/activity+json", "href": ID}, { diff --git a/app/templates/followers.html b/app/templates/followers.html index fba76a4..a5df2bb 100644 --- a/app/templates/followers.html +++ b/app/templates/followers.html @@ -16,7 +16,9 @@ {% set x_more = followers_count - followers | length %} {% if x_more > 0 %} +

And {{ x_more }} more.

+
{% endif %} {% if is_admin %} diff --git a/app/templates/following.html b/app/templates/following.html index 5ff7831..b8db603 100644 --- a/app/templates/following.html +++ b/app/templates/following.html @@ -16,7 +16,9 @@ {% set x_more = following_count - following | length %} {% if x_more > 0 %} +

And {{ x_more }} more.

+
{% endif %} {% if is_admin %} diff --git a/app/templates/utils.html b/app/templates/utils.html index 53aed58..1c24362 100644 --- a/app/templates/utils.html +++ b/app/templates/utils.html @@ -577,6 +577,11 @@ {{ like.actor.handle}} {% endfor %} + {% if object.likes_count > likes | length %} +
+ and {{ object.likes_count - likes | length }} more. +
+ {% endif %} {% endif %} @@ -589,6 +594,11 @@ {{ share.actor.handle}} {% endfor %} + {% if object.announces_count > shares | length %} +
+ and {{ object.announces_count - shares | length }} more. +
+ {% endif %} {% endif %}