initial item status UI
authorBill Erickson <berick@esilibrary.com>
Wed, 14 May 2014 16:04:22 +0000 (12:04 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 14 May 2014 16:04:22 +0000 (12:04 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/staff/cat/item/index.tt2 [new file with mode: 0644]
Open-ILS/src/templates/staff/cat/item/summary_header.tt2 [new file with mode: 0644]
Open-ILS/src/templates/staff/cat/item/t_cat_pane.tt2 [new file with mode: 0644]
Open-ILS/src/templates/staff/cat/item/t_circs_pane.tt2 [new file with mode: 0644]
Open-ILS/src/templates/staff/cat/item/t_holds_pane.tt2 [new file with mode: 0644]
Open-ILS/src/templates/staff/cat/item/t_list.tt2 [new file with mode: 0644]
Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2 [new file with mode: 0644]
Open-ILS/src/templates/staff/cat/item/t_view.tt2 [new file with mode: 0644]
Open-ILS/src/templates/staff/css/style.css.tt2
Open-ILS/src/templates/staff/navbar.tt2
Open-ILS/web/js/ui/default/staff/cat/item/app.js [new file with mode: 0644]

diff --git a/Open-ILS/src/templates/staff/cat/item/index.tt2 b/Open-ILS/src/templates/staff/cat/item/index.tt2
new file mode 100644 (file)
index 0000000..2e99a90
--- /dev/null
@@ -0,0 +1,21 @@
+[%
+  WRAPPER "staff/base.tt2";
+  ctx.page_title = l("Item Status"); 
+  ctx.page_app = "egItemStatus";
+  ctx.page_ctrl = "SearchCtrl";
+%]
+
+[% BLOCK APP_JS %]
+<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/grid.js"></script>
+<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/ui.js"></script>
+<script src="[% ctx.media_prefix %]/js/ui/default/staff/cat/services/copy_details.js"></script>
+<script src="[% ctx.media_prefix %]/js/ui/default/staff/cat/item/app.js"></script>
+[% END %]
+
+<h1>search bar goes here</h1>
+
+<div ng-view></div>
+
+[% END %]
+
+
diff --git a/Open-ILS/src/templates/staff/cat/item/summary_header.tt2 b/Open-ILS/src/templates/staff/cat/item/summary_header.tt2
new file mode 100644 (file)
index 0000000..0bfb535
--- /dev/null
@@ -0,0 +1,58 @@
+
+<!-- the first column in each is slightly wider to accommodate title/author -->
+<div class="row pad-vert">
+  <div class="col-md-1 header-label">[% l('Title:') %]</div>
+  <div class="col-md-3">
+    {{copy.call_number().record().simple_record().title() || copy.dummy_title()}}
+  </div>
+
+  <!-- evenly disperse the remaining labels and fields -->
+  <div class="col-md-8">
+    <div class="col-md-2 header-label">[% l('Edition:') %]</div>
+    <div class="col-md-2"><!-- FIXME: no edition field on simple record --></div>
+
+    <div class="col-md-2 header-label">[% l('TCN:') %]</div>
+    <div class="col-md-2">{{copy.call_number().record().tcn_value()}}</div>
+
+    <div class="col-md-2 header-label">[% l('Created By:') %]</div>
+    <div class="col-md-2">{{copy.call_number().record().creator().usrname()}}</div>
+  </div>
+</div><!-- row -->
+
+<div class="row">
+  <div class="col-md-1 header-label">[% l('Author:') %]</div>
+  <div class="col-md-3">
+    {{copy.call_number().record().simple_record().author() || copy.dummy_author()}}
+  </div>
+
+  <div class="col-md-8">
+    <div class="col-md-2 header-label">[% l('Pub Date:') %]</div>
+    <div class="col-md-2">
+      {{copy.call_number().record().simple_record().pubdate()}}
+    </div>
+
+    <div class="col-md-2 header-label">[% l('Databse ID:') %]</div>
+    <div class="col-md-2">{{copy.call_number().record().id()}}</div>
+
+    <div class="col-md-2 header-label">[% l('Last Edited By:') %]</div>
+    <div class="col-md-2">{{copy.call_number().record().editor().usrname()}}</div>
+  </div>
+</div><!-- row -->
+
+<div class="row">
+  <div class="col-md-1 header-label">[% l('Bib Call #:') %]</div>
+  <div class="col-md-3"><!-- FIXME: no bib call no on simple rec --></div>
+
+  <div class="col-md-8">
+    <div class="col-md-2 header-label">[% l('Item CAll #:') %]</div>
+    <div class="col-md-2">{{copy.call_number().label()}}</div>
+
+    <div class="col-md-2 header-label">[% l('Record Owner:') %]</div>
+    <div class="col-md-2">{{copy.call_number().record().owner().shortname()}}</div>
+
+    <div class="col-md-2 header-label">[% l('Last Edited On:') %]</div>
+    <div class="col-md-2">{{copy.edit_date() | date:'short'}}</div>
+  </div>
+</div><!-- row -->
+
+
diff --git a/Open-ILS/src/templates/staff/cat/item/t_cat_pane.tt2 b/Open-ILS/src/templates/staff/cat/item/t_cat_pane.tt2
new file mode 100644 (file)
index 0000000..f4cbcac
--- /dev/null
@@ -0,0 +1 @@
+<h1>summary</h1>
diff --git a/Open-ILS/src/templates/staff/cat/item/t_circs_pane.tt2 b/Open-ILS/src/templates/staff/cat/item/t_circs_pane.tt2
new file mode 100644 (file)
index 0000000..f4cbcac
--- /dev/null
@@ -0,0 +1 @@
+<h1>summary</h1>
diff --git a/Open-ILS/src/templates/staff/cat/item/t_holds_pane.tt2 b/Open-ILS/src/templates/staff/cat/item/t_holds_pane.tt2
new file mode 100644 (file)
index 0000000..f4cbcac
--- /dev/null
@@ -0,0 +1 @@
+<h1>summary</h1>
diff --git a/Open-ILS/src/templates/staff/cat/item/t_list.tt2 b/Open-ILS/src/templates/staff/cat/item/t_list.tt2
new file mode 100644 (file)
index 0000000..7b02743
--- /dev/null
@@ -0,0 +1 @@
+<h1>LIST</h1>
diff --git a/Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2 b/Open-ILS/src/templates/staff/cat/item/t_summary_pane.tt2
new file mode 100644 (file)
index 0000000..c3b2e1d
--- /dev/null
@@ -0,0 +1,32 @@
+
+<div class="row pad-vert">
+  <div class="col-md-1 header-label">[% l('Barcode') %]</div>
+  <div class="col-md-2">{{copy.barcode()}}</div>
+
+  <div class="col-md-1 header-label">[% l('Circ Library') %]</div>
+  <div class="col-md-2">{{copy.circ_lib().shortname()}}</div>
+
+  <div class="col-md-1 header-label">[% l('Item Call #') %]</div>
+  <div class="col-md-2">{{copy.call_number().label()}}</div>
+
+  <div class="col-md-1 header-label">[% l('Status') %]</div>
+  <div class="col-md-2">{{copy.status().name()}}</div>
+</div>
+
+<div class="row pad-vert">
+  <div class="col-md-1 header-label">[% l('Price') %]</div>
+  <div class="col-md-2">{{copy.price()}}</div>
+
+  <div class="col-md-1 header-label">[% l('Owning Library') %]</div>
+  <div class="col-md-2">{{copy.circ_lib().shortname()}}</div>
+
+  <div class="col-md-1 header-label">[% l('Renewal Type') %]</div>
+  <div class="col-md-2">
+    <div ng-if="circ.opac_renewal() == 't'">[% l('OPAC') %]</div>
+    <div ng-if="circ.desk_renewal() == 't'">[% l('Desk') %]</div>
+    <div ng-if="circ.phone_renewal() == 't'">[% l('Phone') %]</div>
+  </div>
+
+  <div class="col-md-1 header-label">[% l('Due Date') %]</div>
+  <div class="col-md-2">{{circ.due_date() | date:'short'}}</div>
+</div>
diff --git a/Open-ILS/src/templates/staff/cat/item/t_view.tt2 b/Open-ILS/src/templates/staff/cat/item/t_view.tt2
new file mode 100644 (file)
index 0000000..15aef0b
--- /dev/null
@@ -0,0 +1,34 @@
+[% INCLUDE 'staff/cat/item/summary_header.tt2' %]
+
+<!-- tabbed copy data view -->
+
+<ul class="nav nav-tabs">
+  <li ng-class="{active : tab == 'summary'}">
+    <a href="./cat/item/view/{{copy.id()}}/summary">
+      [% l('Quick Summary') %]
+    </a>
+  </li>
+  <li ng-class="{active : tab == 'circs'}">
+    <a href="./cat/item/view/{{copy.id()}}/circs">
+      [% l('Circulation History') %]
+    </a>
+  </li>
+  <li ng-class="{active : tab == 'holds'}">
+    <a href="./cat/item/view/{{copy.id()}}/holds">
+      [% l('Holds / Transit') %]
+    </a>
+  </li>
+  <li ng-class="{active : tab == 'cat'}">
+    <a href="./cat/item/view/{{copy.id()}}/cat">
+      [% l('Cataloging Info') %]
+    </a>
+  </li>
+</ul>
+<div class="tab-content">
+  <div class="tab-pane active">
+    <div ng-if="tab.length">
+      <div ng-include="'[% ctx.base_path %]/staff/cat/item/t_'+tab+'_pane'"></div>
+    </div>
+  </div>
+</div>
+
index 6d452eb..d6c1c53 100644 (file)
@@ -113,6 +113,11 @@ table.list tr.selected td {
     border-bottom:1px solid #CCC;
 }
 
+/* used for th-like things in grids */
+.header-label {
+  font-weight: bold;
+}
+
 /* ----------------------------------------------------------------------
  * Grid
  * ---------------------------------------------------------------------- */
@@ -286,7 +291,6 @@ table.list tr.selected td {
 }
 */
 
-
 /* ----------------------------------------------------------------------
  * /Grid
  * ---------------------------------------------------------------------- */
index db4ffc9..d2a668b 100644 (file)
               <span eg-accesskey-label>[% l('Search for Patrons') %]</span>
             </a>
           </li>
+          <li>
+            <a href="./cat/item/search" target="_self">
+              <span class="glyphicon glyphicon-search"></span>
+              <span>[% l('Search for Copies by Barcode') %]</span>
+            </a>
+          </li>
         </ul>
       </li>
 
diff --git a/Open-ILS/web/js/ui/default/staff/cat/item/app.js b/Open-ILS/web/js/ui/default/staff/cat/item/app.js
new file mode 100644 (file)
index 0000000..90b5730
--- /dev/null
@@ -0,0 +1,125 @@
+/**
+ * Item Display
+ */
+
+angular.module('egItemStatus', 
+    ['ngRoute', 'ui.bootstrap', 'egCoreMod', 'egUiMod', 'egGridMod'])
+
+.config(function($routeProvider, $locationProvider, $compileProvider) {
+    $locationProvider.html5Mode(true);
+    $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|blob):/); // grid export
+
+    var resolver = {delay : function(egStartup) {return egStartup.go()}};
+
+    // search page shows the list view by default
+    $routeProvider.when('/cat/item/search', {
+        templateUrl: './cat/item/t_list',
+        controller: 'ListCtrl',
+        resolve : resolver
+    });
+
+    $routeProvider.when('/cat/item/view/:id/:tab', {
+        templateUrl: './cat/item/t_view',
+        controller: 'ViewCtrl',
+        resolve : resolver
+    });
+
+    // default page / bucket view
+    $routeProvider.otherwise({redirectTo : '/cat/item/search'});
+})
+
+/**
+ * Search bar along the top of the page.
+ * Parent scope for list and detail views
+ */
+.controller('SearchCtrl', 
+       ['$scope','$location','egCore',
+function($scope , $location , egCore) {
+//    $location.path('/cat/item/view/' + 46879);
+}])
+
+/**
+ * List view - grid stuff
+ */
+.controller('ListCtrl', 
+       ['$scope','$location','egCore',
+function($scope , $location , egCore) {
+    // grid stuff
+
+}])
+
+/**
+ * Detail view -- shows one copy
+ */
+.controller('ViewCtrl', 
+       ['$scope','$location','$routeParams','egCore',
+function($scope , $location , $routeParams , egCore) {
+    var copyId = $routeParams.id;
+    $scope.tab = $routeParams.tab;
+
+    function load() {
+
+        egCore.pcrud.retrieve('acp', copyId, {   
+            flesh : 3, 
+            flesh_fields : {
+                acp : ['call_number','location','status','location'],
+                acn : ['record'],
+                bre : ['simple_record','creator','editor']
+            },
+
+            select : { 
+                // avoid fleshing MARC on the bre
+                // note: don't add simple_record.. not sure why
+                bre : ['id','tcn_value','creator','editor'],
+            } 
+
+        }).then(function(copy) {
+
+            if (!copy) {
+                $scope.copyNotFound = true;
+                return;
+            }
+
+            // locally flesh org units
+            copy.circ_lib(egCore.org.get(copy.circ_lib()));
+            copy.call_number().owning_lib(
+                egCore.org.get(copy.call_number().owning_lib()));
+
+            var r = copy.call_number().record();
+            if (r.owner()) r.owner(egCore.org.get(r.owner())); 
+
+            $scope.copy = copy;
+        });
+    }
+
+    // additional data needed by the summary pane
+    function loadSummaryData() {
+
+        egCore.pcrud.search('circ', 
+            {target_copy : copyId},
+            {   flesh : 1,
+                flesh_fields : {
+                    circ : [
+                        'workstation',                                         
+                        'checkin_workstation',                                 
+                        'duration_rule',                                       
+                        'max_fine_rule',                                       
+                        'recurring_fine_rule'   
+                    ]
+                },
+                order_by : {circ : 'xact_start desc' }, 
+                limit : 1
+            }
+
+        ).then(function(circ) {
+            $scope.circ = circ;
+        });
+    }
+
+    load();
+
+    if ($scope.tab == 'summary') loadSummaryData();
+    // ...
+
+}])
+