Use media.id for collecting media too.

Also remove some useless whitespace while at it.
This commit is contained in:
Elrond 2013-02-24 16:08:55 +01:00
parent 954b407cf8
commit 96a2249bc0
4 changed files with 9 additions and 9 deletions

View File

@ -33,7 +33,7 @@
{% 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>

View File

@ -20,7 +20,7 @@
{% 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 %}
@ -32,17 +32,17 @@
{% else %}
<a href="{{ collection.url_for_self(request.urlgen) }}">{{ collection['title'] }}</a> &middot;
{% 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 %}

View File

@ -50,7 +50,7 @@ add_route('mediagoblin.user_pages.atom_feed',
'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',

View File

@ -180,7 +180,7 @@ def media_post_comment(request, media):
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"""