From: gfawcett Date: Thu, 26 Mar 2009 00:26:02 +0000 (+0000) Subject: improved visual appearance of Resequence Items interface. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=411c57396945632a780c27c9b6d0162138d98697;p=syrup%2Fmasslnc.git improved visual appearance of Resequence Items interface. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@220 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/conifer/static/main.css b/conifer/static/main.css index fa79dbd..537aead 100644 --- a/conifer/static/main.css +++ b/conifer/static/main.css @@ -225,3 +225,7 @@ p.todo, div.todo { background-color: #fdd; padding: 6; margin: 12; border-left: .specific { padding: 8; margin: 0 16; background-color: #eef; } +li.sort_item { margin-top: 20px !important; + border: gray 1px dotted; width: 400; } + +li.sort_item:hover { background-color: #eee; } \ No newline at end of file diff --git a/conifer/static/menublocks.js b/conifer/static/menublocks.js index 2d97d56..be0cf35 100644 --- a/conifer/static/menublocks.js +++ b/conifer/static/menublocks.js @@ -13,8 +13,10 @@ function make_opener() { } function openblock(bid) { - $('span.menublock').hide(); - $('#' + bid).fadeIn('fast'); + if (!resequencing) { + $('span.menublock').hide(); + $('#' + bid).fadeIn('fast'); + } } $(init_blocks); @@ -23,29 +25,29 @@ $(init_blocks); // fixme, I need to rename menublocks.js to something more like // 'course-item-stuff.js'. -// this is some item reordering code. +// this is some item resequencing code. -var reordering = false; +var resequencing = false; -function doReorder() { - if (!reordering) { - $('.itemtree').sortable({axis:'y'}); - $('.an_item').css({ marginTop: '20px' }); - $('#reorder_panel').after($('#ropanelmessage')); - $('#reorder_panel a').text($('#i18n-save-order').text()); - reordering = true; +function doResequence() { + if (!resequencing) { + $('.itemtree:nth(0)').sortable({axis:'y'}); + $('.itemtree:nth(0) > .an_item').addClass('sort_item'); + $('#resequence_panel').after($('#ropanelmessage')); + $('#resequence_panel a').text($('#i18n-save-order').text()); + resequencing = true; } else { - $('.an_item').css({ marginTop: '4px' }); + $('.an_item').removeClass('sort_item'); $('#ropanelmessage').remove(); - $('#reorder_panel a').text('...'); + $('#resequence_panel a').text('...'); $('.itemtree').sortable('destroy'); - reordering = false; + resequencing = false; // get the LI item ids. Send them to the server. var new_sequence = $('.an_item').map(function() { return $(this).attr('id') }); var new_seq_string = Array.join(new_sequence, ','); $.post('reseq', {'new_order':new_seq_string}, function() { - $('#reorder_panel a').text($('#i18n-reorder-items').text()); + $('#resequence_panel a').text($('#i18n-resequence-items').text()); alert($('#i18n-new-order-saved').text()); }); } diff --git a/conifer/templates/components/course.xhtml b/conifer/templates/components/course.xhtml index b403f93..f8bb99e 100644 --- a/conifer/templates/components/course.xhtml +++ b/conifer/templates/components/course.xhtml @@ -96,16 +96,16 @@ searchtext = _('search this course...') -
-
- Reorder items +
+
- Save Ordering - Reorder Items - The new ordering has been saved. + Save Sequence + Resequence Items + The new sequence has been saved.
Drag the items around. Then click Save Ordering, above.
+ class="little_action_panel">Drag the items around. Then click Save Sequence, above.
diff --git a/conifer/templates/course_detail.xhtml b/conifer/templates/course_detail.xhtml index 081ed5b..8c99bb9 100644 --- a/conifer/templates/course_detail.xhtml +++ b/conifer/templates/course_detail.xhtml @@ -20,7 +20,7 @@ is_editor = course.can_edit(request.user) - ${item_reorder_panel()} + ${item_resequence_panel()} ${show_tree(item_tree, edit=is_editor)}
${add_subs()}
diff --git a/conifer/templates/item_heading_detail.xhtml b/conifer/templates/item_heading_detail.xhtml index e90bf26..7c4c35d 100644 --- a/conifer/templates/item_heading_detail.xhtml +++ b/conifer/templates/item_heading_detail.xhtml @@ -20,7 +20,7 @@ item_tree = course.item_tree(subtree=item)

There are no items in this section.

- ${item_reorder_panel()} + ${item_resequence_panel()} ${show_tree(item_tree, edit=is_editor)}
${add_subs(item)}