improved visual appearance of Resequence Items interface.
authorgfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Thu, 26 Mar 2009 00:26:02 +0000 (00:26 +0000)
committergfawcett <gfawcett@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Thu, 26 Mar 2009 00:26:02 +0000 (00:26 +0000)
git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@220 6d9bc8c9-1ec2-4278-b937-99fde70a366f

conifer/static/main.css
conifer/static/menublocks.js
conifer/templates/components/course.xhtml
conifer/templates/course_detail.xhtml
conifer/templates/item_heading_detail.xhtml

index fa79dbd..537aead 100644 (file)
@@ -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
index 2d97d56..be0cf35 100644 (file)
@@ -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());
                   });
     }
index b403f93..f8bb99e 100644 (file)
@@ -96,16 +96,16 @@ searchtext = _('search this course...')
       </div>
    </div>
 
-   <div py:def="item_reorder_panel()" py:strip="True">
-    <div id="reorder_panel" class="little_action_panel">
-      <a href="javascript:doReorder();">Reorder items</a>
+   <div py:def="item_resequence_panel()" py:strip="True">
+    <div id="resequence_panel" class="little_action_panel">
+      <a href="javascript:doResequence();">Resequence items</a>
     </div>
     <div style="display: none;">
-      <span id="i18n-save-order">Save Ordering</span>
-      <span id="i18n-reorder-items">Reorder Items</span>
-      <span id="i18n-new-order-saved">The new ordering has been saved.</span>
+      <span id="i18n-save-order">Save Sequence</span>
+      <span id="i18n-resequence-items">Resequence Items</span>
+      <span id="i18n-new-order-saved">The new sequence has been saved.</span>
       <div id="ropanelmessage" style="clear: right; width: 10em;"
-          class="little_action_panel">Drag the items around. Then click Save Ordering, above.</div>
+          class="little_action_panel">Drag the items around. Then click Save Sequence, above.</div>
     </div>
     </div>
 
index 081ed5b..8c99bb9 100644 (file)
@@ -20,7 +20,7 @@ is_editor = course.can_edit(request.user)
     <div py:if="instructs(request.user, course)" id="edit_course" class="little_action_panel">
       <a href="${course.course_url()}edit/">Edit course details</a>
     </div>
-    ${item_reorder_panel()}
+    ${item_resequence_panel()}
     ${show_tree(item_tree, edit=is_editor)}
     <div py:if="is_editor">${add_subs()}</div>
 
index e90bf26..7c4c35d 100644 (file)
@@ -20,7 +20,7 @@ item_tree = course.item_tree(subtree=item)
     <p py:if="not item_tree">
       There are no items in this section.
     </p>
-    ${item_reorder_panel()}
+    ${item_resequence_panel()}
     ${show_tree(item_tree, edit=is_editor)}
     <div py:if="is_editor">${add_subs(item)}</div>
   </body>