LP1716473 A few tweaks to correct field labels
[Evergreen.git] / Open-ILS / src / templates / staff / cat / volcopy / t_attr_edit.tt2
1 <style type="text/css">
2   .css-form input.ng-invalid {
3     background-color: #FA787E;
4   }
5   .css-form select.ng-invalid {
6     background-color: #FA787E;
7   }
8
9   ul.copy-attributes-grid {
10     list-style: none;
11     display: flex;
12     flex-wrap: wrap;
13     padding-inline-start: 0px;
14   }
15
16   ul.copy-attributes-grid > li {
17     padding: 5px;
18     margin: 5px;
19     /* Force the grid to overflow to the next line every 4 entries
20       while leaving some wiggle space for padding/margins */
21     flex-basis: 24%;
22     display: flex;
23     flex-direction: column;
24   }
25
26   ul.copy-attributes-grid > li > div {
27     flex: 1;
28     /* padding here is required to allow the "item modified" bg
29         color to appear around some widgets (mainly selectors) */
30     padding: 6px;
31   }
32
33   ul.copy-attributes-grid > li > div:nth-child(1) {
34     border-radius: 6px 6px 0px 0px;
35   }
36
37   ul.copy-attributes-grid > li > div:nth-child(2) {
38     border: 1px solid #d9edf7;
39   }
40
41   ul.copy-attributes-grid li label {
42     font-weight: bold;
43     padding-left: 5px;
44   }
45 </style>
46
47 <div>
48   <form novalidate class="css-form" name="forms.myForm">
49   <div class="row bg-info">
50     <div class="col-md-1">
51       <h5>[% l('Template') %]</h5>
52     </div>
53     <div ng-class="template_controls ? 'col-md-2' : 'col-md-5'">
54       <eg-basic-combo-box list="template_name_list" selected="template_name"></eg-basic-combo-box>
55     </div>
56     <div class="col-md-1">
57       <button class="btn btn-default " ng-click="applyTemplate(template_name)" type="button">[% l('Apply') %]</button>
58     </div>
59     <div class="col-md-6" ng-show="template_controls">
60       <div class="row">
61         <div class="col-md-4">
62           <div class="btn-group">
63             <label class="btn btn-default" ng-click="saveTemplate(template_name)">[% l('Save') %]</label>
64             <label class="btn btn-default" ng-click="deleteTemplate(template_name)">[% l('Delete') %]</label>
65           </div>
66         </div>
67         <div class="col-md-8">
68           <div class="btn-group pull-right">
69             <span class="btn btn-default btn-file">
70               [% l('Import') %]
71               <input type="file" eg-file-reader container="imported_templates.data">
72             </span>
73             <label class="btn btn-default"
74               eg-json-exporter container="templates"
75               default-file-name="'[% l('exported_copy_templates.json') %]'">
76               [% l('Export') %]
77             </label>
78           </div>
79         </div>
80       </div>
81     </div>
82     <div class="col-md-2" ng-class="{'col-md-offset-3' : !template_controls}">
83       <button class="btn btn-default pull-right" ng-click="clearWorking()" type="button">[% l('Clear') %]</button>
84     </div>
85   </div>
86
87   <div class="row pad-vert" ng-if="template_controls && defaults.show_vol_template_controls">
88     <div class="row">
89       <div class="col-xs-12">
90         <h4 class="center-block">[% l('Call Number Attributes') %]</h4>
91       </div>
92     </div>
93   </div>
94
95   <div class="row pad-vert" ng-if="template_controls && defaults.show_vol_template_controls">
96     <div class="col-md-1 bg-info">
97       <b>[% l('Classification') %]</b>
98     </div>
99     <div class="nullable col-md-2" ng-class="{'bg-success': working.callnumber.classification !== undefined}">
100       <select class="form-control" ng-model="working.callnumber.classification" ng-options="cl.id() as cl.name() for cl in classification_list">
101         <option value="">[% l('&lt;NONE&gt;') %]</option>
102       </select>
103     </div>
104     <div class="col-md-1 bg-info">
105       <b>[% l('Prefix') %]</b>
106     </div>
107     <div class="nullable col-xs-2" ng-class="{'bg-success': working.callnumber.prefix !== undefined}">
108       <select class="form-control" ng-model="working.callnumber.prefix" ng-options="p.id() as p.label() for p in prefix_list">
109         <option value="">[% l('&lt;NONE&gt;') %]</option>
110       </select>
111     </div>
112     <div class="col-md-1 bg-info">
113       <b>[% l('Suffix') %]</b>
114     </div>
115     <div class="nullable col-md-2" ng-class="{'bg-success': working.callnumber.suffix !== undefined}">
116       <select class="form-control" ng-model="working.callnumber.suffix" ng-options="s.id() as s.label() for s in suffix_list">
117         <option value="">[% l('&lt;NONE&gt;') %]</option>
118       </select>
119     </div>
120   </div>
121
122   <div class="row pad-vert" ng-if="template_controls && defaults.show_vol_template_controls">
123     <div class="row">
124       <div class="col-xs-12">
125         <h4 class="center-block">[% l('Item Attributes') %]</h4>
126       </div>
127     </div>
128   </div>
129
130   <ul class="copy-attributes-grid">
131     <li ng-if="defaults.attributes.circulate">
132       <div class="bg-info"><label>[% l('Circulate?') %]</label></div>
133       <div ng-class="{'bg-success': working.circulate !== undefined}">
134         <div class="col-lg-6">
135           <label>
136             <input type="radio" ng-model="working.circulate" value="t"/>
137             [% l('Yes') %]
138           </label>
139         </div>
140         <div class="col-lg-6">
141           <label>
142             <input type="radio" ng-model="working.circulate" value="f"/>
143             [% l('No') %]
144           </label>
145         </div>
146       </div>
147       <!-- this dummy div ensures each <li> has exactly 3 vertical 
148           flex divs, ensuring consistent widget/label height -->
149       <div ng-if="hasMulti()"> </div>
150     </li>
151     <li ng-if="defaults.attributes.status">
152       <div class="bg-info"><label>[% l('Status') %]</label></div>
153       <div ng-class="{'bg-success': working.status !== undefined}">
154         <select class="form-control" ng-model="working.status"
155           ng-options="s.id() as s.name() disable when magic_status_list.indexOf(s.id(),0) > -1 for s in status_list">
156         </select>
157       </div>
158       <div ng-if="hasMulti()">
159         <div ng-if="working.MultiMap.status.length > 1 && working.status === undefined">
160           <eg-list-counts label="[% l('Multiple statuses') %]"
161             list="working.MultiMap.status" render="statusName"
162             on-select="select_by_status">
163           </eg-list-counts>
164         </div>
165       </div>
166     </li>
167     <li ng-if="defaults.attributes.circ_lib">
168       <div class="bg-info"><label>[% l('Circulating Library') %]</label></div>
169       <div ng-class="{'bg-success': working.circ_lib !== undefined}">
170         <eg-org-selector
171           alldisabled="{{!defaults.attributes.circ_lib}}"
172           selected="working.circ_lib"
173           noDefault
174           label="[% l('(Unset)') %]"
175           disable-test="cant_have_vols">
176         </eg-org-selector>
177       </div>
178       <div ng-if="hasMulti()">
179         <div 
180           ng-if="working.MultiMap.circ_lib.length > 1 && working.circ_lib === undefined">
181           <eg-list-counts label="[% l('Multiple values') %]"
182             list="working.MultiMap.circ_lib" render="orgShortname"
183             on-select="select_by_circ_lib">
184           </eg-list-counts>
185         </div>
186       </div>
187     </li>
188     <li ng-if="defaults.attributes.ref">
189       <div class="bg-info"><label>[% l('Reference?') %]</label></div>
190       <div ng-class="{'bg-success': working.ref !== undefined}">
191         <div class="col-lg-6">
192           <label>
193             <input type="radio" ng-model="working.ref" value="t"/>
194             [% l('Yes') %]
195           </label>
196         </div>
197         <div class="col-lg-6">
198           <label>
199           <input type="radio" ng-model="working.ref" value="f"/>
200             [% l('No') %]
201           </label>
202         </div>
203       </div>
204       <div ng-if="hasMulti()">
205         <div 
206           ng-if="working.MultiMap.ref.length > 1 && working.ref === undefined">
207           <eg-list-counts label="[% l('Multiple values') %]"
208             list="working.MultiMap.ref" render="labelYesNo" on-select="select_by_ref">
209           </eg-list-counts>
210         </div>
211       </div>
212     </li>
213     <li ng-if="defaults.attributes.location">
214       <div class="bg-info"><label>[% l('Shelving Location') %]</label></div>
215       <div ng-class="{'bg-success': working.location !== undefined}">
216         <select class="form-control" ng-model="working.location"
217           ng-options="l.id() as i18n.ou_qualified_location_name(l) for l in location_list">
218         </select>
219       </div>
220       <div ng-if="hasMulti()">
221         <div 
222           ng-if="working.MultiMap.location.length > 1 && working.location === undefined">
223           <eg-list-counts label="[% l('Multiple locations') %]"
224             list="working.MultiMap.location" render="locationName"
225             on-select="select_by_location"></eg-list-counts>
226         </div>
227       </div>
228     </li>
229     <li ng-if="defaults.attributes.opac_visible">
230       <div class="bg-info"><label>[% l('OPAC Visible?') %]</label></div>
231       <div ng-class="{'bg-success': working.opac_visible !== undefined}">
232         <div class="col-lg-6">
233           <label>
234             <input type="radio" ng-model="working.opac_visible" value="t"/>
235             [% l('Yes') %]
236           </label>
237         </div>
238         <div class="col-lg-6">
239           <label>
240             <input type="radio" ng-model="working.opac_visible" value="f"/>
241             [% l('No') %]
242           </label>
243         </div>
244       </div>
245       <div ng-if="hasMulti()">
246         <div
247           ng-if="working.MultiMap.opac_visible.length > 1 && working.opac_visible === undefined">
248           <eg-list-counts label="[% l('Multiple values') %]" 
249             list="working.MultiMap.opac_visible" render="labelYesNo" 
250             on-select="select_by_opac_visible"></eg-list-counts>
251         </div>
252       </div>
253     </li>
254     <li ng-if="defaults.attributes.circ_modifier">
255       <div class="bg-info"><label>[% l('Circulation Modifier') %]</label></div>
256       <div ng-class="{'bg-success': working.circ_modifier !== undefined}">
257         <select class="form-control"
258           ng-model="working.circ_modifier"
259           ng-options="m.code() as m.name() for m in circ_modifier_list | orderBy: 'name()'">
260           <option value="">[% l('&lt;NONE&gt;') %]</option>
261         </select>
262       </div>
263       <div ng-if="hasMulti()">
264         <div ng-if="working.MultiMap.circ_modifier.length > 1 && working.circ_modifier === undefined">
265           <eg-list-counts label="[% l('Multiple values') %]" 
266             list="working.MultiMap.circ_modifier" render="labelYesNo" 
267             on-select="select_by_circ_modifier"></eg-list-counts>
268         </div>
269       </div>
270     </li>
271     <li ng-if="defaults.attributes.price">
272       <div class="bg-info"><label>[% l('Price') %]</label></div>
273       <div ng-class="{'bg-success': working.price !== undefined}">
274         <input class="form-control" str-to-float ng-model="working.price" 
275           type="number" step="0.01"/>
276       </div>
277       <div ng-if="hasMulti()">
278         <div ng-if="working.MultiMap.price.length > 1 && working.price === undefined">
279           <eg-list-counts label="[% l('Multiple prices') %]" 
280             list="working.MultiMap.price" on-select="select_by_price">
281           </eg-list-counts>
282         </div>
283       </div>
284     </li>
285     <li ng-if="defaults.attributes.loan_duration">
286       <div class="bg-info"><label>[% l('Loan Duration') %]</label></div>
287       <div ng-class="{'bg-success': working.loan_duration !== undefined}">
288         <select class="form-control" int-to-str ng-model="working.loan_duration">
289           <option value="1">[% l('Short') %]</option>
290           <option value="2" selected>[% l('Normal') %]</option>
291           <option value="3">[% l('Extended') %]</option>
292         </select>
293       </div>
294       <div ng-if="hasMulti()">
295         <div ng-show="working.MultiMap.loan_duration.length > 1 && working.loan_duration === undefined">
296           <eg-list-counts label="[% l('Multiple durations') %]" 
297             list="working.MultiMap.loan_duration" render="durationLabel" 
298             on-select="select_by_loan_duration"></eg-list-counts>
299         </div>
300       </div>
301     </li>
302     <li ng-if="defaults.attributes.cost">
303       <div class="bg-info"><label>[% l('Acquisitions Cost') %]</label></div>
304       <div ng-class="{'bg-success': working.cost !== undefined}">
305         <input class="form-control" str-to-float ng-model="working.cost" 
306           type="number" step="0.01"/>
307       </div>
308       <div ng-if="hasMulti()">
309         <div ng-if="working.MultiMap.cost.length > 1 && working.cost === undefined">
310           <eg-list-counts label="[% l('Multiple costs') %]" 
311             list="working.MultiMap.cost" on-select="select_by_cost">
312           </eg-list-counts>
313         </div>
314       </div>
315     </li>
316     <li ng-if="defaults.attributes.circ_as_type">
317       <div class="bg-info"><label>[% l('Circulate as Type') %]</label></div>
318       <div ng-class="{'bg-success': working.circ_as_type !== undefined}">
319         <select class="form-control" ng-model="working.circ_as_type"
320           ng-options="t.code() as t.value() for t in circ_type_list">
321           <option value="">[% l('&lt;NONE&gt;') %]</option>
322         </select>
323       </div>
324       <div ng-if="hasMulti()">
325         <div ng-if="working.MultiMap.circ_as_type.length > 1 && working.circ_as_type === undefined">
326           <eg-list-counts label="[% l('Multiple types') %]" 
327             list="working.MultiMap.circ_as_type" render="circTypeValue" 
328             on-select="select_by_circ_as_type">
329           </eg-list-counts>
330         </div>
331       </div>
332     </li>
333     <li ng-if="defaults.attributes.holdable">
334       <div class="bg-info"><label>[% l('Holdable?') %]</label></div>
335       <div ng-class="{'bg-success': working.holdable !== undefined}">
336         <div class="col-lg-6">
337           <label>
338             <input type="radio" ng-model="working.holdable" value="t"/>
339             [% l('Yes') %]
340           </label>
341         </div>
342         <div class="col-lg-6">
343           <label>
344             <input type="radio" ng-model="working.holdable" value="f"/>
345             [% l('No') %]
346           </label>
347         </div>
348       </div>
349       <div ng-if="hasMulti()">
350         <div ng-show="working.MultiMap.holdable.length > 1 && working.holdable === undefined">
351           <eg-list-counts label="[% l('Multiple values') %]" 
352             list="working.MultiMap.holdable" render="labelYesNo" 
353             on-select="select_by_holdable"></eg-list-counts>
354         </div>
355       </div>
356     </li>
357     <li ng-if="defaults.attributes.deposit">
358       <div class="bg-info"><label>[% l('Deposit?') %]</label></div>
359       <div ng-class="{'bg-success': working.deposit !== undefined}">
360         <div class="col-lg-6">
361           <label>
362             <input type="radio" ng-model="working.deposit" value="t"/>
363             [% l('Yes') %]
364           </label>
365         </div>
366         <div class="col-lg-6">
367           <label>
368             <input type="radio" ng-model="working.deposit" value="f"/>
369             [% l('No') %]
370           </label>
371         </div>
372       </div>
373       <div ng-if="hasMulti()">
374         <div ng-if="working.MultiMap.deposit.length > 1 && working.deposit === undefined">
375           <eg-list-counts label="[% l('Multiple values') %]" 
376             list="working.MultiMap.deposit" render="labelYesNo" 
377             on-select="select_by_deposit"></eg-list-counts>
378         </div>
379       </div>
380     </li>
381     <li ng-if="defaults.attributes.deposit_amount">
382       <div class="bg-info"><label>[% l('Deposit Amount') %]</label></div>
383       <div ng-class="{'bg-success': working.deposit_amount !== undefined}">
384         <input class="form-control" str-to-float 
385           ng-model="working.deposit_amount" type="number" step="0.01"/>
386       </div>
387       <div ng-if="hasMulti()">
388         <div ng-if="working.MultiMap.deposit_amount.length > 1 && working.deposit_amount === undefined">
389           <eg-list-counts label="[% l('Multiple amounts') %]" 
390             list="working.MultiMap.deposit_amount" 
391             on-select="select_by_deposit_amount"></eg-list-counts>
392         </div>
393       </div>
394     </li>
395     <li ng-if="defaults.attributes.age_protect">
396       <div class="bg-info"><label>[% l('Age-based Hold Protection') %]</label></div>
397       <div ng-class="{'bg-success': working.age_protect !== undefined}">
398         <select class="form-control"
399           ng-model="working.age_protect"
400           ng-options="a.id() as a.name() for a in age_protect_list">
401           <option value="">[% l('&lt;NONE&gt;') %]</option>
402         </select>
403       </div>
404       <div ng-if="hasMulti()">
405         <div ng-if="working.MultiMap.age_protect.length > 1 && working.age_protect === undefined">
406           <eg-list-counts label="[% l('Multiple values') %]" 
407             list="working.MultiMap.age_protect" render="ageprotectName" 
408             on-select="select_by_age_protect"></eg-list-counts>
409         </div>
410       </div>
411     </li>
412     <li ng-if="defaults.attributes.mint_condition">
413       <div class="bg-info"><label>[% l('Quality') %]</label></div>
414       <div ng-class="{'bg-success': working.mint_condition !== undefined}">
415         <div class="col-lg-6">
416           <label>
417             <input type="radio" ng-model="working.mint_condition" value="t"/>
418             [% l('Good') %]
419           </label>
420         </div>
421         <div class="col-lg-6">
422           <label>
423             <input type="radio"ng-model="working.mint_condition" value="f"/>
424             [% l('Damaged') %]
425           </label>
426         </div>
427       </div>
428       <div ng-if="hasMulti()">
429         <div ng-if="working.MultiMap.mint_condition.length > 1 && working.mint_condition === undefined">
430           <eg-list-counts label="[% l('Multiple values') %]" 
431             list="working.MultiMap.mint_condition" render="labelYesNo" 
432             on-select="select_by_mint_condition"></eg-list-counts>
433         </div>
434       </div>
435     </li>
436     <li ng-if="defaults.attributes.fine_level">
437       <div class="bg-info"><label>[% l('Fine Level') %]</label></div>
438       <div ng-class="{'bg-success': working.fine_level !== undefined}">
439         <select class="form-control" int-to-str ng-model="working.fine_level">
440           <option value="1">[% l('Low') %]</option>
441           <option value="2" selected>[% l('Normal') %]</option>
442           <option value="3">[% l('High') %]</option>
443         </select>
444       </div>
445       <div ng-if="hasMulti()">
446         <div ng-if="working.MultiMap.fine_level.length > 1 && working.fine_level === undefined">
447           <eg-list-counts label="[% l('Multiple levels') %]" 
448             list="working.MultiMap.fine_level" render="fineLabel" 
449             on-select="select_by_fine_level"></eg-list-counts>
450         </div>
451       </div>
452     </li>
453     <li ng-if="defaults.copy_notes">
454       <div class="bg-info"><label>[% l('Item Notes') %]</label></div>
455       <div ng-class="{'bg-success': working.copy_notes !== undefined}">
456         <button class="btn btn-default" type="button"
457           ng-click="copy_notes_dialog(workingGridControls.selectedItems())">
458           [% l('Item Notes') %]
459         </button>
460       </div>
461       <div ng-if="hasMulti()"> </div>
462     </li>
463     <li ng-if="defaults.attributes.alerts">
464       <div class="bg-info"><label>[% l('Item Alerts') %]</label></div>
465       <div ng-class="{'bg-success': working.alerts !== undefined}">
466         <button class="btn btn-default" type="button"
467           ng-click="copy_alerts_dialog(workingGridControls.selectedItems())">
468           [% l('Item Alerts') %]
469         </button>
470       </div>
471       <div ng-if="hasMulti()"> </div>
472     </li>
473     <li ng-if="defaults.attributes.floating">
474       <div class="bg-info"><label>[% l('Floating') %]</label></div>
475       <div ng-class="{'bg-success': working.floating !== undefined}">
476         <select class="form-control" ng-model="working.floating"
477           ng-options="a.id() as a.name() for a in floating_list">
478           <option value="">[% l('&lt;NONE&gt;') %]</option>
479         </select>
480       </div>
481       <div ng-if="hasMulti()">
482         <div ng-if="working.MultiMap.floating.length > 1 && working.floating === undefined">
483           <eg-list-counts label="[% l('Multiple values') %]" 
484             list="working.MultiMap.floating" render="floatingName" 
485             on-select="select_by_floating"></eg-list-counts>
486         </div>
487       </div>
488     </li>
489     <li ng-if="defaults.copy_tags">
490       <div class="bg-info"><label>[% l('Item Tags') %]</label></div>
491       <div ng-class="{'bg-success': working.copy_tags !== undefined}">
492         <button
493           class="btn btn-default"
494           ng-click="copy_tags_dialog(workingGridControls.selectedItems())"
495           type="button">
496           [% l('View/Edit Item Tags') %]
497         </button>
498       </div>
499       <div ng-if="hasMulti()"> </div>
500     </li>
501     <li ng-if="defaults.statcats">
502       <div class="bg-info"><label>[% l('Statistical Categories') %]</label></div>
503       <div>
504         <select class="form-control" ng-disabled="!defaults.statcats"
505           ng-model="working.statcat_filter"
506           ng-options="o.id() as o.shortname() for o in statcat_filter_list">
507           <option value="">[% l('Filter by Library') %]</option>
508         </select>
509       </div>
510       <div ng-if="hasMulti()"> </div>
511     </li>
512
513     <li ng-repeat="sc in statcats" ng-if="statcat_visible(sc.owner().id())">
514       <div class="bg-info"><label>{{sc.owner().name() }} : {{ sc.name()}}</label></div>
515       <div ng-class="{'bg-success': working.statcats[sc.id()] !== undefined}">
516         <select class="form-control" ng-disabled="!defaults.statcats"
517           ng-change="statcatUpdate(sc.id())"
518           ng-model="working.statcats[sc.id()]"
519           ng-options="e.id() as e.value() for e in sc.entries()"
520           ng-required="sc.required() == 't' && !working.statcats_multi[sc.id()]">
521           <option value="">
522             {{ !working.statcats_multi[sc.id()] ? '[% l('&lt;NONE&gt;') %]' : '[% l('&lt;MULTIPLE&gt;') %]' }}
523           </option>
524         </select>
525       </div>
526       <div ng-if="hasMulti()"> </div>
527     </li>
528   </ul>
529 </div>
530 </form></div>