Vandelay file upload page cleanup
authorberick <berick@esilibrary.com>
Mon, 2 May 2011 16:52:30 +0000 (12:52 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 6 Jul 2011 18:50:51 +0000 (14:50 -0400)
 * Separate data configuration parameters from import actions
 * Since import item profile is linked to queue, show the profile for
    the selected queue and dissallow changing the profile for existing
    queues in the UI (which has no effect)

Open-ILS/web/css/skin/default/vandelay.css
Open-ILS/web/js/ui/default/vandelay/vandelay.js
Open-ILS/web/templates/default/vandelay/inc/upload.tt2

index 1f0303a..b1987f8 100644 (file)
@@ -47,3 +47,4 @@ table.dijitTooltipTable { border-collapse: separate; }
 .queue-nav-table-label { font-weight: bold; text-decoration:underline;}
 .queue-pager-span { padding-right: 5px; margin-right: 5px; border-right: 2px solid #e8e1cf; }
 #vl-queue-paging-table td { padding-bottom: 0px; }
+#vl-file-label { margin-right: 10px; }
index b6022c2..fa97b8c 100644 (file)
@@ -1073,6 +1073,38 @@ function vlFleshQueueSelect(selector, type) {
     selector.setDisplayedValue('');
     if(data[0])
         selector.setValue(data[0].id());
+
+    var qInput = dijit.byId('vl-queue-name');
+
+    var selChange = function(val) {
+        console.log('selector onchange');
+        // user selected a queue from the selector;  clear the input and 
+        // set the item import profile already defined for the queue
+        var queue = allUserBibQueues.filter(function(q) { return (q.id() == val) })[0];
+        if(val) {
+            vlUploadQueueHoldingsImportProfile.attr('value', queue.item_attr_def() || '');
+            vlUploadQueueHoldingsImportProfile.attr('disabled', true);
+        } else {
+            vlUploadQueueHoldingsImportProfile.attr('value', '');
+            vlUploadQueueHoldingsImportProfile.attr('disabled', false);
+        }
+        dojo.disconnect(qInput._onchange);
+        qInput.attr('value', '');
+        qInput._onchange = dojo.connect(qInput, 'onChange', inputChange);
+    }
+    
+    var inputChange = function(val) {
+        console.log('qinput onchange');
+        // user entered a new queue name. clear the selector 
+        vlUploadQueueHoldingsImportProfile.attr('value', '');
+        vlUploadQueueHoldingsImportProfile.attr('disabled', false);
+        dojo.disconnect(selector._onchange);
+        selector.attr('value', '');
+        selector._onchange = dojo.connect(selector, 'onChange', selChange);
+    }
+
+    selector._onchange = dojo.connect(selector, 'onChange', selChange);
+    qInput._onchange = dojo.connect(qInput, 'onChange', inputChange);
 }
 
 function vlShowUploadForm() {
index aca6320..8356075 100644 (file)
             </td>
         </tr>
         <tr>
-            <td>&vandelay.auto.import.noncolliding;</td>
-            <td colspan='4'>
-                <input jsId='vlUploadQueueAutoImport' dojoType='dijit.form.CheckBox'/>
+            <td>Holdings Import Profile</td>
+            <td>
+                <input jsId='vlUploadQueueHoldingsImportProfile'
+                    dojoType='dijit.form.FilteringSelect' labelAttr='name' searchAttr='name'/>
             </td>
         </tr>
         <tr>
-            <td>&vandelay.auto.import.auto_overlay_exact;</td>
-            <td colspan='4'>
-                <input jsId='vlUploadQueueAutoOverlayExact' dojoType='dijit.form.CheckBox'/>
+            <td>&vandelay.import.bib_sources;</td>
+            <td>
+                <select name='bib_source' jsId='vlUploadSourceSelector' 
+                    dojoType='dijit.form.FilteringSelect' labelAttr='source' searchAttr='source'/>
             </td>
         </tr>
+        <tr><td colspan='2' style='margin-top:10px;border-bottom:1px solid #888;border-top:1px solid #888'><b>Import Actions</b></td></tr>
         <tr>
-            <td>&vandelay.auto.import.auto_overlay_1match;</td>
+            <td>&vandelay.auto.import.merge_profile;</td>
             <td colspan='4'>
-                <input jsId='vlUploadQueueAutoOverlay1Match' dojoType='dijit.form.CheckBox'/>
+                <div jsId='vlUploadMergeProfile' dojoType='dijit.form.FilteringSelect' required='false' labelAttr='name' searchAttr='name'/>
             </td>
         </tr>
         <tr>
-            <td>&vandelay.auto.import.merge_profile;</td>
+            <td>&vandelay.auto.import.noncolliding;</td>
             <td colspan='4'>
-                <div jsId='vlUploadMergeProfile' dojoType='dijit.form.FilteringSelect' required='false' labelAttr='name' searchAttr='name'/>
+                <input jsId='vlUploadQueueAutoImport' dojoType='dijit.form.CheckBox'/>
             </td>
         </tr>
         <tr>
-            <td>Holdings Import Profile</td>
-            <td>
-                <input jsId='vlUploadQueueHoldingsImportProfile'
-                    dojoType='dijit.form.FilteringSelect' labelAttr='name' searchAttr='name'/>
+            <td>&vandelay.auto.import.auto_overlay_exact;</td>
+            <td colspan='4'>
+                <input jsId='vlUploadQueueAutoOverlayExact' dojoType='dijit.form.CheckBox'/>
             </td>
         </tr>
         <tr>
-            <td>&vandelay.import.bib_sources;</td>
-            <td>
-                <select name='bib_source' jsId='vlUploadSourceSelector' 
-                    dojoType='dijit.form.FilteringSelect' labelAttr='source' searchAttr='source'/>
+            <td>&vandelay.auto.import.auto_overlay_1match;</td>
+            <td colspan='4'>
+                <input jsId='vlUploadQueueAutoOverlay1Match' dojoType='dijit.form.CheckBox'/>
             </td>
         </tr>
+        <tr><td colspan='2' style='border-bottom:1px solid #888'></td></tr>
         <tr>
-            <td>
+            <td colspan='5'>
                 <span id="vl-file-label">&vandelay.file.to.upload;</span>
-            </td>
-            <td id='vl-input-td' colspan='4'>
                 <input size='48' type="file" name="marc_upload"/>
-            </td>
-        </tr>
-        <tr>
-            <td align='center' colspan='4'>
-                <button dojoType="dijit.form.Button" onclick="batchUpload()">&vandelay.upload;</button>
+                <span style='margin-left:10px;'><button dojoType="dijit.form.Button" onclick="batchUpload()">&vandelay.upload;</button></span>
             </td>
         </tr>
     </table>