--- /dev/null
+[%
+ WRAPPER "staff/t_base.tt2";
+ ctx.page_title = l("Workstation Administration");
+ ctx.page_app = "egWorkstationAdmin";
+%]
+
+[% BLOCK APP_JS %]
+<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/grid.js"></script>
+<script src="[% ctx.media_prefix %]/js/ui/default/staff/services/ui.js"></script>
+<script src="[% ctx.media_prefix %]/js/ui/default/staff/admin/workstation/app.js"></script>
+[% END %]
+
+<div ng-view></div>
+
+[% END %]
--- /dev/null
+<div class="container">
+
+ <style>
+ /* TODO: move me */
+ textarea {
+ height: 400px;
+ width: 100%;
+ }
+
+ </style>
+
+ <div class="row">
+ <div class="col-md-12">
+ <h2>[% l('Printer Context') %]</h2>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-md-12">
+ <div class="btn-group">
+ <button type="button"
+ class="btn btn-default btn-lg"
+ ng-class="{active : context=='default'}"
+ ng-click="setContext('default')">[% l('Default') %]</button>
+ <button type="button"
+ class="btn btn-default btn-lg"
+ ng-class="{active : context=='receipt'}"
+ ng-click="setContext('receipt')">[% l('Receipt') %]</button>
+ <button type="button"
+ class="btn btn-default btn-lg"
+ ng-class="{active : context=='label'}"
+ ng-click="setContext('label')">[% l('Label') %]</button>
+ <button type="button"
+ class="btn btn-default btn-lg"
+ ng-class="{active : context=='mail'}"
+ ng-click="setContext('mail')">[% l('Mail') %]</button>
+ <button type="button"
+ class="btn btn-default btn-lg"
+ ng-class="{active : context=='offline'}"
+ ng-click="setContext('offline')">[% l('Offline') %]</button>
+ </div>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-md-12">
+ <h2>[% l('Printer Test') %]</h2>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-md-10">
+ <div class="btn-group">
+ <button type="button"
+ class="btn btn-default btn-lg"
+ ng-class="{active : contentType=='text/plain'}"
+ ng-click="setContentType('text/plain')">[% l('Plain Text') %]</button>
+ <button type="button"
+ class="btn btn-default btn-lg"
+ ng-class="{active : contentType=='text/html'}"
+ ng-click="setContentType('text/html')">[% l('HTML') %]</button>
+ </div>
+ </div>
+ <div class="col-md-2">
+ <button type="button"
+ ng-click="testPrint()"
+ class="btn btn-default btn-lg pull-right">[% l('Print') %]</button>
+ </div>
+
+ </div>
+
+ <div class="row">
+ <div class="col-md-12">
+ <div ng-show="contentType=='text/plain'"
+ng-init="textPrintContent='
+[% l('Test Print') %]
+
+1234567890
+
+12345678901234567890
+
+123456789012345678901234567890
+
+1234567890123456789012345678901234567890
+
+12345678901234567890123456789012345678901234567890
+
+12345678901234567890123456789012345678901234567890123456790
+
+[% l('Test Print') %]
+'">
+ <pre><textarea>{{textPrintContent}}</textarea></pre>
+ </div>
+
+ <div ng-show="contentType=='text/html'">
+ <textarea ng-model="htmlPrintContent"
+ng-init="htmlPrintContent='
+<div>
+ <style>p { color: blue }</style>
+ <h2>[% l('Test HTML Print') %]</h2>
+ <br/>
+ <img src=\'/opac/images/main_logo.png\' width=\'140\' height=\'24\'/>
+ <p>[% l('Welcome, Stranger!') %]</p>
+ <p>{{value1}}</p>
+ <p>{{value2}}</p>
+</div>
+'">
+ </textarea>
+
+ </div>
+ </div>
+ </div>
+
+
+</div>
+
--- /dev/null
+<br/>
+<div class="container">
+ <div class="row" id="splash-nav">
+
+ <div class="col-md-4">
+ <div class="panel panel-success">
+ <div class="panel-heading">
+ <div class="panel-title text-center">
+ [% l('Printing, Templates, etc.') %]
+ </div>
+ </div>
+ <div class="panel-body">
+ <div>
+ <span class="glyphicon glyphicon-print"></span>
+ <a target="_self" href="./admin/workstation/printing">
+ [% l('Printer Settings') %]
+ </a>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="col-md-4">
+ <div class="panel panel-success">
+ <div class="panel-heading">
+ <div class="panel-title text-center">
+ [% l('Other') %]
+ </div>
+ </div>
+ <div class="panel-body">
+ <div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="col-md-4">
+ <div class="panel panel-success">
+ <div class="panel-heading">
+ <div class="panel-title text-center">
+ [% l('Other') %]
+ </div>
+ </div>
+ <div class="panel-body">
+ <div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ </div>
+</div>
</li>
</ul>
</li>
- </ul>
+
+ <!-- cataloging -->
+ <li class="dropdown">
+ <a href="javascript:;" class="dropdown-toggle"
+ data-toggle="dropdown">[% l('Administration') %]
+ <b class="caret"></b>
+ </a>
+ <ul class="dropdown-menu">
+ <li>
+ <a href="./admin/workstation/index" target="_self">
+ <span class="glyphicon glyphicon-hdd"></span>
+ [% l('Workstation Administration') %]
+ </a>
+ </li>
+ </ul>
+ </li>
+
+ </ul> <!-- end left side entries -->
<!-- entries along the right side of the navbar -->
<ul class="nav navbar-nav navbar-right" style='margin-right: 6px;'>
--- /dev/null
+/**
+ * App to drive the base page.
+ * Login Form
+ * Splash Page
+ */
+
+angular.module('egWorkstationAdmin', ['ngRoute', 'ui.bootstrap', 'egCoreMod', 'egUiMod'])
+
+.config(['$routeProvider','$locationProvider','$compileProvider',
+ function($routeProvider , $locationProvider , $compileProvider) {
+
+ $locationProvider.html5Mode(true);
+ $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|blob):/);
+ var resolver = {delay : function(egStartup) {return egStartup.go()}};
+
+ $routeProvider.when('/admin/workstation/printing', {
+ templateUrl: './admin/workstation/t_printing',
+ controller: 'PrintingCtrl',
+ resolve : resolver
+ });
+
+ // default page
+ $routeProvider.otherwise({
+ templateUrl : './admin/workstation/t_splash',
+ controller : function() {},
+ resolve : resolver
+ });
+}])
+
+.controller('PrintingCtrl',
+ ['$scope','egPrintStore',
+function($scope , egPrintStore) {
+ console.log('PrintingCtrl');
+
+ $scope.setContext = function(ctx) { $scope.context = ctx }
+ $scope.setContentType = function(type) { $scope.contentType = type }
+ $scope.testPrint = function() {
+ if ($scope.contentType == 'text/plain') {
+ egPrintStore.print($scope.contentType, $scope.textPrintContent);
+ } else {
+ egPrintStore.print(
+ $scope.contentType,
+ $scope.htmlPrintContent,
+ {'value1' : 'Value One', 'value2' : 'Value Two'}
+ );
+ }
+ }
+
+ $scope.setContext('default');
+ $scope.setContentType('text/plain');
+
+}])
.controller('PatronSearchCtrl',
['$scope','$q','$routeParams','$timeout','$window','$location','egEnv',
'$filter','egIDL','egNet','egAuth','egEvent','egList','egUser',
- 'patronSvc', 'egGridFlatDataProvider',
+ 'patronSvc','egGridDataProvider','egPrintStore',
function($scope, $q, $routeParams, $timeout, $window, $location, egEnv,
$filter, egIDL, egNet, egAuth, egEvent, egList, egUser,
- patronSvc , egGridDataProvider) {
+ patronSvc , egGridDataProvider , egPrintStore) {
$scope.initTab('search');
$scope.focusMe = true;
$scope.searchArgs = {};
+ egPrintStore.setItem('FOO', 'BAR').then(function() {
+ return egPrintStore.appendItem('FOO', 'BAR')
+ }).then(function() {
+ return egPrintStore.getItem('FOO')
+ }).then(function(result) {
+ console.log('LOADED FOO ' + result);
+ return egPrintStore.getKeys();
+ }).then(function(keys) {
+ console.log("we have keys " + keys);
+ return egPrintStore.removeItem('FOO');
+ }).then(function() {
+ return egPrintStore.getKeys()
+ }).then(function(keys) {
+ console.log("we have keys " + keys)
+ });
+
if (patronSvc.lastSearch) {
// populate the search form with our cached search info
angular.forEach(patronSvc.lastSearch.search, function(val, key) {