display: none !important;
}
</style>
- <title>[% l('Evergreen Staff [_1]', ctx.page_title) %]</title>
+ <!-- The page title changes with $rootScope.pageTitle,
+ defaulting to the static template page title. -->
+ <title ng-cloak>{{pageTitle || "[% ctx.page_title %]"}}</title>
<base href="/eg/staff/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
s.CONFIRM_CLEAR_PENDING_BODY = "[% l('Are you certain you want to clear these pending offline transactions? This action is irreversible. Transactions cannot be recovered after clearing!') %]";
s.LOCATION_NAME_OU_QUALIFIED = "[% l('{{location_name}} ({{owning_lib_shortname}})') %]";
s.CONFIRM_IN_HOUSE_NUM_USES_COUNT_TITLE = "[% l('Are you sure you want to record {{num_uses}} uses for this?') %]";
+ s.PAGE_TITLE_DEFAULT = "[% l('Evergreen Staff Client') %]";
+ s.PAGE_TITLE_DYNAMIC_AND_CONTEXT = "[% l('[_1] - [_2]', '{{dynamic}}', '{{context}}') %]";
}]);
</script>
s.SERIALS_ISSUANCE_FAIL_SAVE = "[% l('Failed to save issuance') %]";
s.SERIALS_ISSUANCE_SUCCESS_SAVE = "[% l('Issuance saved') %]";
+ s.PAGE_TITLE_CATALOG_CONTEXT = "[% l('Catalog') %]";
+ s.PAGE_TITLE_BIB_DETAIL = "[% l('Bib [_1]', '{{record_id}}') %]";
}])
</script>
s.OPT_IN_DIALOG = "[% l('Does patron [_1], [_2] from [_3] ([_4]) consent to having their personal information shared with your library?', '{{family_name}}', '{{first_given_name}}', '{{org_name}}', '{{org_shortname}}') %]";
s.BUCKET_ADD_SUCCESS = "[% l('Successfully added [_1] users to bucket [_2].', '{{count}}', '{{name}}') %]";
s.BUCKET_ADD_FAIL = "[% l('Failed to add [_1] users to bucket [_2].', '{{count}}', '{{name}}') %]";
+ s.PAGE_TITLE_PATRON_SEARCH = "[% l('Patron Search') %]";
+ s.PAGE_TITLE_PATRON_NAME = "[% l('[_1], [_2] [_3]', '{{lname}}','{{fname}}','{{mname}}') %]";
+ s.PAGE_TITLE_PATRON_CHECKOUT = "[% l('Checkout') %]";
+ s.PAGE_TITLE_PATRON_MESSAGES = "[% l('Messages') %]";
+ /* TODO: The "Other" page title could be smarter.. */
+ s.PAGE_TITLE_PATRON_OTHER = "[% l('Other') %]";
+ s.PAGE_TITLE_PATRON_BILLS = "[% l('Bills') %]";
+ s.PAGE_TITLE_PATRON_HOLDS = "[% l('Holds') %]";
+ s.PAGE_TITLE_PATRON_ITEMS_OUT = "[% l('Items Out') %]";
+ s.PAGE_TITLE_PATRON_EDIT = "[% l('Edit') %]";
}]);
</script>
$scope.record_id = $routeParams.record_id;
$scope.summary_pane_record;
+ if ($scope.record_id) {
+ // TODO: Apply tab-specific title contexts
+ egCore.strings.setPageTitle(
+ egCore.strings.PAGE_TITLE_BIB_DETAIL,
+ egCore.strings.PAGE_TITLE_CATALOG_CONTEXT,
+ {record_id : $scope.record_id}
+ );
+ } else {
+ // Default to title = Catalog
+ egCore.strings.setPageTitle(
+ egCore.strings.PAGE_TITLE_CATALOG_CONTEXT);
+ }
+
if ($routeParams.record_id) $scope.from_route = true;
else $scope.from_route = false;
egHolds.fetch_holds(hold_ids).then($scope.hold_grid_data_provider.refresh);
init_parts_url();
$location.update_path('/cat/catalog/record/' + $scope.record_id);
+ // update_path() bypasses the controller for path
+ // /cat/catalog/record/:record_id. Manually set title here too.
+ egCore.strings.setPageTitle(
+ egCore.strings.PAGE_TITLE_BIB_DETAIL,
+ egCore.strings.PAGE_TITLE_CATALOG_CONTEXT,
+ {record_id : $scope.record_id}
+ );
} else {
delete $scope.record_id;
$scope.from_route = false;
if (patron_id) {
$scope.patron_id = patron_id;
return patronSvc.setPrimary($scope.patron_id)
+ .then(function() {
+ // the page title context label comes from the tab.
+ egCore.strings.setPageTitle(
+ egCore.strings.PAGE_TITLE_PATRON_NAME,
+ egCore.strings['PAGE_TITLE_PATRON_' + tab.toUpperCase()],
+ { lname : patronSvc.current.family_name(),
+ fname : patronSvc.current.first_given_name(),
+ mname : patronSvc.current.second_given_name()
+ }
+ );
+ })
.then(function() {return patronSvc.checkAlerts()})
.then(redirectToAlertPanel)
.then(function(){
$scope.ident_type_name = $scope.patron().ident_type().name()
$scope.hasIdentTypeName = $scope.ident_type_name.length > 0;
});
+ } else {
+ // No patron, use the tab name as the page title.
+ egCore.strings.setPageTitle(
+ egCore.strings['PAGE_TITLE_PATRON_' + tab.toUpperCase()]);
}
return $q.when();
}
*/
angular.module('egCoreMod').factory('egStrings',
-['$interpolate', function($interpolate) {
- return {
+['$interpolate', '$rootScope', function($interpolate, $rootScope) {
+ var service = {
+
'$replace' : function(str, args) {
if (!str) return '';
return $interpolate(str)(args);
+ },
+
+ /**
+ * Sets the page <title> value.
+ *
+ * The title is composed of a dynamic and static component.
+ * The dynamic component may optionally be compiled via
+ * $interpolate'ion.
+ *
+ * The dynamic component is subject to truncation if it exceeds
+ * titleTruncLevel length and a context value is also applied.
+ *
+ * Only components that have values applied are used. When
+ * both have a value, they are combined into a single string
+ * separated by a - (by default).
+ */
+ titleTruncLevel : 12,
+ setPageTitle : function(dynamic, context, dynargs) {
+
+ if (!dynamic) {
+ $rootScope.pageTitle = context || service.PAGE_TITLE_DEFAULT;
+ return;
+ }
+
+ if (dynargs) dynamic = service.$replace(dynamic, dynargs);
+
+ if (!context) {
+ $rootScope.pageTitle = dynamic;
+ return;
+ }
+
+ // only truncate when it's competing with a context value
+ dynamic = dynamic.substring(0, service.titleTruncLevel);
+
+ $rootScope.pageTitle = service.$replace(
+ service.PAGE_TITLE_DYNAMIC_AND_CONTEXT, {
+ dynamic : dynamic,
+ context : context
+ }
+ );
}
- }
+ };
+
+ return service;
}]);