webstaff: Allow Record Summary to collapse (and remember the choice)
authorMike Rylander <mrylander@gmail.com>
Thu, 5 Mar 2015 20:16:45 +0000 (15:16 -0500)
committerJason Stephenson <jstephenson@mvlc.org>
Wed, 19 Aug 2015 17:39:12 +0000 (13:39 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/src/templates/staff/cat/share/t_record_summary.tt2
Open-ILS/web/js/ui/default/staff/cat/services/record.js

index 4424b29..7ce48d2 100644 (file)
@@ -1,6 +1,54 @@
-<div class="strong-text-2">[% l('Record Summary') %]</div>
+<div class="strong-text-2 container">
+  <div class="row">
+    <div class="col-md-2">[% l('Record Summary') %]</div>
+    <div class="col-md-1">
+      <a target="_self" 
+        href="[% ctx.base_path %]/staff/cat/catalog/record/{{record.id()}}/marc_html">
+        (MARC)
+      </a>
+    </div>
+    <div class="col-md-8">
+      <!-- padding -->
+    </div>
+    <div class="col-md-1">
+      <a href ng-click="toggle_expand_summary()"
+        title="[% l('Collapse Record Summary Display') %]"
+        ng-hide="collapse_summary()">
+        <span class="glyphicon glyphicon-resize-small"></span>
+      </a>
+      <a href ng-click="toggle_expand_summary()"
+        title="[% l('Expand Record Summary Display') %]"
+        ng-show="collapse_summary()">
+        <span class="glyphicon glyphicon-resize-full"></span>
+      </a>
+    </div>
+  </div>
+</div>
+
+<div class="flex-container-striped flex-container-bordered" ng-show="collapse_summary()">
+  <div class="flex-row">
+    <div class="flex-cell strong-text">[% l('Title:') %]</div>
+    <div class="flex-cell flex-2">
+      <a target="_self" 
+        href="[% ctx.base_path %]/staff/cat/catalog/record/{{record.id()}}">
+        {{record.simple_record().title()}}
+      </a>
+    </div>
+
+    <div class="flex-cell strong-text">[% l('Author:') %]</div>
+    <div class="flex-cell flex-2">{{record.simple_record().author()}}</div>
+
+    <div class="flex-cell strong-text">[% l('Pub Date:') %]</div>
+    <div class="flex-cell">
+      {{record.simple_record().pubdate()}}
+    </div>
+
+    <div class="flex-cell strong-text">[% l('Database ID:') %]</div>
+    <div class="flex-cell">{{record.id()}}</div>
+  </div><!-- flex-row -->
+</div>
 
-<div class="flex-container-striped flex-container-bordered">
+<div class="flex-container-striped flex-container-bordered" ng-hide="collapse_summary()">
   <div class="flex-row">
     <div class="flex-cell strong-text">[% l('Title:') %]</div>
     <div class="flex-cell flex-2">
index 6975b27..19e86ad 100644 (file)
@@ -100,6 +100,24 @@ angular.module('egCoreMod')
 
                 if ($scope.recordId) 
                     loadRecord();
+
+                $scope.toggle_expand_summary = function() {
+                    if ($scope.collapseRecordSummary) {
+                        $scope.collapseRecordSummary = false;
+                        egCore.hatch.removeItem('eg.cat.record.summary.collapse');
+                    } else {
+                        $scope.collapseRecordSummary = true;
+                        egCore.hatch.setItem('eg.cat.record.summary.collapse', true);
+                    }
+                }
+            
+                $scope.collapse_summary = function() {
+                    return $scope.collapseRecordSummary;
+                }
+            
+                egCore.hatch.getItem('eg.cat.record.summary.collapse')
+                .then(function(val) {$scope.collapseRecordSummary = Boolean(val)});
+
             }
         ]
     }