Also remove some useless whitespace while at it.
{% block mediagoblin_content %}
<form action="{{ request.urlgen('mediagoblin.user_pages.media_collect',
user=media.get_uploader.username,
- media=media.id) }}"
+ media_id=media.id) }}"
method="POST" enctype="multipart/form-data">
<div class="form_box">
<h1>
{% if media.collections %}
<h3>{% trans %}Collected in{% endtrans %}</h3>
<p>
- {% for collection in media.collections %}
+ {%- 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 %}
{% else %}
<a href="{{ collection.url_for_self(request.urlgen) }}">{{ collection['title'] }}</a> ·
{% endif %}
- {% endfor %}
+ {%- endfor %}
</p>
- {% endif %}
- {% if request.user %}
+ {%- endif %}
+ {%- if request.user %}
<p>
<a type="submit" href="{{ request.urlgen('mediagoblin.user_pages.media_collect',
user=media.get_uploader.username,
- media=media.id) }}"
+ media_id=media.id) }}"
class="button_action">
{% trans %}Add to a collection{% endtrans %}
</a>
</p>
- {% endif %}
+ {%- endif %}
{% endblock %}
'mediagoblin.user_pages.views:atom_feed')
add_route('mediagoblin.user_pages.media_collect',
- '/u/<string:user>/m/<string:media>/collect/',
+ '/u/<string:user>/m/<int:media_id>/collect/',
'mediagoblin.user_pages.views:media_collect')
add_route('mediagoblin.user_pages.collection_list',
return redirect(request, location=media.url_for_self(request.urlgen))
-@get_user_media_entry
+@get_media_entry_by_id
@require_active_login
def media_collect(request, media):
"""Add media to collection submission"""