diff options
author | saksham1115 <saksham115@gmail.com> | 2016-06-20 05:47:43 +0000 |
---|---|---|
committer | saksham1115 <saksham115@gmail.com> | 2016-07-19 17:29:09 +0000 |
commit | 330f409ee91ad142a70617cf05a68916ef6c591e (patch) | |
tree | 27cf89471ed63f3f88f0cebba6d8766ae0b871eb /mediagoblin/edit/views.py | |
parent | 92497b7af6434d2358fd0ec52a6f6b2127ce0ae5 (diff) | |
download | mediagoblin-330f409ee91ad142a70617cf05a68916ef6c591e.tar.lz mediagoblin-330f409ee91ad142a70617cf05a68916ef6c591e.tar.xz mediagoblin-330f409ee91ad142a70617cf05a68916ef6c591e.zip |
Customizing Subs using Wtforms
Diffstat (limited to 'mediagoblin/edit/views.py')
-rw-r--r-- | mediagoblin/edit/views.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py index cad58306..0582b08c 100644 --- a/mediagoblin/edit/views.py +++ b/mediagoblin/edit/views.py @@ -17,7 +17,6 @@ import six from datetime import datetime -import os from itsdangerous import BadSignature from pyld import jsonld @@ -580,7 +579,6 @@ def edit_metadata(request, media): {'form':form, 'media':media}) - @require_active_login @path_subtitle def custom_subtitles(request,path=None): @@ -599,3 +597,21 @@ def custom_subtitles(request,path=None): {"path": path} ) +@require_active_login +@path_subtitle +def edit_subtitles(request,path=None): + path = path.encode('ascii','ignore')[1:-1].split(',') + for index in range(0,len(path)): + path[index] = path[index].encode('utf8') + path[index] = path[index].strip() + path[index] = path[index][2:-1] + temp = path[0] + for index in range(1,len(path)): + temp = temp + "/" + path[index] + path = "/mgoblin_media/" + temp #Bug, have to solve this + form = forms.CustomizeSubtitlesForm(request.form) + return render_to_response( + request, + "mediagoblin/edit/edit_subtitles.html", + {"path": path, + "form": form })
\ No newline at end of file |