From: balastegui Date: Wed, 11 May 2016 13:36:31 +0000 (+0200) Subject: update X-Git-Tag: 1.6.2^2~28^2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=0874cb068a11d45520c44c52077923055c32b4cd;p=telemeta.git update --- diff --git a/telemeta/static/telemeta/js/playlist.js b/telemeta/static/telemeta/js/playlist.js index b07bdcbe..e6c7860d 100644 --- a/telemeta/static/telemeta/js/playlist.js +++ b/telemeta/static/telemeta/js/playlist.js @@ -158,6 +158,16 @@ var playlistUtils = { }).show(); }, + /*convert language*/ + updateConvert: function(id, t, d) { + playlist = this; + playlist.update({ + 'public_id': id, + 'title': t, + 'description': d, + }); + }, + /*shows the popup for adding a resource to a playlist*/ showAddResourceToPlaylist: function(anchorElement, resourceType, objectId, optionalOkMessage){ var ar = []; diff --git a/telemeta/templates/telemeta/lists.html b/telemeta/templates/telemeta/lists.html index 73847d81..c80f6058 100644 --- a/telemeta/templates/telemeta/lists.html +++ b/telemeta/templates/telemeta/lists.html @@ -31,6 +31,24 @@ }); } + var ID = ""; // ID var: used to edit playlist + + // function to change global var ID (used when edit button is pressed) + function editVar(id) { + ID = id; + } + + function editPlaylist() { + var title = document.getElementById('titleEdit').value; + var description = document.getElementById('descriptionEdit').value; + var p = playlistUtils; + + // Use of a function that convert params then use playlist.update + p.updateConvert(ID, title, description); + + ID = ""; // init ID + } + {% for playlist in playlists %} playlistUtils.addEditPlaylist('{{playlist.playlist.public_id}}','{{ playlist.playlist.title }}','{{playlist.playlist.description}}'); {% endfor %} @@ -74,7 +92,7 @@ -{% endblock %} + + + {% endblock %} +
@@ -124,6 +166,8 @@ +

+
{% for playlist in playlists %} @@ -134,7 +178,7 @@ {{ playlist.playlist.title }} - {% trans "Edit" %} + {% trans "Edit" %} CSV Collections CSV Items {% trans "Delete" %} @@ -193,7 +237,9 @@ {% if resource.element.file or resource.element.has_mediafile %} -

d

+ +

d

+ {% endif %} @@ -208,4 +254,3 @@
{% endblock %} -