return wrapper
+def path_subtitle(controller):
+ """Retrieve <path> URL pattern and pass in as path=..."""
+
+
+ @wraps(controller)
+ def wrapper(request, *args, **kwargs):
+ path_sub = request.matchdict['path']
+
+ return controller(request, *args, path=path_sub, **kwargs)
+
+ return wrapper
+
+def path_subtitle(controller):
+ """Retrieve <path> URL pattern and pass in as path=..."""
+
+
+ @wraps(controller)
+ def wrapper(request, *args, **kwargs):
+ path_sub = request.matchdict['path']
+
+ return controller(request, *args, path=path_sub, **kwargs)
+
+ return wrapper
+
def user_may_delete_media(controller):
"""
import six
from datetime import datetime
+import os
from itsdangerous import BadSignature
from pyld import jsonld
from mediagoblin.decorators import (require_active_login, active_user_from_url,
get_media_entry_by_id, user_may_alter_collection,
get_user_collection, user_has_privilege,
- user_not_banned)
+ user_not_banned, path_subtitle)
from mediagoblin.tools.crypto import get_timed_signer_url
from mediagoblin.tools.metadata import (compact_and_validate, DEFAULT_CHECKER,
DEFAULT_SCHEMA)
@require_active_login
-def custom_subtitles(request,path):
+@path_subtitle
+def custom_subtitles(request,path=None):
+ path = path.encode('ascii','ignore')[1:-1]
return render_to_response(
request,
- "mediagoblin/templates/user_pages/custom_subtitles.html",
+ "mediagoblin/user_pages/custom_subtitles.html",
{"path": path}
)
\ No newline at end of file
add_route('mediagoblin.edit.metadata',
'/u/<string:user>/m/<int:media_id>/metadata/',
'mediagoblin.edit.views:edit_metadata')
+
+
+add_route('mediagoblin.edit.custom_subtitles',
+ '/c_s/<string:path>',
+ 'mediagoblin.edit.views:custom_subtitles')
\ No newline at end of file