Use media.id for collecting media too.
Also remove some useless whitespace while at it.
This commit is contained in:
parent
954b407cf8
commit
96a2249bc0
@ -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>
|
||||
|
@ -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> ·
|
||||
{% 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 %}
|
||||
|
@ -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',
|
||||
|
@ -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"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user