webstaff: move some "mark for" buttons to record summary
authorGalen Charlton <gmc@esilibrary.com>
Thu, 1 Oct 2015 20:31:08 +0000 (20:31 +0000)
committerKathy Lussier <klussier@masslnc.org>
Tue, 2 Feb 2016 19:58:48 +0000 (14:58 -0500)
This patch moves the "Mark for..." overlay, volume transfer,
and conjoined items buttons from the MARC editor to
the record summary (next to the "Add To Bucket" button).

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2
Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2
Open-ILS/src/templates/staff/css/cat.css.tt2
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js

index 8437ee8..05b25cd 100644 (file)
     <button type="button" class="btn btn-default" ng-click="add_to_record_bucket()">
         [% l('Add To Bucket') %]
     </button>
+    <div class="btn-group" dropdown dropdown-append-to-body>
+        <button id="mark-for-button" type="button" class="btn btn-default" dropdown-toggle>
+            [% l('Mark for:') %] <span class="caret"></span>
+        </button>
+        <ul class="dropdown-menu" role="menu" aria-labelledby="mark-for-button">
+            <li role="menuitem">
+                <a ng-click="markOverlay()">
+                    [% l('Overlay Target') %]
+                    <span class="target-record-aside" ng-if="current_overlay_target">[% l('(Currently [_1])', '{{current_overlay_target}}') %]</span>
+                </a>
+            </li>
+            <li role="menuitem">
+                <a ng-click="markVolTransfer()">
+                    [% l('Volume Transfer') %]
+                    <span class="target-record-aside" ng-if="current_voltransfer_target">[% l('(Currently [_1])', '{{current_voltransfer_target}}') %]</span>
+                </a>
+            </li>
+            <li role="menuitem">
+                    <a ng-click="markConjoined()">
+                        [% l('Conjoined Items') %]
+                    <span class="target-record-aside" ng-if="current_conjoined_target">[% l('(Currently [_1])', '{{current_conjoined_target}}') %]</span>
+                </a>
+            </li>
+            <li role="menuitem">
+                <a ng-click="clearRecordMarks()">[% l('Reset Record Marks') %]</a>
+            </li>
+        </ul>
+    </div>
   </div>
 </div>
 
index 5ee22e4..f415950 100644 (file)
@@ -1,19 +1,5 @@
 <div>
   <div ng-show="bre" class="row pad-vert marcfastitemadd" ng-hide="brandNewRecord">
-    <div class="col-md-5">
-      <label>[% l('Mark for:') %]</label>
-      <div class="btn-group">
-        <span class="btn-group">
-          <button class="btn btn-default" ng-click="markOverlay()">[% l('Overlay Target') %]</button>
-        </span>
-        <span class="btn-group">
-          <button class="btn btn-default" ng-click="markVolTransfer()">[% l('Volume Transfer') %]</button>
-        </span>
-        <span class="btn-group">
-          <button class="btn btn-default" ng-click="markConjoined()">[% l('Conjoined Items') %]</button>
-        </span>
-      </div>
-    </div>
     <div class="col-md-2">
       <label><input type="checkbox" ng-model="enable_fast_add"/> [% l('Add Item') %]</label>
     </div>
index ede0007..4faae17 100644 (file)
@@ -3,6 +3,11 @@
     color: red;
 }
 
+.target-record-aside {
+    font-size: 80%;
+    font-style: italic;
+}
+
 .marcrecord {
     //background-color: #f5f5f5;
 }
index 4b2bf9d..ce8acac 100644 (file)
@@ -311,6 +311,34 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
         });
     }
 
+    $scope.current_overlay_target     = egCore.hatch.getLocalItem('eg.cat.marked_overlay_record');
+    $scope.current_voltransfer_target = egCore.hatch.getLocalItem('eg.cat.marked_volume_transfer_record');
+    $scope.current_conjoined_target   = egCore.hatch.getLocalItem('eg.cat.marked_conjoined_record');
+
+    $scope.markConjoined = function () {
+        $scope.current_conjoined_target = $scope.record_id;
+        egCore.hatch.setLocalItem('eg.cat.marked_conjoined_record',$scope.record_id);
+    };
+
+    $scope.markVolTransfer = function () {
+        $scope.current_voltransfer_target = $scope.record_id;
+        egCore.hatch.setLocalItem('eg.cat.marked_volume_transfer_record',$scope.record_id);
+    };
+
+    $scope.markOverlay = function () {
+        $scope.current_overlay_target = $scope.record_id;
+        egCore.hatch.setLocalItem('eg.cat.marked_overlay_record',$scope.record_id);
+    };
+
+    $scope.clearRecordMarks = function () {
+        $scope.current_overlay_target     = null;
+        $scope.current_voltransfer_target = null;
+        $scope.current_conjoined_target   = null;
+        egCore.hatch.removeLocalItem('eg.cat.marked_volume_transfer_record');
+        egCore.hatch.removeLocalItem('eg.cat.marked_conjoined_record');
+        egCore.hatch.removeLocalItem('eg.cat.marked_overlay_record');
+    }
+
     $scope.stop_unload = false;
     $scope.$watch('stop_unload',
         function(newVal, oldVal) {
index 3ec54d6..cb978f3 100644 (file)
@@ -1265,18 +1265,6 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap'])
                     alert($scope.record.toBreaker());
                 };
 
-                $scope.markConjoined = function () {
-                    egCore.hatch.setLocalItem('eg.cat.marked_conjoined_record',$scope.recordId);
-                };
-
-                $scope.markVolTransfer = function () {
-                    egCore.hatch.setLocalItem('eg.cat.marked_volume_transfer_record',$scope.recordId);
-                };
-
-                $scope.markOverlay = function () {
-                    egCore.hatch.setLocalItem('eg.cat.marked_overlay_record',$scope.recordId);
-                };
-
                 $scope.$watch('recordId',
                     function(newVal, oldVal) {
                         if (newVal && newVal !== oldVal) {