# HG changeset patch # User ymh # Date 1307630122 -7200 # Node ID c3a1ede1ccd60f526229ee80e5d62a5be3e6fcca # Parent a9136d8f0b4ad62597a271fd272cff40002911c2# Parent 9de6715b6d84cb13a438afcb9e4447e1fc796114 Merge with 9de6715b6d84cb13a438afcb9e4447e1fc796114 diff -r a9136d8f0b4a -r c3a1ede1ccd6 web/hdabo/static/hdabo/css/style.css --- a/web/hdabo/static/hdabo/css/style.css Thu Jun 09 16:34:28 2011 +0200 +++ b/web/hdabo/static/hdabo/css/style.css Thu Jun 09 16:35:22 2011 +0200 @@ -323,4 +323,26 @@ font-size: 14px; } +.complete_sheet { + margin-left: 5px; + margin-right: 5px; +} +.left_sheet { + width: 38%; + float: left; +} +.left_sheet p { + margin-bottom: 5px; +} +.right_sheet { + width: 60%; + /*margin-left: 5px;*/ + float: right; +} +.large_25 { + width: 25px; +} +.text_centered { + text-align: center; +} diff -r a9136d8f0b4a -r c3a1ede1ccd6 web/hdabo/static/hdabo/img/arrow_right.png Binary file web/hdabo/static/hdabo/img/arrow_right.png has changed diff -r a9136d8f0b4a -r c3a1ede1ccd6 web/hdabo/static/hdabo/img/red_cross.png Binary file web/hdabo/static/hdabo/img/red_cross.png has changed diff -r a9136d8f0b4a -r c3a1ede1ccd6 web/hdabo/static/hdabo/img/tag_remove.png Binary file web/hdabo/static/hdabo/img/tag_remove.png has changed diff -r a9136d8f0b4a -r c3a1ede1ccd6 web/hdabo/static/hdabo/js/hdabo.js --- a/web/hdabo/static/hdabo/js/hdabo.js Thu Jun 09 16:34:28 2011 +0200 +++ b/web/hdabo/static/hdabo/js/hdabo.js Thu Jun 09 16:35:22 2011 +0200 @@ -1,9 +1,55 @@ -function init_tags_events() +function init_tags_events() { // Up and down management for tag table lines $(".up,.down").click(function(){ tag_up_down(this); }); + // Remove tag for a datasheet's list + $(".remove_tag_from_list").click(function(){ + if(confirm("Confirmez-vous la suppression du tag \"" + $(this).attr('alt') + "\" de la liste courante ?")){ + remove_tag_from_list(this); + } + }); +} + +function remove_tag_from_list(btn) +{ + var url = remove_tag_from_list_url; + var id_tag = $(btn).attr('id'); + $.ajax({ + url: url, + type: 'POST', + data: {csrfmiddlewaretoken:global_csrf_token, + datasheet_id:$('#datasheet_id').val(), + tag_id:id_tag + }, + // bug with jquery >= 1.5, "json" adds a callback so we don't specify dataType + //dataType: 'json', + success: function(msg, textStatus, XMLHttpRequest) { + $('#tag_table_container').html(msg); + init_tags_events(); + } + }); +} + +function remove_tag_from_list(btn) +{ + var url = remove_tag_from_list_url; + var id_tag = $(btn).attr('id'); + $.ajax({ + url: url, + type: 'POST', + data: {csrfmiddlewaretoken:global_csrf_token, + datasheet_id:$('#datasheet_id').val(), + tag_id:id_tag + }, + // bug with jquery >= 1.5, "json" adds a callback so we don't specify dataType + //dataType: 'json', + success: function(msg, textStatus, XMLHttpRequest) { + $('#tag_table_container').html(msg); + init_tags_events(); + } + }); } function tag_up_down(arrow) @@ -15,13 +61,16 @@ } var url = tag_up_down_url; var id_tag = $(arrow).attr('id'); + // This indicates the position (from 0) of the tag in the list. NB : it is different from the TagSheet.order in the database. + var pos_tag = $(arrow).attr('pos'); $.ajax({ url: url, type: 'POST', data: {csrfmiddlewaretoken:global_csrf_token, datasheet_id:$('#datasheet_id').val(), tag_id:id_tag, - move:mv + move:mv, + tag_pos:pos_tag }, // bug with jquery >= 1.5, "json" adds a callback so we don't specify dataType //dataType: 'json', diff -r a9136d8f0b4a -r c3a1ede1ccd6 web/hdabo/templates/partial/list_for_orga.html --- a/web/hdabo/templates/partial/list_for_orga.html Thu Jun 09 16:34:28 2011 +0200 +++ b/web/hdabo/templates/partial/list_for_orga.html Thu Jun 09 16:35:22 2011 +0200 @@ -7,7 +7,8 @@