[%
WRAPPER "staff/base.tt2";
- ctx.page_title = l("Record Buckets");
+ ctx.page_title = l("Catalog");
ctx.page_app = "egCatalogApp";
%]
[% BLOCK APP_JS %]
<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/eframe.js"></script>
+<script src="[% ctx.media_prefix %]/js/ui/default/staff/cat/services/record.js"></script>
<script src="[% ctx.media_prefix %]/js/ui/default/staff/cat/catalog/app.js"></script>
[% END %]
--- /dev/null
+
+<div class="row pad-vert">
+ <div class="col-md-9">
+ <div class="alert alert-info alert-less-pad strong-text-2">
+ <span>[% l('Catalog') %]</span>
+ </div>
+ </div>
+ <div class="col-md-3">
+ <div class="btn-group pull-right" dropdown>
+ <button type="button" class="btn btn-default dropdown-toggle" ng-disabled="!record_id">
+ [% l('Actions for This Record') %]
+ <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu dropdown-menu-right" role="menu">
+ <li><a href dropdown-toggle ng-click="set_record_tab('catalog')">[% l('OPAC View') %]</a></li>
+ <li><a href dropdown-toggle ng-click="set_record_tab('record_html')">[% l('MARC View') %]</a></li>
+ <li class="divider"></li>
+ <li class="disabled"><a href dropdown-toggle>[% l('View Holds') %]</a></li>
+ <li class="disabled"><a href dropdown-toggle>[% l('Mark as Title Hold Transfer Destination') %]</a></li>
+ <li class="disabled"><a href dropdown-toggle>[% l('Transfer All Title Holds') %]</a></li>
+ </ul>
+ </div>
+ </div>
+</div>
+
+<div class="pad-vert">
+ <!-- ng-show allows the catalog iframe to stay loaded (unlike ng-if) -->
+ <div ng-show="record_tab == 'catalog'">
+ <eg-embed-frame url="catalog_url" handlers="handlers" onchange="handle_page"></eg-embed-frame>
+ </div>
+ <!-- ng-if the remaining tabs so they can be instantiated on demand -->
+ <div ng-if="record_tab == 'record_html'">
+ <eg-record-html record-id="record_id"></eg-record-html>
+ </div>
+</div>
+
['egStartup', function(egStartup) {return egStartup.go()}]}
$routeProvider.when('/cat/catalog/index', {
- template: '<eg-embed-frame url="catalog_url" handlers="handlers"></eg-embed-frame>',
+ templateUrl: './cat/catalog/t_catalog',
+ controller: 'CatalogCtrl',
+ resolve : resolver
+ });
+
+ $routeProvider.when('/cat/catalog/record/:record_id', {
+ templateUrl: './cat/catalog/t_catalog',
controller: 'CatalogCtrl',
resolve : resolver
});
// TODO: is start path configurable in the xul client?
var url = $location.absUrl().replace(/\/staff.*/, '/opac/advanced');
+ if ($routeParams.record_id) {
+ $scope.record_id = $routeParams.record_id;
+ url = url.replace(/advanced/, '/record/' + $scope.record_id);
+ }
+
// pass the reg URL into the scope, thus into the
$scope.catalog_url = url;
+ // default to catalog view of the record page
+ $scope.record_tab = 'catalog';
+
+ $scope.set_record_tab = function(tab) {
+ $scope.record_tab = tab;
+ }
+
+ $scope.handle_page = function(url) {
+ var match = url.match(/\/+opac\/+record\/+(\d+)/);
+ if (match) {
+ $scope.record_id = match[1];
+ console.debug('loading record ' + $scope.record_id);
+
+ // force the record_id to show up in the page.
+ // not sure why a $digest isn't occuring here.
+ try { $scope.$apply() } catch(E) {}
+ } else {
+ delete $scope.record_id;
+ }
+ }
$scope.handlers = {};
}])
// optional hash of functions which augment or override
// the stock xulG functions defined below.
- handlers : '='
+ handlers : '=',
+
+ // called after onload of each new iframe page
+ onchange : '='
},
template : '<iframe src="{{url}}" onload="egEmbedFrameLoader(this)" '
// Set the iframe height to just under the window height.
// leave room for the navbar, padding, margins, etc.
- $scope.height = $window.outerHeight - 250;
+ $scope.height = $window.outerHeight - 300;
// browser client doesn't use cookies, so we don't load the
// (at the time of writing, quite limited) angular.cookies
// NOTE: catalog integration is not a stop-gap
$window.egEmbedFrameLoader = function(iframe) {
- console.debug('egEmbedFrameLoader()...');
+ var page = iframe.contentWindow.location.href;
+ console.debug('egEmbedFrameLoader(): ' + page);
+ if ($scope.onchange) $scope.onchange(page);
// tell the iframe'd window its inside the staff client
iframe.contentWindow.IAMXUL = true;