[open-ils-commits] r10551 - trunk/Open-ILS/web/vandelay
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Sep 5 16:39:02 EDT 2008
Author: erickson
Date: 2008-09-05 16:38:58 -0400 (Fri, 05 Sep 2008)
New Revision: 10551
Modified:
trunk/Open-ILS/web/vandelay/vandelay.html
trunk/Open-ILS/web/vandelay/vandelay.js
Log:
added upload-to-existing-queue. styling records to overlay slightly differently
Modified: trunk/Open-ILS/web/vandelay/vandelay.html
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.html 2008-09-05 19:23:58 UTC (rev 10550)
+++ trunk/Open-ILS/web/vandelay/vandelay.html 2008-09-05 20:38:58 UTC (rev 10551)
@@ -41,12 +41,16 @@
text-align:center;
margin: 20px;
}
+ .overlay_selected {
+ padding: 2px;
+ background: #d9e8f9;
+ border: 1px solid red;
+ }
</style>
- <script type="text/javascript" djConfig="parseOnLoad: true,isDebug:true" src="/js/dojo/dojo/dojo.js"></script>
+ <script type="text/javascript" djConfig="parseOnLoad: true,isDebug:false" src="/js/dojo/dojo/dojo.js"></script>
<script type="text/javascript" src='vandelay.js'></script>
</head>
<body class="tundra tall">
-
<div dojoType="dijit.Toolbar" id='toolbar'>
<div dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconCopy"
onclick='displayGlobalDiv("vl-marc-upload-div");' showLabel="true">Import Records</div>
@@ -55,10 +59,10 @@
</div>
<div id="vl-generic-progress" class='progress'>
- <div dojoType="dijit.ProgressBar" style="width:200px" indeterminate="true"></div>
+ <div dojoType="dijit.ProgressBar" style="width:300px" indeterminate="true"></div>
</div>
<div id="vl-generic-progress-with-total" class='hidden progress'>
- <div dojoType="dijit.ProgressBar" jsId='vlControlledProgressBar' style="width:200px"></div>
+ <div dojoType="dijit.ProgressBar" jsId='vlControlledProgressBar' style="width:300px"></div>
</div>
<!-- MARC upload form -->
@@ -69,23 +73,29 @@
<br/>
<table>
<tr>
- <td>Queue Name</td>
- <td>
- <input type='text' dojoType='dijit.form.TextBox' id='vl-queue-name' size='32'></input>
+ <td>Record Type</td>
+ <td colspan='4'>
+ <select id='vl-record-type' dojoType='dijit.form.FilteringSelect'
+ jsId='vlUploadRecordType' onchange='vlShowUploadForm();'>
+ <option value='bib' selected='selected'>Bibliographic Records</option>
+ <option value='auth'>Authority Records</option>
+ </select>
</td>
</tr>
<tr>
- <td>Record Type</td>
+ <td>Create a Upload New Queue</td>
<td>
- <select id='vl-record-type' dojoType='dijit.form.FilteringSelect'>
- <option value='bib'>Bibliographic Records</option>
- <option value='auth'>Authority Records</option>
+ <input type='text' dojoType='dijit.form.TextBox' id='vl-queue-name' size='32'></input>
+ </td>
+ <td>or Add to an Existing Queue</td>
+ <td>
+ <select jsId='vlUploadQueueSelector' dojoType='dijit.form.FilteringSelect'>
</select>
</td>
</tr>
<tr>
<td>Purpose</td>
- <td>
+ <td colspan='4'>
<select name='purpose' dojoType='dijit.form.FilteringSelect'>
<option value='import'>Import</option>
<option value='overlay'>Overlay</option>
@@ -97,19 +107,19 @@
<span id="vl-file-label">File to Upload:</span>
<span id="vl-file-uploading" class='hidden'>Uploading...</span>
</td>
- <td id='vl-input-td'>
+ <td id='vl-input-td' colspan='4'>
<input size='48' type="file" name="marc_upload"/>
</td>
</tr>
<tr>
- <td colspan='2'>
+ <td colspan='4'>
<span id="vl-upload-progress-span" class='hidden'>
<div dojoType="dijit.ProgressBar" style="width:200px" indeterminate="true"></div>
</span>
</td>
</tr>
<tr>
- <td colspan='2' align='center'>
+ <td align='center' colspan='4'>
<button dojoType="dijit.form.Button" onclick="batchUpload()">Upload</button>
</td>
</tr>
@@ -206,7 +216,7 @@
<tr>
<td>Queue Type</td>
<td>
- <select jsId='vlQueueSelectType' dojoType='dijit.form.FilteringSelect' onchange='alert(1);'>
+ <select jsId='vlQueueSelectType' dojoType='dijit.form.FilteringSelect' onchange='vlShowQueueSelect();'>
<option value='bib' selected='selected'>Bibliographic Records</option>
<option value='auth'>Authority Records</option>
</select>
Modified: trunk/Open-ILS/web/vandelay/vandelay.js
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.js 2008-09-05 19:23:58 UTC (rev 10550)
+++ trunk/Open-ILS/web/vandelay/vandelay.js 2008-09-05 20:38:58 UTC (rev 10551)
@@ -50,7 +50,6 @@
var authAttrsFetched = false;
var attrDefMap = {}; // maps attr def code names to attr def ids
var currentType;
-var cgi = new openils.CGI();
var currentQueueId = null;
var userCache = {};
var currentMatchedRecords; // set of loaded matched bib records
@@ -59,6 +58,7 @@
var userBibQueues;
var userAuthQueues;
var selectableGridRecords;
+var cgi = new openils.CGI();
/**
* Grab initial data
@@ -166,7 +166,7 @@
currentType = cgi.param('qtype');
if(currentQueueId)
return retrievenueuedRecords(currentType, currentQueueId, handleRetrieveRecords);
- displayGlobalDiv('vl-marc-upload-div');
+ vlShowUploadForm();
}
/**
@@ -234,6 +234,7 @@
}
function retrieveQueuedRecords(type, queueId, onload) {
+ displayGlobalDiv('vl-generic-progress');
queuedRecords = [];
queuedRecordsMap = {};
currentOverlayRecordsMap = {};
@@ -424,6 +425,7 @@
console.log("found overlay target " + matchRecId);
currentOverlayRecordsMap[currentImportRecId] = matchRecId;
dojo.byId('vl-record-list-selected-' + currentImportRecId).checked = true;
+ dojo.byId('vl-record-list-selected-' + currentImportRecId).parentNode.className = 'overlay_selected';
return;
}
}
@@ -494,7 +496,7 @@
if(!data) return '';
var domId = 'vl-record-list-selected-' +data.id;
selectableGridRecords[domId] = data.id;
- return "<input type='checkbox' id='"+domId+"'/>";
+ return "<div><input type='checkbox' id='"+domId+"'/></div>";
}
function vlSelectAllGridRecords() {
@@ -563,21 +565,34 @@
currentQueueId = queue.id();
uploadMARC(handleUploadMARC);
};
-
- createQueue(queueName, currentType, handleCreateQueue);
+
+ if(vlUploadQueueSelector.getValue() && !queueName) {
+ currentQueueId = vlUploadQueueSelector.getValue();
+ console.log('adding records to existing queue ' + currentQueueId);
+ uploadMARC(handleUploadMARC);
+ } else {
+ createQueue(queueName, currentType, handleCreateQueue);
+ }
}
function vlFleshQueueSelect(selector, type) {
var data = (type == 'bib') ? vbq.toStoreData(userBibQueues) : vaq.toStoreData(userAuthQueues);
selector.store = new dojo.data.ItemFileReadStore({data:data});
+ selector.setValue(null);
+ selector.setDisplayedValue('');
if(data[0])
selector.setValue(data[0].id());
}
+function vlShowUploadForm() {
+ displayGlobalDiv('vl-marc-upload-div');
+ vlFleshQueueSelect(vlUploadQueueSelector, vlUploadRecordType.getValue());
+}
+
function vlShowQueueSelect() {
displayGlobalDiv('vl-queue-select-div');
- vlFleshQueueSelect(vlQueueSelectQueueList, 'bib');
+ vlFleshQueueSelect(vlQueueSelectQueueList, vlQueueSelectType.getValue());
}
function vlFetchQueueFromForm() {
@@ -585,6 +600,5 @@
currentQueueId = vlQueueSelectQueueList.getValue();
retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);
}
-
dojo.addOnLoad(vlInit);
More information about the open-ils-commits
mailing list