Add owner to list of collections.
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Sun, 24 Feb 2013 15:09:45 +0000 (16:09 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Sun, 24 Feb 2013 17:44:29 +0000 (18:44 +0100)
When listing the collections, that a media is contained in,
also show the owner of the collection.

Also simplify the whole looping a lot.

mediagoblin/templates/mediagoblin/utils/collections.html

index 2cff7a298c17139377bd9b0f0416a0c1b6145c57..69738e267edc1c86d2946ccf734293695d2f25ab 100644 (file)
     <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 %}