]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/staff/serials/t_prediction_wizard.tt2
LP#1706124: minor tweaks
[working/Evergreen.git] / Open-ILS / src / templates / staff / serials / t_prediction_wizard.tt2
1 <div>
2    <div class="pull-right">
3       <div>
4         <button class="btn btn-warning" ng-click="tab.active = tab.active - 1"
5                 ng-disabled="tab.active <= 0">
6             [% l('Back') %]
7         </button>
8         <button class="btn btn-success" ng-click="tab.active = tab.active + 1"
9                 ng-disabled="!viewOnly && ((tab.active == 0 && tab.enum_form.$invalid) || (tab.active == 1 && tab.chron_form.$invalid) || (tab.active == 3 && tab.freq_form.$invalid))"
10                 ng-if="tab.active != 4">
11             [% l('Next') %]
12         </button>
13         <button class="btn btn-primary" ng-click="handle_save()"
14                 ng-if="!viewOnly && tab.active == 4">
15             [% l('Save') %]
16         </button>
17       </div>
18   </div>
19   <uib-tabset active="tab.active">
20     <uib-tab index="0" disable="tab.active != 0" heading="[% l('Enumeration Labels') %]">
21       <form name="tab.enum_form">
22       <fieldset ng-disabled="viewOnly">
23       <div class="row">
24          <div class="radio">
25            <label>
26              <input type="radio" ng-model="pattern.use_enum" ng-value="True">
27              [% l('Use Enumeration (e.g., v.1, no. 1)') %]
28            </label>
29            <eg-help-popover help-text="[% l('Use this if the serial includes volume or some other form of numbering.') %]">
30          </div>
31          <div class="radio">
32            <label>
33               <input type="radio" ng-model="pattern.use_enum" ng-value="False">
34               [% l('Use Calendar Dates Only (e.g., April 10)') %]
35             </label>
36             <eg-help-popover help-text="[% l('Use this if serial issues are referred to only by publication dates (or months or seasons).') %]">
37          </div>
38          <div class="row" ng-if="pattern.use_enum">
39             <div class="row" ng-repeat="enum_level in pattern.enum_levels">
40                 <div class="col-md-1"></div>
41                 <div class="col-md-1">[% l('Level [_1]', '{{$index + 1}}')  %]</div>
42                 <div class="col-md-2"><input type="text" ng-model="enum_level.caption" required></div>
43                 <div ng-if="$index > 0">
44                   <div class="col-md-3">
45                     <select ng-model="enum_level.units_per_next_higher.type">
46                       <option value="number">[% l('Number') %]</option>
47                       <option value="var">[% l('Varies') %]</option>
48                       <option value="und">[% l('Undetermined') %]</option>
49                     </select>
50                     <input type="number" step="1" 
51                            ng-model="enum_level.units_per_next_higher.value"
52                            ng-hide="enum_level.units_per_next_higher.type != 'number'"
53                     >
54                   </div>
55                   <div class="col-md-2">
56                     <div class="radio">
57                       <label>
58                         <input type="radio" ng-model="enum_level.restart" ng-value="True">
59                         [% l('Restarts at unit completion') %]
60                       </label>
61                     </div>
62                     <div class="radio">
63                       <label>
64                         <input type="radio" ng-model="enum_level.restart" ng-value="False">
65                         [% l('Increments continuously') %]
66                       </label>
67                     </div>
68                   </div>
69                 </div>
70                 <div class="col-md-3" ng-if="$last">
71                   <button class="btn btn-warning btn-sm"
72                       ng-if="pattern.enum_levels.length > 1"
73                       ng-click="pattern.drop_enum_level()">
74                       [% ('Remove Level') %]
75                   </button>
76                   <button class="btn btn-warning btn-sm"
77                       ng-disabled="pattern.enum_levels.length >= 6"
78                       ng-click="pattern.add_enum_level()">
79                       [% ('Add Level') %]
80                   </button>
81                 </div>
82             </div>
83          </div>
84       </div>
85       <div ng-if="pattern.use_enum" class="row">
86         <div class="checkbox">
87           <label>
88             <input type="checkbox" ng-model="pattern.use_alt_enum">
89             [% l('Add alternative enumeration') %]
90           </label>
91           <eg-help-popover help-text="[% l('If a serials is labeled in two different ways, use this to specify the second set of enumeration labels') %]">
92          </div>
93          <div class="row" ng-if="pattern.use_alt_enum">
94             <div class="row" ng-repeat="alt_enum_level in pattern.alt_enum_levels">
95                 <div class="col-md-1"></div>
96                 <div class="col-md-1">[% l('Level [_1]', '{{$index + 1}}')  %]</div>
97                 <div class="col-md-2"><input type="text" required ng-model="alt_enum_level.caption"></div>
98                 <div ng-if="$index > 0">
99                   <div class="col-md-3">
100                     <select ng-model="alt_enum_level.units_per_next_higher.type">
101                       <option value="number">[% l('Number') %]</option>
102                       <option value="var">[% l('Varies') %]</option>
103                       <option value="und">[% l('Undetermined') %]</option>
104                     </select>
105                     <input type="number" step="1" 
106                            ng-model="alt_enum_level.units_per_next_higher.value"
107                            ng-hide="alt_enum_level.units_per_next_higher.type != 'number'"
108                     >
109                   </div>
110                   <div class="col-md-2">
111                     <div class="radio">
112                       <label>
113                         <input type="radio" ng-model="alt_enum_level.restart" ng-value="True">
114                         [% l('Restarts at unit completion') %]
115                       </label>
116                     </div>
117                     <div class="radio">
118                       <label>
119                         <input type="radio" ng-model="alt_enum_level.restart" ng-value="False">
120                         [% l('Increments continuously') %]
121                       </label>
122                     </div>
123                   </div>
124                 </div>
125                 <div class="col-md-3" ng-if="$last">
126                   <button class="btn btn-warning btn-sm"
127                       ng-if="pattern.alt_enum_levels.length > 1"
128                       ng-click="pattern.drop_alt_enum_level()">
129                       [% ('Remove Level') %]
130                   </button>
131                   <button class="btn btn-warning btn-sm" 
132                       ng-disabled="pattern.alt_enum_levels.length >= 2"
133                       ng-click="pattern.add_alt_enum_level()">
134                       [% ('Add Level') %]
135                   </button>
136                 </div>
137             </div>
138          </div>
139       </div>
140       <div ng-if="pattern.use_enum" class="row">
141         <div class="checkbox">
142           <label>
143             <input type="checkbox" ng-model="pattern.use_calendar_change">
144             [% l('First level enumeration changes during subscription year') %]
145           </label>
146           <eg-help-popover help-text="[% l('For example, if the title has two volumes a year, use this to specify the month that the next volume starts.') %]">
147          </div>
148          <div ng-if="pattern.use_calendar_change">
149          <div class="row" ng-repeat="chg in pattern.calendar_change">
150            <div class="col-md-1"></div>
151            <div class="col-md-2">
152              <label>[% l('Change occurs') %]
153                <select ng-model="chg.type">
154                  <option value="date">[% l('Specific date') %]</option>
155                  <option value="month">[% l('Start of month') %]</option>
156                  <option value="season">[% l('Start of season') %]</option>
157                </select>
158              </label>
159            </div>
160            <div class="col-md-3">
161              <eg-month-selector     ng-model="chg.month"  ng-if="chg.type == 'month'" ></eg-month-selector>
162              <eg-season-selector    ng-model="chg.season" ng-if="chg.type == 'season'"></eg-season-selector>
163              <eg-month-day-selector day="chg.day" month="chg.month" ng-if="chg.type == 'date'"  ></eg-month-day-selector>
164            </div>
165            <div class="col-md-2">
166               <button ng-click="pattern.remove_calendar_change($index)" class="btn btn-sm btn-warning">[% l('Delete') %]</button>
167               <button ng-click="pattern.add_calendar_change()" ng-hide="!$last" class="btn btn-sm btn-warning">[% l('Add more') %]</button>
168            </div>
169          </div>
170          </div>
171       </div>
172       </fieldset>
173       </form>
174     </uib-tab>
175     <uib-tab index="1" disable="tab.active != 1" heading="[% l('Chronology Display') %]">
176       <form name="tab.chron_form">
177       <fieldset ng-disabled="viewOnly">
178       <div>
179         <div class="checkbox">
180           <label>
181             <input type="checkbox" ng-model="pattern.use_chron">
182             [% l('Use Chronology Captions?') %]
183           </label>
184         </div>
185         <div  ng-if="pattern.use_chron">
186           <div class="row">
187             <div class="col-md-4"></div>
188             <div class="col-md-4">[% l('Display level descriptor? E.g., "Year: 2017, Month: Feb" (not recommended)') %]</div>
189           </div>
190           <div class="row" ng-repeat="chron in pattern.chron_levels">
191             <div class="col-md-1"></div>
192             <div class="col-md-1">[% l('Level [_1]', '{{$index + 1}}')  %]</div>
193             <div class="col-md-2">
194               <eg-chron-selector ng-model="chron.caption" required chron-level="$index" linked-selector="chron_captions">
195             </div>
196             <div class="col-md-2">
197               <input type="checkbox" ng-model="chron.display_caption"></input>
198             </div>
199             <div class="col-md-4">
200               <button ng-if="$index > 0 && $last" ng-click="pattern.drop_chron_level()" class="btn btn-sm btn-warning">
201                 [% l('Remove Level') %]
202               </button>
203               <button ng-if="$last && pattern.chron_levels.length < 4" ng-click="pattern.add_chron_level()" class="btn btn-sm btn-warning">
204                 [% l('Add Level') %]
205               </button>
206             </div>
207           </div>
208           <div>
209             <div class="checkbox">
210               <label>
211                 <input type="checkbox" ng-model="pattern.use_alt_chron">
212                 [% l('Use Alternative Chronology Captions?') %]
213               </label>
214             </div>
215             <div ng-if="pattern.use_alt_chron">
216               <div class="row" ng-repeat="chron in pattern.alt_chron_levels">
217                 <div class="col-md-1"></div>
218                 <div class="col-md-1">[% l('Level [_1]', '{{$index + 1}}')  %]</div>
219                 <div class="col-md-2">
220                   <eg-chron-selector ng-model="chron.caption" required chron-level="$index" linked-selector="alt_chron_captions">
221                 </div>
222                 <div class="col-md-2">
223                   <input type="checkbox" ng-model="chron.display_caption"></input>
224                 </div>
225               </div>
226             </div>
227           </div>
228         </div>
229       </div>
230       </fieldset>
231       </form>
232     </uib-tab>
233     <uib-tab index="2" disable="tab.active != 2" heading="[% l('MFHD Indicators') %]">
234       <form name="tab.ind_form">
235       <fieldset ng-disabled="viewOnly">
236       <div class="row">
237         <div class="col-md-6">
238           <label for="selectCompressExpand">[% l('Compression Display Options') %]
239             <eg-help-popover help-link="https://www.loc.gov/marc/holdings/hd853855.html"
240                help-text="[% l('Whether the pattern can be used to compress and expand detailed holdings statements.') %]">
241           </label>
242           <select ng-model="pattern.compress_expand">
243             <option value="0">[% l('Cannot compress or expand') %]</option>
244             <option value="1">[% l('Can compress but not expand') %]</option>
245             <option value="2">[% l('Can compress or expand') %]</option>
246             <option value="3">[% l('Unknown') %]</option>
247           </select>
248         </div>
249         <div class="col-md-6">
250           <label for="selectCompressExpand">[% l('Caption Evaluation') %]
251             <eg-help-popover help-link="https://www.loc.gov/marc/holdings/hd853855.html"
252                help-text="[% l('Completeness of the caption levels and whether the captions used actually appear on the bibliographic item.') %]">
253           </label>
254           <select ng-model="pattern.caption_evaluation">
255             <option value="0">[% l('Captions verified; all levels present') %]</option>
256             <option value="1">[% l('Captions verified; all levels may not be present') %]</option>
257             <option value="2">[% l('Captions unverified; all levels present') %]</option>
258             <option value="3">[% l('Captions unverified; all levels may not be present') %]</option>
259           </select>
260         </div>
261       </div>
262       </fieldset>
263       </form>
264     </uib-tab>
265     <uib-tab index="3" disable="tab.active != 3" heading="[% l('Frequency and Regularity') %]">
266       <form name="tab.freq_form">
267       <fieldset ng-disabled="viewOnly">
268       <div class="row">
269         <div class="col-md-2">
270           <div class="radio">
271             <label>
272               <input type="radio" ng-model="pattern.frequency_type" value="preset">
273               [% l('Pre-selected') %]
274             </label>
275           </div>
276           <div class="radio">
277             <label>
278               <input type="radio" ng-model="pattern.frequency_type" value="numeric">
279               [% l('Use number of issues per year') %]
280             </label>
281           </div>
282         </div>
283         <div class="col-md-2">
284           <div ng-if="pattern.frequency_type == 'preset'">
285             <select ng-model="pattern.frequency_preset" required>
286               <option value="d">[% l('Daily') %]</option>
287               <option value="w">[% l('Weekly (Weekly)') %]</option>
288               <option value="c">[% l('2 x per week (Semiweekly)') %]</option>
289               <option value="i">[% l('3 x per week (Three times a week)') %]</option>
290               <option value="e">[% l('Every two weeks (Biweekly)') %]</option>
291               <option value="m">[% l('Monthly') %]</option>
292               <option value="s">[% l('2 x per month (Semimonthly)') %]</option>
293               <option value="j">[% l('3 x per month (Three times a month)') %]</option>
294               <option value="b">[% l('Every other month (Bimonthly)') %]</option>
295               <option value="q">[% l('Quarterly') %]</option>
296               <option value="f">[% l('2 x per year (Semiannual)') %]</option>
297               <option value="t">[% l('3 x per year (Three times a year)') %]</option>
298               <option value="a">[% l('Yearly (Annual)') %]</option>
299               <option value="g">[% l('Every other year (Biennial)') %]</option>
300               <option value="h">[% l('Every three years (Triennial)') %]</option>
301               <option value="x">[% l('Completely irregular') %]</option>
302               <option value="k">[% l('Continuously updated') %]</option>
303             </select>
304           </div>
305           <div ng-if="pattern.frequency_type == 'numeric'">
306             <input ng-model="pattern.frequency_numeric" type="number" step="1" required>
307           </div>
308         </div>
309       </div>
310       <div class="row">
311         <div class="checkbox">
312           <label>
313             <input type="checkbox" ng-model="pattern.use_regularity">
314             [% l('Use specific regularity information?') %]
315           </label>
316             <em>[% l('(combined issues, skipped issues, etc.)') %]</em>
317          </div>
318          <div class="row" ng-if="pattern.use_regularity">
319             <div class="row pad-vert" ng-repeat="reg in pattern.regularity">
320                <div class="col-md-2">
321                  <button ng-click="pattern.remove_regularity($index)"
322                          class="btn btn-sm btn-warning">
323                    [% l('Remove Regularity') %]
324                  </button>
325                  <button ng-if="$last" ng-click="pattern.add_regularity()"
326                          class="btn btn-sm btn-warning">
327                    [% l('Add Regularity') %]
328                  </button>
329                </div>
330                <div class="col-md-1">
331                  <select ng-model="reg.regularity_type">
332                    <option value="p">[% l('Published') %]</option>
333                    <option value="o">[% l('Omitted') %]</option>
334                    <option value="c">[% l('Combined') %]</option>
335                  </select>
336                </div>
337                <div class="col-md-1">
338                  <select ng-model="reg.chron_type">
339                    <option value="d">[% l('Day') %]</option>
340                    <option value="w">[% l('Week') %]</option>
341                    <option value="m">[% l('Month') %]</option>
342                    <option value="s">[% l('Season') %]</option>
343                    <option value="y">[% l('Year') %]</option>
344                  </select>
345                </div>
346                <div class="col-md-6">
347                  <div class="row" ng-repeat="part in reg.parts">
348                    <div class="col-md-8" ng-if="reg.regularity_type == 'c'">
349                      <label>[% l('Combined issue code') %] <input type="text" ng-model="part.combined_code"></label>
350                    </div>
351                    <div class="col-md-8" ng-if="reg.regularity_type != 'c'">
352                      <div ng-if="reg.chron_type == 's'">
353                        <label>[% l('Every') %] <eg-season-selector ng-model="part.season"></eg-season-selector></label>
354                      </div>
355                      <div ng-if="reg.chron_type == 'm'">
356                        <label>[% l('Every') %] <eg-month-selector ng-model="part.month"></eg-month-selector></label>
357                      </div>
358                      <div ng-if="reg.chron_type == 'd'">
359                        <select ng-model="part.sub_type">
360                          <option value="day_of_month">[% l('On day of month') %]</option>
361                          <option value="specific_date">[% l('On specific date') %]</option>
362                          <option value="day_of_week">[% l('On day of week') %]</option>
363                        </select>
364                        <div ng-if="part.sub_type == 'day_of_month'">
365                          <input type="number" step="1" min="1" max="31" ng-model="part.day_of_month">
366                        </div>
367                        <div ng-if="part.sub_type == 'specific_date'">
368                           <eg-month-day-selector day="part.day" month="part.month"></eg-month-day-selector>
369                        </div>
370                        <div ng-if="part.sub_type == 'day_of_week'">
371                           <eg-day-of-week-selector ng-model="part.day_of_week"></eg-day-of-week-selector>
372                        </div>
373                      </div>
374                      <div ng-if="reg.chron_type == 'w'">
375                        <select ng-model="part.sub_type">
376                          <option value="week_in_month">[% l('Week and month') %]</option>
377                          <option value="week_day">[% l('Week and day') %]</option>
378                          <option value="week_day_in_month">[% l('Week, month, and day') %]</option>
379                        </select>
380                        <div ng-if="part.sub_type == 'week_in_month'">
381                          <eg-week-in-month-selector ng-model="part.week"></eg-week-in-month-selector>
382                          [% l('week in') %]
383                          <eg-month-selector ng-model="part.month"></eg-month-selector>
384                        </div>
385                        <div ng-if="part.sub_type == 'week_day'">
386                          <eg-week-in-month-selector ng-model="part.week"></eg-week-in-month-selector>
387                          [% l('week on') %]
388                          <eg-day-of-week-selector ng-model="part.day"></eg-day-of-week-selector>
389                        </div>
390                        <div ng-if="part.sub_type == 'week_day_in_month'">
391                          <eg-week-in-month-selector ng-model="part.week"></eg-week-in-month-selector>
392                          [% l('week on') %]
393                          <eg-day-of-week-selector ng-model="part.day"></eg-day-of-week-selector>
394                          [% l('in') %]
395                          <eg-month-selector ng-model="part.month"></eg-month-selector>
396                        </div>
397                      </div>
398                      <div ng-if="reg.chron_type == 'y'">
399                        <input type="number" min="1" max="9999" ng-model="part.year">
400                      </div>
401                    </div>
402                    <div class="col-md-4">
403                      <button  ng-click="pattern.remove_regularity_part(reg, $index)"
404                              class="btn btn-xs btn-warning">
405                        [% l('Remove Part') %]
406                      </button>
407                      <button ng-if="$last" ng-click="pattern.add_regularity_part(reg)"
408                              class="btn btn-xs btn-warning">
409                        [% l('Add Part') %]
410                      </button>
411                    </div>
412                  </div>
413                </div>
414             </div>
415          </div>
416       </div>
417       </fieldset>
418       </form>
419     </uib-tab>
420     <uib-tab index="4" disable="tab.active != 4" heading="[% l('Review') %]">
421       <div class="row">
422         <div class="col-md-2">
423           <span class="strong-text-2">[% l('Raw Pattern Code') %]</span>
424           <a class="pull-right" href ng-click="show_pattern_code = false"
425               title="[% l('Hide Raw Pattern Code') %]"
426               ng-show="show_pattern_code">
427               <span class="glyphicon glyphicon-resize-small"></span>
428           </a>
429           <a class="pull-right" href ng-click="show_pattern_code = true"
430               title="[% l('Show Raw Pattern Code') %]"
431               ng-hide="show_pattern_code">
432               <span class="glyphicon glyphicon-resize-full"></span>
433           </a>
434         </div>
435         <div class="col-md-6" ng-show="show_pattern_code">
436           <pre>{{pattern.compile_stringify()}}</pre>
437         </div>
438       </div>
439       <div class="row">
440         <div class="col-md-2">
441           <span class="strong-text-2">[% l('Pattern Summary') %]</span>
442         </div>
443         <div class="col-md-6">
444           <eg-prediction-pattern-summary pattern="pattern"></eg-prediction-pattern-summary>
445         </div>
446       </div>
447       <hr/>
448       <div class="row" ng-if="showShare && !viewOnly">
449         <div class="col-md-6">
450           <label for="pattern_name">[% l('Share this pattern using name') %]</label>
451           <input id="pattern_name" type="text" ng-model="share.pattern_name">
452         </div>
453         <div class="col-md-6">
454           <label for="share_depth">[% l('Share with') %]</label>
455           <eg-share-depth-selector id="share_depth" ng-model="share.depth"></eg-share-depth-selector>
456         </div>
457       </div>
458       <hr/>
459     </uib-tab>
460   </uib-tabset>
461 </div>