aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mediagoblin/edit/views.py3
-rw-r--r--mediagoblin/templates/mediagoblin/user_pages/media.html2
-rw-r--r--mediagoblin/tools/subtitles.py10
3 files changed, 14 insertions, 1 deletions
diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py
index 6d3e684b..33643bf8 100644
--- a/mediagoblin/edit/views.py
+++ b/mediagoblin/edit/views.py
@@ -580,10 +580,13 @@ def edit_metadata(request, media):
'media':media})
+from mediagoblin.tools.subtitles import get_path
+
@require_active_login
@path_subtitle
def custom_subtitles(request,path=None):
form = forms.CustomizeSubtitlesForm(request.form)
+ path = get_path(path)
return render_to_response(
request,
"mediagoblin/edit/custom_subtitles.html",
diff --git a/mediagoblin/templates/mediagoblin/user_pages/media.html b/mediagoblin/templates/mediagoblin/user_pages/media.html
index a44f6377..3d28cf76 100644
--- a/mediagoblin/templates/mediagoblin/user_pages/media.html
+++ b/mediagoblin/templates/mediagoblin/user_pages/media.html
@@ -236,7 +236,7 @@
<li>
<a href="{{ request.urlgen('mediagoblin.edit.custom_subtitles',
path=subtitle.filepath) }}">
- {{- subtitle.filepath -}}
+ {{- subtitle.name -}}
</li>
{%- endfor %}
</ul>
diff --git a/mediagoblin/tools/subtitles.py b/mediagoblin/tools/subtitles.py
new file mode 100644
index 00000000..7002cdfc
--- /dev/null
+++ b/mediagoblin/tools/subtitles.py
@@ -0,0 +1,10 @@
+import ast
+
+def get_path(path):
+ """
+ Converting the path of the form
+ x = u'[ "A","B","C" ," D"]'
+ to
+ x = ["A", "B", "C", "D"]
+ """
+ return ast.literal_eval(path) \ No newline at end of file