mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-11-15 03:04:28 +00:00
Fix plurals in counters
This commit is contained in:
parent
4ab45e4ad9
commit
0cb0459966
2 changed files with 16 additions and 9 deletions
|
@ -250,19 +250,19 @@
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if meta.count_reply and obj.id | is_from_outbox %}<a class ="bar-item" href="{{ obj.url | get_url }}"><strong>{{ meta.count_reply }}</strong> replies</a>
|
{% if meta.count_reply and obj.id | is_from_outbox %}<a class ="bar-item" href="{{ obj.url | get_url }}"><strong>{{ meta.count_reply }}</strong> replie{% if meta.count_reply > 1 %}s{% endif %}</a>
|
||||||
{% elif meta.count_reply and session.logged_in %}
|
{% elif meta.count_reply and session.logged_in %}
|
||||||
<a class="bar-item" href="/admin/thread?oid={{aid}}"><strong>{{ meta.count_reply }}</strong> replies</a>{% endif %}
|
<a class="bar-item" href="/admin/thread?oid={{aid}}"><strong>{{ meta.count_reply }}</strong> replie{% if meta.count_reply > 1 %}s{% endif %}</a>{% endif %}
|
||||||
|
|
||||||
|
|
||||||
{% if not perma and meta.count_boost and obj.id | is_from_outbox %}<a class ="bar-item" href="{{ obj.url | get_url }}"><strong>{{ meta.count_boost }}</strong> boosts</a>{% endif %}
|
{% if not perma and meta.count_boost and obj.id | is_from_outbox %}<a class ="bar-item" href="{{ obj.url | get_url }}"><strong>{{ meta.count_boost }}</strong> boost{% if meta.count_boost > 1 %}s{% endif %}</a>{% endif %}
|
||||||
{% if not perma and meta.count_like and obj.id | is_from_outbox %}<a class ="bar-item" href="{{ obj.url | get_url }}"><strong>{{ meta.count_like }}</strong> likes</a>{% endif %}
|
{% if not perma and meta.count_like and obj.id | is_from_outbox %}<a class ="bar-item" href="{{ obj.url | get_url }}"><strong>{{ meta.count_like }}</strong> like{% if meta.count_like > 1 %}s{% endif %}</a>{% endif %}
|
||||||
|
|
||||||
{% if session.logged_in %}
|
{% if session.logged_in %}
|
||||||
{% if ui%}
|
{% if ui%}
|
||||||
<a class="bar-item" href="/admin/new?reply={{ aid }}">reply</a>
|
<a class="bar-item" href="/admin/new?reply={{ aid }}">reply</a>
|
||||||
|
|
||||||
{% if meta.object_visibility | visibility_is_public %}
|
{% if meta | get_visibility | visibility_is_public %}
|
||||||
{% if meta.boosted %}
|
{% if meta.boosted %}
|
||||||
<form action="/api/undo" class="action-form" method="POST">
|
<form action="/api/undo" class="action-form" method="POST">
|
||||||
<input type="hidden" name="redirect" value="{{ redir }}">
|
<input type="hidden" name="redirect" value="{{ redir }}">
|
||||||
|
@ -348,7 +348,7 @@
|
||||||
<a class="bar-item" href="/admin/thread?oid={{aid}}">thread</a>
|
<a class="bar-item" href="/admin/thread?oid={{aid}}">thread</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if meta.object_visibility | visibility_is_public %}
|
{% if meta | get_visibility | visibility_is_public %}
|
||||||
{% if obj | url_or_id | get_url | is_from_outbox %}
|
{% if obj | url_or_id | get_url | is_from_outbox %}
|
||||||
{% if not perma %}
|
{% if not perma %}
|
||||||
<a class="bar-item" href="{{ obj | url_or_id | get_url }}">permalink</a>
|
<a class="bar-item" href="{{ obj | url_or_id | get_url }}">permalink</a>
|
||||||
|
@ -360,7 +360,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a class="bar-item bar-item-no-border">{{ meta.object_visibility | visibility }}</a>
|
<a class="bar-item bar-item-no-border">{{ meta | get_visibility | visibility }}</a>
|
||||||
|
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
|
@ -368,14 +368,14 @@
|
||||||
<aside style="padding-top:20px;" class="pure-g">
|
<aside style="padding-top:20px;" class="pure-g">
|
||||||
{% if likes %}
|
{% if likes %}
|
||||||
<div class="pure-u-1-2">
|
<div class="pure-u-1-2">
|
||||||
<h4 style="font-weight:normal"><strong>{{ likes|length }}</strong> likes</h4>{% for like in likes %}
|
<h4 style="font-weight:normal"><strong>{{ likes|length }}</strong> like{% if (likes | length) > 1 %}s{% endif %}</h4>{% for like in likes %}
|
||||||
{{ display_actor_inline(like) }}
|
{{ display_actor_inline(like) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if shares %}
|
{% if shares %}
|
||||||
<div class="pure-u-1-2">
|
<div class="pure-u-1-2">
|
||||||
<h4 style="font-weight:normal"><strong>{{ shares|length }}</strong> boosts</h4>{% for boost in shares %}
|
<h4 style="font-weight:normal"><strong>{{ shares|length }}</strong> boost{% if (shares|length) > 1 %}s{% endif %}</h4>{% for boost in shares %}
|
||||||
{{ display_actor_inline(boost) }}
|
{{ display_actor_inline(boost) }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -35,6 +35,13 @@ H2T.ignore_images = True
|
||||||
filters = flask.Blueprint("filters", __name__)
|
filters = flask.Blueprint("filters", __name__)
|
||||||
|
|
||||||
|
|
||||||
|
@filters.app_template_filter()
|
||||||
|
def get_visibility(meta):
|
||||||
|
if "object_visibility" in meta and meta["object_visibility"]:
|
||||||
|
return meta["object_visibility"]
|
||||||
|
return meta.get("visibility")
|
||||||
|
|
||||||
|
|
||||||
@filters.app_template_filter()
|
@filters.app_template_filter()
|
||||||
def visibility(v: str) -> str:
|
def visibility(v: str) -> str:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue