Add explicit identification of the master authority record when merging
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 26 Aug 2010 03:07:39 +0000 (03:07 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 26 Aug 2010 03:07:39 +0000 (03:07 +0000)
We now generate a table with the first cell containing either "Master"
(indicating the record into which the other records will be merged) and
or "Target" (indicating that the record will be merged into the master.

This also adds a horizontal rule to delineate between the form buttons
at the top, and adds borders to provide more clarity between the mergebox
contents.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@17343 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/cat/authority/list.js
Open-ILS/web/templates/default/cat/authority/list.tt2

index 37dc478..dc55a1f 100644 (file)
@@ -71,7 +71,16 @@ function displayAuthorities(data) {
             dojo.query('#auth' + recId + ' span.text').forEach(function(node) {
                 authText += dojox.xml.parser.textContent(node); 
             });
-            dojo.place('<div class="toMerge" id="toMerge_' + recId + '">' +  authText + '</div>', 'mergebox-div', 'last');
+
+            // If there is a toMerge item already, this is a target record
+            var mergeRole = '<td style="border: 1px solid black; padding-left: 0.5em; padding-right: 1em;">';
+            var isTarget = dojo.query('.toMerge').length;
+            if (isTarget) {
+                mergeRole += 'Target</td>';
+            } else {
+                mergeRole += 'Master</td>';
+            }
+            dojo.place('<tr class="toMerge" id="toMerge_' + recId + '">' + mergeRole + '<td style="border: 1px solid black; padding-left: 1em;">' + authText + '</td></tr>', 'mergebox-tbody', 'last');
             dojo.removeClass('mergebox-div', 'hidden');
         }, "label":"Mark for Merge"}).placeAt(auth_menu, "last");
 
index 3f6c784..67a1fa7 100644 (file)
@@ -3,23 +3,6 @@
 
 <script type="text/javascript" src='[% ctx.media_prefix %]/js/ui/default/cat/authority/list.js'> </script>
 
-<div id='mergebox-div' class='hidden' style='float:right; border: 4px solid; width: 25%;'>
-    <div style="border-bottom: 4px solid; text-align: center;">
-        <div dojoType="dijit.form.Form" encType="multipart/form-data" action="" method="">
-            <div dojoType="dijit.form.Button" type="button" value="Merge">Merge
-                <script type="dojo/method" event="onClick" args="evt">
-                    mergeRecords();
-                </script>
-            </div>
-            <div dojoType="dijit.form.Button" type="button" value="Clear">Clear
-                <script type="dojo/method" event="onClick" args="evt">
-                    clearMergeRecords();
-                </script>
-            </div>
-        </div>
-    </div>
-</div>
-
 <div dojoType="dijit.form.Form" id="myForm" jsId="myForm" encType="multipart/form-data" action="" method="">
     <span style="white-space: nowrap;">
         <label for="authTerm">Search term: </label>
     </span>
 </div>
 
+<hr />
+
+<div id='mergebox-div' class='hidden' style='float:right; border: 4px solid; width: 25%;'>
+    <div style="border-bottom: 4px solid; text-align: center;">
+        <div dojoType="dijit.form.Form" encType="multipart/form-data" action="" method="">
+            <div dojoType="dijit.form.Button" type="button" value="Merge">Merge
+                <script type="dojo/method" event="onClick" args="evt">
+                    mergeRecords();
+                </script>
+            </div>
+            <div dojoType="dijit.form.Button" type="button" value="Clear">Clear
+                <script type="dojo/method" event="onClick" args="evt">
+                    clearMergeRecords();
+                </script>
+            </div>
+        </div>
+    </div>
+    <table>
+        <tbody id='mergebox-tbody'>
+        </tbody>
+    </table>
+</div>
+
+
 <div id='authlist-div'></div>
 
 [% END %]