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");
<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 %]