Add owner to list of collections.

When listing the collections, that a media is contained in,
also show the owner of the collection.

Also simplify the whole looping a lot.
This commit is contained in:
Elrond 2013-02-24 16:09:45 +01:00
parent 96a2249bc0
commit 5a05016896

View File

@ -21,17 +21,13 @@
<h3>{% trans %}Collected in{% endtrans %}</h3>
<p>
{%- for collection in media.collections %}
{% if loop.last %}
{# the 'and' should only appear if there is more than one collections #}
{% if media.collections|length > 1 %}
&middot;
{% endif %}
<a href="{{ collection.url_for_self(request.urlgen) }}">{{ collection['title'] }}</a>
{% elif loop.revindex == 2 %}
<a href="{{ collection.url_for_self(request.urlgen) }}">{{ collection['title'] }}</a>
{% else %}
<a href="{{ collection.url_for_self(request.urlgen) }}">{{ collection['title'] }}</a> &middot;
{% endif %}
{%- if not loop.first %}
&middot;
{%- endif %}
<a href="{{ collection.url_for_self(request.urlgen) }}">
{{- collection.title }} (
{{- collection.get_creator.username -}}
)</a>
{%- endfor %}
</p>
{%- endif %}