move eframe to external; copy detail link for catalog
authorBill Erickson <berick@esilibrary.com>
Fri, 18 Jul 2014 15:27:30 +0000 (11:27 -0400)
committerBill Erickson <berick@esilibrary.com>
Fri, 18 Jul 2014 15:27:30 +0000 (11:27 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/opac/parts/record/copy_table.tt2
Open-ILS/src/templates/staff/css/style.css.tt2
Open-ILS/src/templates/staff/share/t_eframe.tt2 [new file with mode: 0644]
Open-ILS/web/js/ui/default/staff/services/eframe.js

index 3ae8504..578be9f 100644 (file)
@@ -104,8 +104,13 @@ END; # FOREACH bib
             [%- END %]
             <td headers='copy_header_barcode' property="serialNumber">
                 [%- IF ctx.is_staff -%]
+                  [%- IF ctx.is_browser_staff %]
+                    <a target="_top" href="[% ctx.base_path %]/staff/cat/item/[% copy_info.id %]">[% copy_info.barcode | html %]</a>
+                  [% ELSE %]
                     <a href="javascript:void(0)" onclick="xulG.new_tab(xulG.urls.XUL_COPY_STATUS, {}, {'from_item_details_new': true, 'barcodes': ['[%- copy_info.barcode | html | replace('\'', '\\\'') -%]']})">[% copy_info.barcode | html %]</a>
-                [%- ELSE -%][% copy_info.barcode | html %]
+                  [%- END -%]
+                [%- ELSE -%]
+                [% copy_info.barcode | html %]
                 [%- END -%]
                 [%- IF attrs.gtin13;
                     '<meta property="gtin13" content="' _ attrs.gtin13 _ '" />';
index 0a8becf..9f81735 100644 (file)
@@ -172,6 +172,9 @@ table.list tr.selected td { /* deprecated? */
 /* embedded UI iframe */
 .eg-embed-frame {
   width: 100%;
+}
+.eg-embed-frame iframe {
+  width: 100%;
   border: none;
   margin: 0px;
   padding: 0px;
diff --git a/Open-ILS/src/templates/staff/share/t_eframe.tt2 b/Open-ILS/src/templates/staff/share/t_eframe.tt2
new file mode 100644 (file)
index 0000000..8fc95ca
--- /dev/null
@@ -0,0 +1,9 @@
+<div class="eg-embed-frame">
+  <!-- height is calculated at render time -->
+  <iframe 
+    src="{{url}}" 
+    style="height:{{height}}px"
+    onload="egEmbedFrameLoader(this)">
+  </iframe>
+</div>
+
index 7e18246..d4c0176 100644 (file)
@@ -19,12 +19,11 @@ angular.module('egCoreMod')
             onchange : '='
         },
 
-        template : '<iframe src="{{url}}" onload="egEmbedFrameLoader(this)" '
-            + 'class="eg-embed-frame" style="height:{{height}}px"></iframe>',
+        templateUrl : './share/t_eframe',
 
         controller : 
-                   ['$scope','$window','$location','$q','egCore',
-            function($scope , $window , $location , $q , egCore) {
+                   ['$scope','$window','$location','$q','$timeout','egCore',
+            function($scope , $window , $location , $q , $timeout , egCore) {
 
             // Set the iframe height to just under the window height.
             // leave room for the navbar, padding, margins, etc.
@@ -67,7 +66,17 @@ angular.module('egCoreMod')
 
                 var page = iframe.contentWindow.location.href;
                 console.debug('egEmbedFrameLoader(): ' + page);
-                if ($scope.onchange) $scope.onchange(page);
+
+                $scope.prev_page = function() {
+                    iframe.contentWindow.history.back();
+                }
+                $scope.reload_page = function() {
+                    iframe.contentWindow.location.replace(
+                        iframe.contentWindow.location);
+                }
+                $scope.next_page = function() {
+                    iframe.contentWindow.history.forward();
+                }
 
                 // tell the iframe'd window its inside the staff client
                 iframe.contentWindow.IAMXUL = true;
@@ -195,6 +204,8 @@ angular.module('egCoreMod')
                         iframe.contentWindow.xulG[key] = val;
                     });
                 }
+
+                if ($scope.onchange) $scope.onchange(page);
             }
         }]
     }