LP#1640255 Hatch native messaging extension
[Evergreen.git] / Open-ILS / src / templates / staff / admin / workstation / t_print_config.tt2
1 <div class="container" id="admin-workstation-printing">
2
3   <style>
4     /* TODO: more context and move me */
5     textarea {
6       height: 400px;
7       width: 100%;
8     }
9     .tab-pane .row {
10       padding-top: 20px;
11     }
12     h2 { margin-bottom: 15px }
13       
14   </style>
15
16   <div class="row"> 
17     <div class="col-md-12">
18       <h2>[% l('Printer Settings for Remote Printing') %]</h2>
19     </div>
20   </div>
21
22   <div class="row"> 
23     <div class="col-md-12">
24       <ul class="nav nav-tabs">
25         <li ng-class="{active : context == 'default'}">
26           <a href='' ng-click="setContext('default')">[% l('Default') %]</a>
27         </li>
28         <li ng-class="{active : context == 'receipt'}">
29           <a href='' ng-click="setContext('receipt')">[% l('Receipt') %]</a>
30         </li>
31         <li ng-class="{active : context == 'label'}">
32           <a href='' ng-click="setContext('label')">[% l('Label') %]</a>
33         </li>
34         <li ng-class="{active : context == 'mail'}">
35           <a href='' ng-click="setContext('mail')">[% l('Mail') %]</a>
36         </li>
37         <li ng-class="{active : context == 'offline'}">
38           <a href='' ng-click="setContext('offline')">[% l('Offline') %]</a>
39         </li>
40         <li ng-class="{active : isTestView}" class="pull-right">
41           <a href='' ng-click="isTestView=true">[% l('Test Printing') %]</a>
42         </li>
43       </ul>
44       <div class="tab-content">
45         <div class="tab-pane active">
46
47           <!-- printer config UI -->
48           <div class="row" ng-hide="isTestView">
49             <div class="col-md-6">
50               <div class="input-group">
51                 <div class="input-group-btn" uib-dropdown>
52                   <button type="button" class="btn btn-default" uib-dropdown-toggle>
53                     [% l('Select Printer') %]
54                     <span class="caret"></span></button>
55                   <ul uib-dropdown-menu>
56                     <li ng-repeat="printer in printers">
57                       <a href='' ng-click="setPrinter(printer.name)">
58                         {{printer.name}}
59                       </a>
60                     </li>
61                   </ul>
62                 </div><!-- /btn-group -->
63                 <input ng-if="!printers[0]" type="text" 
64                   class="form-control" disabled="disabled"
65                   value="[% l('No Printers Found') %]">
66                 <input ng-if="printers[0] && !printConfig[context]" type="text" 
67                   class="form-control" disabled="disabled"
68                   value="[% l('No Printer Selected') %]">
69                 <input ng-if="printConfig[context].printer" type="text" 
70                   class="form-control" disabled="disabled"
71                   value="{{printConfig[context].printer}}">
72               </div><!-- /input-group -->
73             </div><!-- col -->
74           </div><!-- row -->
75           <div class="row" ng-hide="isTestView"> 
76             <div class="col-md-12">
77               <h2>[% l('Compiled Printer Settings') %]</h2>
78               <pre>{{printerConfString()}}</pre>
79             </div><!-- col -->
80           </div><!-- row -->
81
82           <!-- printer test UI -->
83           <div class="row" ng-show="isTestView"> 
84             <div class="col-md-10">
85               <div class="btn-group">
86                 <button type="button" 
87                   class="btn btn-default btn-lg" 
88                   ng-class="{active : contentType=='text/plain'}"
89                   ng-click="setContentType('text/plain')">[% l('Plain Text') %]</button>
90                 <button type="button" 
91                   class="btn btn-default btn-lg" 
92                   ng-class="{active : contentType=='text/html'}"
93                   ng-click="setContentType('text/html')">[% l('HTML') %]</button>
94               </div>
95             </div>
96             <div class="col-md-2">
97               <div class="input-group pull-right">
98                 <div class="input-group-btn">
99                   <button type="button" 
100                     ng-click="testPrint()"
101                     class="btn btn-default btn-success">
102                       [% l('Print') %]</button>
103                   <button type="button" 
104                     ng-click="testPrint(true)"
105                     class="btn btn-default btn-info">
106                       [% l('Print with Dialog') %]</button>
107                 </div>
108               </div>
109             </div>
110           </div>
111
112           <div class="row" ng-show="isTestView"> 
113             <div class="col-md-12">
114               <div ng-show="contentType=='text/plain'"
115 ng-init="textPrintContent='
116 [% l('Test Print') %]
117
118 1234567890
119
120 12345678901234567890
121
122 123456789012345678901234567890
123
124 1234567890123456789012345678901234567890
125
126 12345678901234567890123456789012345678901234567890
127
128 12345678901234567890123456789012345678901234567890123456790
129
130 [% l('Test Print') %]
131 '">
132         <pre><textarea>{{textPrintContent}}</textarea></pre>
133       </div>
134
135       <div ng-show="contentType=='text/html'">
136         <textarea ng-model="htmlPrintContent" 
137 ng-init="htmlPrintContent='
138 <div>
139   <style>p { color: blue }</style>
140   <h2>[% l('Test HTML Print') %]</h2>
141   <br/>
142   <img src=\'https://[% ctx.hostname %]/opac/images/main_logo.png\' width=\'140\' height=\'24\'/>
143   <p>[% l('Welcome, Stranger!') %]</p>
144   <p>{{value1}}</p>
145   <p>{{value2}}</p>
146   <p>{{date_value | date}}</p>
147 </div>
148 '">
149                 </textarea>
150               </div><!-- html content -->
151             </div><!-- col -->
152           </div><!-- row -->
153         </div><!-- tab pane -->
154       </div><!-- tab content -->
155     </div><!-- col -->
156   </div><!-- row -->
157 </div><!-- container -->
158