LP#1570091: Show (index / hit count) in the Back To Results button
authorMike Rylander <mrylander@gmail.com>
Wed, 24 Feb 2016 16:02:42 +0000 (11:02 -0500)
committerBill Erickson <berickxx@gmail.com>
Wed, 20 Apr 2016 14:51:32 +0000 (10:51 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Conflicts:
Open-ILS/src/templates/opac/parts/record/navigation.tt2

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/templates/opac/parts/record/navigation.tt2
Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js

index 003f6bd..e44e8da 100644 (file)
@@ -2,6 +2,11 @@
 <div class="rdetail_header">
     <span class="rdetail_results">
         <a href='[% mkurl(ctx.opac_root _ '/results', {}, stop_parms); %]'><span class="nav_arrow_fix">&#9668;</span> [% l('Search Results') %]</a>
+        <!-- stash these in JS for the web staff client to find -->
+        <script>
+            window.search_result_hit_count = [% ctx.hit_count %];
+            window.search_result_index = [% ctx.search_result_index %];
+        </script>
         <span class="rdetail_result_count">
             [% l('Showing Item [_1] of [_2]', ctx.search_result_index + 1, ctx.hit_count) %]
         </span>
index 39ec701..3dd6638 100644 (file)
@@ -18,7 +18,7 @@
        [% l('End') %]
     </button>
     <button type="button" ng-disabled="from_route" class="btn btn-default" ng-click="opac_call('rdetailBackToResults', true)">
-       [% l('Back To Results') %]
+       [% l('Back To Results') %] ( {{ search_result_index }} / {{ search_result_hit_count }} )
     </button>
   </div>
   <div class="col-md-3">
index bfa8ee6..e2540b6 100644 (file)
@@ -248,6 +248,25 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
     $scope.opac_iframe = null;
     $scope.parts_iframe = null;
 
+    $scope.search_result_index = 1;
+    $scope.search_result_hit_count = 1;
+
+    $scope.$watch(
+        'opac_iframe.dom.contentWindow.search_result_index',
+        function (n,o) {
+            if (!isNaN(parseInt(n)))
+                $scope.search_result_index = n + 1;
+        }
+    );
+
+    $scope.$watch(
+        'opac_iframe.dom.contentWindow.search_result_hit_count',
+        function (n,o) {
+            if (!isNaN(parseInt(n)))
+                $scope.search_result_hit_count = n;
+        }
+    );
+
     $scope.in_opac_call = false;
     $scope.opac_call = function (opac_frame_function, force_opac_tab) {
         if ($scope.opac_iframe) {