Template fixes

This commit is contained in:
Thomas Sileo 2022-08-18 20:53:51 +02:00
parent 2d28ca3614
commit d3b7f6ccbb
4 changed files with 16 additions and 3 deletions

View file

@ -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?) # - fix issue with followers from a blocked server (skip it?)
# - CORS webfinger endpoint # - CORS webfinger endpoint
# - allow to share old notes # - 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 # - only show 10 most recent threads in DMs
# - prevent double accept/double follow # - prevent double accept/double follow
# - UI support for updating posts # - UI support for updating posts
# - indieauth tweaks # - indieauth tweaks
# - API for posting notes # - API for posting notes
# - allow to block servers
# - FT5 text search # - FT5 text search
# - support update post with history? # - support update post with history?
# - cleanup tasks # - cleanup tasks
@ -435,6 +433,7 @@ async def following(
select(models.Following) select(models.Following)
.options(joinedload(models.Following.actor)) .options(joinedload(models.Following.actor))
.order_by(models.Following.created_at.desc()) .order_by(models.Following.created_at.desc())
.limit(20)
) )
) )
.unique() .unique()
@ -815,7 +814,7 @@ async def wellknown_webfinger(resource: str) -> JSONResponse:
{ {
"rel": "http://webfinger.net/rel/profile-page", "rel": "http://webfinger.net/rel/profile-page",
"type": "text/html", "type": "text/html",
"href": ID, "href": ID + "/",
}, },
{"rel": "self", "type": "application/activity+json", "href": ID}, {"rel": "self", "type": "application/activity+json", "href": ID},
{ {

View file

@ -16,7 +16,9 @@
{% set x_more = followers_count - followers | length %} {% set x_more = followers_count - followers | length %}
{% if x_more > 0 %} {% if x_more > 0 %}
<div class="box">
<p>And {{ x_more }} more.</p> <p>And {{ x_more }} more.</p>
</div>
{% endif %} {% endif %}
{% if is_admin %} {% if is_admin %}

View file

@ -16,7 +16,9 @@
{% set x_more = following_count - following | length %} {% set x_more = following_count - following | length %}
{% if x_more > 0 %} {% if x_more > 0 %}
<div class="box">
<p>And {{ x_more }} more.</p> <p>And {{ x_more }} more.</p>
</div>
{% endif %} {% endif %}
{% if is_admin %} {% if is_admin %}

View file

@ -577,6 +577,11 @@
<img src="{{ like.actor.resized_icon_url }}" alt="{{ like.actor.handle}}" style="max-width:50px;"> <img src="{{ like.actor.resized_icon_url }}" alt="{{ like.actor.handle}}" style="max-width:50px;">
</a> </a>
{% endfor %} {% endfor %}
{% if object.likes_count > likes | length %}
<div style="display:inline-block;align-self:center;">
and {{ object.likes_count - likes | length }} more.
</div>
{% endif %}
</div> </div>
</div> </div>
{% endif %} {% endif %}
@ -589,6 +594,11 @@
<img src="{{ share.actor.resized_icon_url }}" alt="{{ share.actor.handle}}" style="max-width:50px;"> <img src="{{ share.actor.resized_icon_url }}" alt="{{ share.actor.handle}}" style="max-width:50px;">
</a> </a>
{% endfor %} {% endfor %}
{% if object.announces_count > shares | length %}
<div style="display:inline-block;align-self:center;">
and {{ object.announces_count - shares | length }} more.
</div>
{% endif %}
</div> </div>
</div> </div>
{% endif %} {% endif %}