support patron summary display collapsing
authorBill Erickson <berick@esilibrary.com>
Mon, 19 May 2014 20:02:02 +0000 (16:02 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 19 May 2014 20:02:02 +0000 (16:02 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/staff/circ/patron/index.tt2
Open-ILS/src/templates/staff/circ/patron/t_summary.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/app.js

index 18a0b57..ee09fa1 100644 (file)
@@ -36,9 +36,31 @@ angular.module('egCoreMod').run(['egStrings', function(s) {
 
 <div class="row">
   <div class="col-md-3">
-    [% INCLUDE 'staff/circ/patron/t_summary.tt2' %]
-  </div>
-  
+    <div ng-show="patron()">
+      <h4 title="{{patron().id()}}">
+        <div class="flex-row">
+          <div class="flex-cell">
+            [% l('[_1], [_2], [_3]', 
+                '{{patron().family_name()}}',
+                '{{patron().first_given_name()}}',
+                '{{patron().second_given_name()}}') %]
+          </div>
+          <div>
+            <a href ng-click="collapsePatronSummary=true" 
+              title="[% l('Collapse Patron Summary Display') %]"
+              ng-hide="collapsePatronSummary">
+              <span class="glyphicon glyphicon-resize-small"></span>
+            </a>
+            <a href ng-click="collapsePatronSummary=false" 
+              title="[% l('Expand Patron Summary Display') %]"
+              ng-show="collapsePatronSummary">
+              <span class="glyphicon glyphicon-resize-full"></span>
+            </a>
+          </div>
+        </div><!-- row -->
+      </h4>
+    </div><!-- if patron -->
+  </div><!-- col -->
   <div class="col-md-9">
     <ul class="nav nav-pills nav-pills-like-tabs">
       <li ng-class="{active : tab == 'checkout', disabled : !patron()}">
@@ -81,12 +103,20 @@ angular.module('egCoreMod').run(['egStrings', function(s) {
         <a href="./circ/patron/search">[% l('Patron Search') %]</a>
       </li>
     </ul>
+  </div><!-- col -->
+</div><!-- row -->
+
+<div class="row">
+  <div class="col-md-3" ng-hide="collapsePatronSummary">
+    [% INCLUDE 'staff/circ/patron/t_summary.tt2' %]
+  </div>
+  <div ng-class="{'col-md-12' : collapsePatronSummary,'col-md-9' : !collapsePatronSummary}">
     <div class="tab-content">
       <div class="tab-pane active">
         <div ng-view></div>
       </div>
     </div>
-  </div>
-</div>
+  </div><!-- col -->
+</div><!-- row -->
 
 [% END %]
index 493ebc0..251bc5e 100644 (file)
@@ -1,5 +1,6 @@
 
-<div ng-cloak ng-controller="PatronSummaryCtrl">
+<div ng-cloak>
+  <!--
   <div class="row" ng-show="!patron()">
     <div class="col-md-12">
       <i>[% l('Patron Summary') %]</i>
@@ -13,6 +14,8 @@
         </h4>
       </div>
     </div>
+    -->
+  <div ng-show="patron()" id="patron-summary-grid">
     <div class="row" 
       ng-class="{'patron-summary-divider' : !$index}"
       ng-repeat="penalty in patron().standing_penalties()">
index ed4f143..f40b189 100644 (file)
@@ -669,15 +669,6 @@ function($scope,  $q,  $routeParams,  $timeout,  $window,  $location,  egCore,
     }
 }])
 
-/** * Manages patron summary view
- */
-.controller('PatronSummaryCtrl',
-       ['$scope',
-function($scope) {
-    // so for, all data for this controller is data inherited
-    // from the parent scope.  Nothing to do here.
-}])
-
 /**
  * Manages edit
  */