Vandelay: refresh upload and inspect queue pages
authorBill Erickson <berick@esilibrary.com>
Mon, 19 Dec 2011 22:08:12 +0000 (17:08 -0500)
committerMike Rylander <mrylander@gmail.com>
Tue, 28 Feb 2012 19:51:33 +0000 (14:51 -0500)
Vandley sub-pages are currently managed as hidden divs that come into
view when the requested tab is selected.  This creates two types of
problems in the interface.  The first is that newly created data (e.g. a
new queue) is not available in the UI, because it's not getting
re-fetched from the server when the tab is opened (or added to local
data stores).  Second, certain form elements misbehave when the form is
re-rendered without a refresh.  Elements, typically checkboxes, will
appear to be selected when they are not.  (Or, perhaps they are, and the
method to detect their selection is not sufficient).  The simplest
solution to both problems is to simply reload the page....

This patch changes the tabs for Import Records and Inspect Queue so that
they reload the page (focused on the selected tab) instead of just
showing the hidden div.  These pages were chosen because they are the
only interfaces that don't automatically refresh their own data and (for
Import Record) have forms that need refreshing.

Additionally, since the user may spend more time loading Vandelay
pages, this also fixes the long-standing annoyance of seeing the
Vandelay UI partially render while waiting for the page to load.  Now,
it all remains hidden, except for a brief "Loading..." message.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/templates/vandelay/inc/toolbar.tt2
Open-ILS/src/templates/vandelay/vandelay.tt2
Open-ILS/web/js/ui/default/vandelay/vandelay.js

index cdfc6d6..61be2a6 100644 (file)
@@ -2,9 +2,9 @@
     <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy" id='vl-menu-marc-export'
         onclick="displayGlobalDiv('vl-marc-export-div');" showLabel="true">[% l('Export Records') %]</div>
     <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy"  id='vl-menu-marc-upload'
-        onclick="displayGlobalDiv('vl-marc-upload-div');" showLabel="true">[% l('Import Records') %]</div>
+        onclick="location.href = oilsBasePath + '/vandelay/vandelay';" showLabel="true">[% l('Import Records') %]</div>
     <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy"  id='vl-menu-queue-select'
-        onclick="vlShowQueueSelect();" showLabel="true">[% l('Inspect Queue') %]</div>
+        onclick="location.href = oilsBasePath + '/vandelay/vandelay?page=inspectq';" showLabel="true">[% l('Inspect Queue') %]</div>
     <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy"  id='vl-menu-attr-editor'
         onclick="vlShowAttrEditor();" showLabel="true">[% l('Record Display Attributes') %]</div>
     <div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy"  id='vl-menu-profile-editor'
index 6e7c849..cfd6d2b 100644 (file)
@@ -5,44 +5,48 @@
 <link rel='stylesheet' type='text/css' href='[% ctx.media_prefix %]/css/skin/[% ctx.skin %]/vandelay.css'/>
 <link rel='stylesheet' type='text/css' href='[% ctx.media_prefix %]/css/theme/[% ctx.skin %]/vandelay.css'/>
 
