from mediagoblin.tools.subtitles import open_subtitle,save_subtitle
@require_active_login
+@get_media_entry_by_id
+@user_may_delete_media
@path_subtitle
-def custom_subtitles(request,path=None):
+def custom_subtitles(request,media,path=None):
text = open_subtitle(path)
form = forms.CustomizeSubtitlesForm(request.form,
subtitle=text)
{%- for subtitle in media.subtitle_files %}
<li>
<a href="{{ request.urlgen('mediagoblin.edit.custom_subtitles',
+ user=media.get_actor.username,
+ media_id=media.id,
path=subtitle.filepath) }}">
- {{- subtitle.name -}}
+ {{- subtitle.name -}}
</li>
{%- endfor %}
</ul>
add_route('mediagoblin.edit.custom_subtitles',
- '/c_s/<string:path>',
+ '/u/<string:user>/m/<int:media_id>/c_s/<string:path>',
'mediagoblin.edit.views:custom_subtitles')
\ No newline at end of file