<div id="top-content-container" class="container" ng-cloak>[% content %]</div>
[%
- # status bar along bottom of page
- INCLUDE "staff/statusbar.tt2";
-
# script imports
INCLUDE "staff/base_js.tt2";
<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/coresvc.js"></script>
<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/user.js"></script>
<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/navbar.js"></script>
-<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/statusbar.js"></script>
<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/ui.js"></script>
<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/date.js"></script>
<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/op_change.js"></script>
border-bottom-color: #ddd;
}
-/* status bar along the bottom of the page ------------------------ */
-/* decrease padding to decrease overall height */
-
-/** TODO:move status bar items into navbar config entry (top-right)
- * to avoid body padding weirdness. Or if we want a permenently
- * visible status bar, maybe put it just below the navbar.. */
-
-/* bottom padding ensures no body content is hidden behind the status
- * bar. When content reaches the status bar a scroll bar appears */
-/*body { padding-bottom: 26px; }*/
-
-#status-bar {
- min-height:1.8em !important;
-}
-#status-bar > ul {
- margin-right:6px;
-}
-#status-bar li {
- padding-left: 10px;
-}
-#status-bar > li > a {
- padding-top:5px !important;
- padding-bottom:5px !important;
-}
-.status-bar-connected {
+/* Hatch / WebSockets / Etc. connectivity status indicator */
+.connect-status-ok {
color: rgb(92, 184, 92); /* success */
}
[% l('Log Out') %]
</a>
</li>
+ <li class="divider"></li>
+ <li>
+ <a href disabled="disabled">
+ <span
+ title="[% l('Hatch Connection Status') %]"
+ class="glyphicon glyphicon-transfer"
+ ng-class="{'connect-status-ok' : hatchConnected()}">
+ </span>
+ [% l('Hatch') %]
+ </a>
+ </li>
</ul>
</li>
</ul>
+++ /dev/null
-<!-- Status bar along the bottom of the page -->
-
-<div id="status-bar"
- class="navbar navbar-default navbar-fixed-bottom"
- ng-model="statusbar_hidden"
- ng-hide="true"
- role="navigation">
-
- <!--
- Define the status bar as a directive so it may be used globally.
- The template is defined inline (below) to leverage i18n and
- so one less network fetch is required.
- -->
- <eg-status-bar></eg-status-bar>
- <script type="text/ng-template" id="eg-status-bar-template">
- <ul class="nav navbar-nav navbar-right">
- <li>{{messages[0]}}</li>
- <li>
- <span
- ng-click="hatchConnect()"
- title="[% l('Print/Store Connection Status') %]"
- class="glyphicon glyphicon-transfer"
- ng-class="{'status-bar-connected' : hatchConnected()}">
- </span>
- </li>
- <li>
- <span
- title="[% l('Network Connection Status') %]"
- class="glyphicon glyphicon-signal"
- ng-class="{'status-bar-connected' : netConnected()}">
- </span>
- </li>
- <li ng-click="statusbar_hidden ? statusbar_hidden = false : statusbar_hidden = true">
- <span
- title="[% l('Collapse ... Reload to restore') %]"
- class="glyphicon glyphicon-collapse-down">
- </span>
- </li>
- </ul>
- </script>
-</div>
'services/audio.js',
'services/coresvc.js',
'services/navbar.js',
- 'services/statusbar.js',
'services/ui.js',
'services/date.js',
'services/op_change.js',
return egCore.auth.token();
}
+ // Returns true if the browser is connected to Hatch
+ $scope.hatchConnected = function() {
+ return egCore.hatch.hatchAvailable;
+ }
+
// tied to logout link
$scope.logout = function() {
egCore.auth.logout();
+++ /dev/null
-/**
- * egStatusBar
- *
- * Displays key information and messages to the user.
- *
- * Currently displays network connection status, egHatch connection
- * status, and messages delivered via
- * $scope.$emit('egStatusBarMessage', msg)
- */
-
-angular.module('egCoreMod')
-
-.directive('egStatusBar', function() {
- return {
- restrict : 'AE',
- replace : true,
- templateUrl : 'eg-status-bar-template',
- scope : { },
- controller : [
- '$scope','$rootScope','egHatch',
- function($scope , $rootScope , egHatch) {
- $scope.messages = []; // keep a log of recent messages
-
- $scope.netConnected = function() {
- // TODO: should should be abstracted through egNet
- return OpenSRF.websocketConnected();
- }
-
- // update the UI whenever we lose connection
- OpenSRF.onWebSocketClosed = function() {
- $scope.$apply();
- }
-
- $scope.hatchConnected = function() {
- return egHatch.hatchAvailable;
- }
-
- // update the UI whenever we lose connection
- egHatch.onHatchClose = function() {
- $scope.$apply();
- }
-
- // update the UI whenever we lose connection
- egHatch.onHatchOpen = function() {
- $scope.$apply();
- }
-
- $scope.hatchConnect = function() {
- egHatch.hatchConnect();
- }
-
- $rootScope.$on('egStatusBarMessage', function(evt, args) {
- $scope.messages.unshift(args);
-
- // ensure the list does not exceed 10 messages
- // TODO: configurable?
- $scope.messages.splice(10, 1);
- });
- }]
- }
-});
'services/user.js',
'services/startup.js',
'services/ui.js',
- 'services/statusbar.js',
'services/grid.js',
'services/op_change.js',
'services/navbar.js', 'services/date.js',