-<div dojoType="dijit.layout.ContentPane" layoutAlign='top' id="vl-nav-bar" style="visibility: hidden;">
-    [% INCLUDE 'vandelay/inc/toolbar.tt2' %]
-</div>
-<div dojoType="dijit.layout.ContentPane" layoutAlign='client'>
-    [% INCLUDE 'vandelay/inc/progress.tt2' %]
-</div>
-<div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-marc-export-div' class='hidden content'>
-    [% INCLUDE 'vandelay/inc/export.tt2' %]
-</div>
-<div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-marc-upload-div' class='hidden content'>
-    [% INCLUDE 'vandelay/inc/upload.tt2' %]
-</div>
-<div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-queue-div' class='hidden content'>
-    [% INCLUDE 'vandelay/inc/queue.tt2' %]
-</div>
-<div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-match-div' class='hidden content'>
-    [% INCLUDE 'vandelay/inc/matches.tt2' %]
-</div>
-<div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-marc-html-div' class='hidden content'>
-    [% INCLUDE 'vandelay/inc/marchtml.tt2' %]
-</div>
-<div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-queue-select-div' class='hidden content'>
-    [% INCLUDE 'vandelay/inc/queueselect.tt2' %]
-</div>
-<div dojoType="dijit.layout.ContentPane" layoutAlign="client"  id="vl-attr-editor-div" 
-        class='hidden attr-editor-detail-content-pane content' title='[% l('Record Display Attributes') %]'>
-    [% INCLUDE 'vandelay/inc/attrs.tt2' %]
-</div>
-<div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-profile-editor-div' class='hidden content'>
-    [% INCLUDE 'vandelay/inc/profiles.tt2' %]
-</div>
-<div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-match-set-editor-div' class='hidden content'>
-</div>
-<div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-item-attr-editor-div' class='hidden content'>
-    [% INCLUDE 'vandelay/inc/item_attrs.tt2' %]
-</div>
-<div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-import-error-div' class='hidden content'>
-    [% INCLUDE 'vandelay/inc/import_errors.tt2' %]
+<div id="vl-page-loading">[% l('Loading...') %]</div>
+
+<div id='vl-body-wrapper' style="visibility: hidden;">
+    <div dojoType="dijit.layout.ContentPane" layoutAlign='top' id="vl-nav-bar" style="visibility: hidden;">
+        [% INCLUDE 'vandelay/inc/toolbar.tt2' %]
+    </div>
+    <div dojoType="dijit.layout.ContentPane" layoutAlign='client'>
+        [% INCLUDE 'vandelay/inc/progress.tt2' %]
+    </div>
+    <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-marc-export-div' class='hidden content'>
+        [% INCLUDE 'vandelay/inc/export.tt2' %]
+    </div>
+    <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-marc-upload-div' class='hidden content'>
+        [% INCLUDE 'vandelay/inc/upload.tt2' %]
+    </div>
+    <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-queue-div' class='hidden content'>
+        [% INCLUDE 'vandelay/inc/queue.tt2' %]
+    </div>
+    <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-match-div' class='hidden content'>
+        [% INCLUDE 'vandelay/inc/matches.tt2' %]
+    </div>
+    <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-marc-html-div' class='hidden content'>
+        [% INCLUDE 'vandelay/inc/marchtml.tt2' %]
+    </div>
+    <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-queue-select-div' class='hidden content'>
+        [% INCLUDE 'vandelay/inc/queueselect.tt2' %]
+    </div>
+    <div dojoType="dijit.layout.ContentPane" layoutAlign="client"  id="vl-attr-editor-div" 
+            class='hidden attr-editor-detail-content-pane content' title='[% l('Record Display Attributes') %]'>
+        [% INCLUDE 'vandelay/inc/attrs.tt2' %]
+    </div>
+    <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-profile-editor-div' class='hidden content'>
+        [% INCLUDE 'vandelay/inc/profiles.tt2' %]
+    </div>
+    <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-match-set-editor-div' class='hidden content'>
+    </div>
+    <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-item-attr-editor-div' class='hidden content'>
+        [% INCLUDE 'vandelay/inc/item_attrs.tt2' %]
+    </div>
+    <div dojoType="dijit.layout.ContentPane" layoutAlign='client' id='vl-import-error-div' class='hidden content'>
+        [% INCLUDE 'vandelay/inc/import_errors.tt2' %]
+    </div>
 </div>
 
 
index 2b39612..24b2a0d 100644 (file)
@@ -337,11 +337,16 @@ function displayGlobalDiv(id) {
 }
 
 function runStartupCommands() {
+    openils.Util.hide(dojo.byId('vl-page-loading'));
+    openils.Util.show(dojo.byId('vl-body-wrapper'));
     currentQueueId = cgi.param('qid');
     currentType = cgi.param('qtype');
     dojo.style('vl-nav-bar', 'visibility', 'visible');
     if(currentQueueId)
         return retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);
+    if (cgi.param('page', 'inspectq'))
+        return displayGlobalDiv('vl-queue-select-div');
+        
     vlShowUploadForm();
 }