[% l('Search the Catalog') %]
</a>
</li>
+ <!--
+ Link to experimental Angular staff catalog.
+ Leaving disabled until more functionality can be fleshed out.
+ -->
+ <!--
+ <li>
+ <a href="/eg2/staff/catalog/search" target="_self">
+ <span class="glyphicon glyphicon-search"></span>
+ <span>[% l('Staff Catalog (Experimental)') %]</span>
+ </a>
+ </li>
+ -->
<li>
<a href="./cat/bucket/record/view" target="_self">
<span class="glyphicon glyphicon-list-alt"></span>
</a>
</li>
<li>
- <a href="./admin/acq/index" target="_self">
+ <a href="/eg2/staff/admin/acq/splash">
<span class="glyphicon glyphicon-usd"></span>
[% l('Acquisitions Administration') %]
</a>
}
}
+ // Force auth cookies to live under path "/" instead of "/eg/staff"
+ // so they may be shared with the Angular app.
+ // There's no way to tell under what path a cookie is stored in
+ // the browser, all we can do is migrate it regardless.
+ service.migrateAuthCookies = function() {
+ [ 'eg.auth.token',
+ 'eg.auth.time',
+ 'eg.auth.token.oc',
+ 'eg.auth.time.oc'
+ ].forEach(function(key) {
+ var val = service.getLoginSessionItem(key);
+ if (val) {
+ $cookies.remove(key, {path: '/eg/staff/'});
+ service.setLoginSessionItem(key, val);
+ }
+ });
+ }
+
service.getLoginSessionItem = function(key) {
var val = $cookies.get(key);
if (val == null) return;
service.addLoginSessionKey(key);
if (jsonified === undefined )
jsonified = JSON.stringify(value);
- $cookies.put(key, jsonified);
+ $cookies.put(key, jsonified, {path: '/'});
}
// Set the value for the given key.
service.removeLoginSessionItem = function(key) {
service.removeLoginSessionKey(key);
- $cookies.remove(key);
+ $cookies.remove(key, {path: '/'});
}
service.removeSessionItem = function(key) {
content;
}).then(function(content) {
- service.last_print.content = content;
- service.last_print.content_type = type;
- service.last_print.printScope = printScope
-
- egHatch.setItem('eg.print.last_printed', service.last_print);
// Ingest the content into the page DOM.
- return service.ingest_print_content(
- service.last_print.content_type,
- service.last_print.content,
- service.last_print.printScope
- );
+ return service.ingest_print_content(type, content, printScope);
+
+ }).then(function(html) {
+
+ // Note browser ignores print context
+ service.last_print.content = html;
+ service.last_print.content_type = type;
+ egHatch.setItem('eg.print.last_printed', service.last_print);
- }).then(function() {
$window.print();
});
}
} else {
promise.then(function () {
service.ingest_print_content(
- service.last_print.content_type,
- service.last_print.content,
- service.last_print.printScope
+ null, null, null, service.last_print.content
).then(function() { $window.print() });
});
}
// For local printing, this lets us print directly from the
// DOM with print CSS.
// Returns a promise reolved with the compiled HTML as a string.
- egPrint.ingest_print_content = function(type, content, printScope) {
+ //
+ // If a pre-compiled HTML string is provided, it's inserted
+ // as-is into the DOM for browser printing without any
+ // additional interpolation. This is useful for reprinting,
+ // previously compiled content.
+ egPrint.ingest_print_content =
+ function(type, content, printScope, compiledHtml) {
+
+ if (compiledHtml) {
+ $scope.elm.html(compiledHtml);
+ return $q.when(compiledHtml);
+ }
+
$scope.elm.html(content);
var sub_scope = $scope.$new(true);