From 9860325e92841f812fd86c75478548070625331a Mon Sep 17 00:00:00 2001 From: afilsaime Date: Fri, 5 Jun 2015 12:33:27 +0200 Subject: [PATCH] add return to search result option on playlist adding --- telemeta/templates/search/addplaylist.html | 46 +++++++++++-------- telemeta/templates/search/advanceSearch.html | 1 + .../search/confirmation_add_playslist.html | 19 ++++++-- telemeta/templates/search/search.html | 1 + telemeta/views/new_playlist.py | 6 ++- 5 files changed, 49 insertions(+), 24 deletions(-) diff --git a/telemeta/templates/search/addplaylist.html b/telemeta/templates/search/addplaylist.html index e217921a..bb8e6399 100644 --- a/telemeta/templates/search/addplaylist.html +++ b/telemeta/templates/search/addplaylist.html @@ -55,30 +55,38 @@ {% endblock %} {% block content %}
{% csrf_token %} - - - - +
+
+
{% trans "Title"%}
+ + - - - {% for item in selected_items_list %} - + + + {% for item in selected_items_list %} + - - - {% endfor %} - -
{% trans "Selected items : "%}
- {{item.title}}
+ + {{item.title}} + + {% endfor %} + + + +
+ + +
+ {% for item in selected_items_list %} {% endfor %} - + + or return to search results
{% endblock %} {% block extra_javascript %} diff --git a/telemeta/templates/search/advanceSearch.html b/telemeta/templates/search/advanceSearch.html index 22173f2d..375c99dc 100644 --- a/telemeta/templates/search/advanceSearch.html +++ b/telemeta/templates/search/advanceSearch.html @@ -209,6 +209,7 @@ {% endif %} {% endwith %} {% if user.is_authenticated %} + {% endif %} diff --git a/telemeta/templates/search/confirmation_add_playslist.html b/telemeta/templates/search/confirmation_add_playslist.html index ac3e530b..635f4350 100644 --- a/telemeta/templates/search/confirmation_add_playslist.html +++ b/telemeta/templates/search/confirmation_add_playslist.html @@ -6,7 +6,20 @@ {% trans "Playlist Confirmation" %} {% endblock %} {% block content %} - {{existing_playlists}} - {{user.username}} -

Added to PlayList

+ + + + + + + {% for item in selected_items_list %} + + + + + {% endfor %} + +
{% trans "Added to playlist : "%}
+ {{item.title}}

+ return to search results {% endblock %} \ No newline at end of file diff --git a/telemeta/templates/search/search.html b/telemeta/templates/search/search.html index 433c11c0..a8bc5f3d 100644 --- a/telemeta/templates/search/search.html +++ b/telemeta/templates/search/search.html @@ -55,6 +55,7 @@ {% endif %} {% endwith %} {% if user.is_authenticated %} + {% endif %} diff --git a/telemeta/views/new_playlist.py b/telemeta/views/new_playlist.py index 6d97946e..cb27a12b 100644 --- a/telemeta/views/new_playlist.py +++ b/telemeta/views/new_playlist.py @@ -14,7 +14,8 @@ class NewPlaylistView(object): itemlist.append(MediaItem.objects.all().get(id=itemid)) context = RequestContext(request, { 'selected_items_list': itemlist, - 'existing_playlists': Playlist.objects.all().filter(author=request.user)}) + 'existing_playlists': Playlist.objects.all().filter(author=request.user), + 'lastquerypath':request.POST.get('lastquerypath')}) return HttpResponse(template_name.render(context)) def addToPlaylist(self, request): @@ -32,7 +33,8 @@ class NewPlaylistView(object): resource = PlaylistResource.objects.get_or_create(resource_type='item',public_id='4567891542',resource_id=item.id,playlist=selected_playlist) context = RequestContext(request, { - 'existing_playlists': request.user.username}) + 'selected_items_list': itemlist, + 'lastquerypath': request.POST.get('lastquerypath')}) return HttpResponse(template_name.render(context)) -- 2.39.5