[open-ils-commits] r220 - in servres/trunk/conifer: static templates templates/components (gfawcett)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Mar 25 20:26:03 EDT 2009
Author: gfawcett
Date: 2009-03-25 20:26:02 -0400 (Wed, 25 Mar 2009)
New Revision: 220
Modified:
servres/trunk/conifer/static/main.css
servres/trunk/conifer/static/menublocks.js
servres/trunk/conifer/templates/components/course.xhtml
servres/trunk/conifer/templates/course_detail.xhtml
servres/trunk/conifer/templates/item_heading_detail.xhtml
Log:
improved visual appearance of Resequence Items interface.
Modified: servres/trunk/conifer/static/main.css
===================================================================
--- servres/trunk/conifer/static/main.css 2009-03-26 00:25:59 UTC (rev 219)
+++ servres/trunk/conifer/static/main.css 2009-03-26 00:26:02 UTC (rev 220)
@@ -225,3 +225,7 @@
.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
Modified: servres/trunk/conifer/static/menublocks.js
===================================================================
--- servres/trunk/conifer/static/menublocks.js 2009-03-26 00:25:59 UTC (rev 219)
+++ servres/trunk/conifer/static/menublocks.js 2009-03-26 00:26:02 UTC (rev 220)
@@ -13,8 +13,10 @@
}
function openblock(bid) {
- $('span.menublock').hide();
- $('#' + bid).fadeIn('fast');
+ if (!resequencing) {
+ $('span.menublock').hide();
+ $('#' + bid).fadeIn('fast');
+ }
}
$(init_blocks);
@@ -23,29 +25,29 @@
// 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());
});
}
Modified: servres/trunk/conifer/templates/components/course.xhtml
===================================================================
--- servres/trunk/conifer/templates/components/course.xhtml 2009-03-26 00:25:59 UTC (rev 219)
+++ servres/trunk/conifer/templates/components/course.xhtml 2009-03-26 00:26:02 UTC (rev 220)
@@ -96,16 +96,16 @@
</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>
Modified: servres/trunk/conifer/templates/course_detail.xhtml
===================================================================
--- servres/trunk/conifer/templates/course_detail.xhtml 2009-03-26 00:25:59 UTC (rev 219)
+++ servres/trunk/conifer/templates/course_detail.xhtml 2009-03-26 00:26:02 UTC (rev 220)
@@ -20,7 +20,7 @@
<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>
Modified: servres/trunk/conifer/templates/item_heading_detail.xhtml
===================================================================
--- servres/trunk/conifer/templates/item_heading_detail.xhtml 2009-03-26 00:25:59 UTC (rev 219)
+++ servres/trunk/conifer/templates/item_heading_detail.xhtml 2009-03-26 00:26:02 UTC (rev 220)
@@ -20,7 +20,7 @@
<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>
More information about the open-ils-commits
mailing list