[TEMPLATES] Tweak note complimentary info to not output empty <span>s
This commit is contained in:
parent
802a8d124a
commit
7ca4330f17
|
@ -129,19 +129,19 @@
|
||||||
<div class="note-complementary-info">
|
<div class="note-complementary-info">
|
||||||
{% for complementary_info in complementary_info_array %}
|
{% for complementary_info in complementary_info_array %}
|
||||||
{% set formatted = [] %}
|
{% set formatted = [] %}
|
||||||
{% if complementary_info['action'] is defined and not null %}
|
{% for complementary_info_actor in complementary_info['actors'] %}
|
||||||
|
{% if complementary_info_actor is defined and (app.user is null or complementary_info_actor.getId() != app.user.getId()) %}
|
||||||
|
{% set tmp %}<a href="{{ complementary_info_actor.getUrl() }}">{{ complementary_info_actor.getNickname() }}</a>{% endset %}
|
||||||
|
{% set formatted = formatted|merge([tmp]) %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% if formatted is not empty %}
|
||||||
<span>
|
<span>
|
||||||
{% for complementary_info_actor in complementary_info['actors'] %}
|
|
||||||
{% if complementary_info_actor is defined and (app.user is null or complementary_info_actor.getId() != app.user.getId()) %}
|
|
||||||
{% set tmp %}<a href="{{ complementary_info_actor.getUrl() }}">{{ complementary_info_actor.getNickname() }}</a>{% endset %}
|
|
||||||
{% set formatted = formatted|merge([tmp]) %}
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
{{ trans(
|
{{ trans(
|
||||||
{
|
[
|
||||||
'1': "{formatted} has {action} this note",
|
"{formatted} has {action} this note",
|
||||||
'other': "{formatted} have {action} this note"
|
"{formatted} have {action} this note"
|
||||||
},
|
],
|
||||||
{
|
{
|
||||||
'count': formatted|length,
|
'count': formatted|length,
|
||||||
'formatted': trans_list(formatted),
|
'formatted': trans_list(formatted),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user