Skip to content

Commit

Permalink
fix twig loop filter
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed May 19, 2020
1 parent cfaded2 commit 23172f2
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions plugins/Marketplace/templates/plugin-details.twig
Original file line number Diff line number Diff line change
Expand Up @@ -213,22 +213,20 @@
</dd>
{% endif %}
<dt>{{ 'Marketplace_Authors'|translate }}</dt>
<dd>{% for author in plugin.authors %}
{% if author.name %}
{% apply spaceless %}
{% if author.homepage %}
<a target="_blank" rel="noreferrer noopener" href="{{ author.homepage }}">{{ author.name }}</a>
{% elseif author.email %}
<a href="mailto:{{ author.email|escape('url') }}">{{ author.name }}</a>
{% else %}
{{ author.name }}
{% endif %}

{% if loop.index < plugin.authors|length %}
,
{% endif %}
{% endapply %}
{% endif %}
<dd>{% for author in plugin.authors|filter(author => author.name) %}
{% apply spaceless %}
{% if author.homepage %}
<a target="_blank" rel="noreferrer noopener" href="{{ author.homepage }}">{{ author.name }}</a>
{% elseif author.email %}
<a href="mailto:{{ author.email|escape('url') }}">{{ author.name }}</a>
{% else %}
{{ author.name }}
{% endif %}

{% if loop.index < plugin.authors|length %}
,
{% endif %}
{% endapply %}
{% endfor %}
</dd>
{% endif %}
Expand Down

0 comments on commit 23172f2

Please sign in to comment.