From d112a07246f14619c46275de0f66d3b9b3901cfd Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 28 Apr 2017 18:00:12 -0400 Subject: [PATCH] webstaff: implement chronology tab Signed-off-by: Galen Charlton --- .../staff/serials/t_prediction_wizard.tt2 | 61 ++++++++++++++++++++-- .../staff/serials/directives/prediction_wizard.js | 41 ++++++++++++--- 2 files changed, 92 insertions(+), 10 deletions(-) diff --git a/Open-ILS/src/templates/staff/serials/t_prediction_wizard.tt2 b/Open-ILS/src/templates/staff/serials/t_prediction_wizard.tt2 index 9da3b69494..67ade59754 100644 --- a/Open-ILS/src/templates/staff/serials/t_prediction_wizard.tt2 +++ b/Open-ILS/src/templates/staff/serials/t_prediction_wizard.tt2 @@ -157,15 +157,70 @@ -
+
-
-CHRON +
+
+
+
[% l('Display level descriptor? E.g., "Year: 2017, Month: Feb" (not recommended)') %]
+
+
+
+
[% l('Level [_1]', '{{$index + 1}}') %]
+
+ +
+
+ +
+
+ + +
+
+
+
+ +
+
+
+
+
[% l('Level [_1]', '{{$index + 1}}') %]
+
+ +
+
+ +
+
+
+
diff --git a/Open-ILS/web/js/ui/default/staff/serials/directives/prediction_wizard.js b/Open-ILS/web/js/ui/default/staff/serials/directives/prediction_wizard.js index 1a739c2fee..7e6a46cc8d 100644 --- a/Open-ILS/web/js/ui/default/staff/serials/directives/prediction_wizard.js +++ b/Open-ILS/web/js/ui/default/staff/serials/directives/prediction_wizard.js @@ -24,6 +24,7 @@ function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider) { this.use_enum = false; this.use_alt_enum = false; this.use_chron = false; + this.use_alt_chron = false; this.use_calendar_changes = false; this.compress_expand = '3'; this.caption_evaluation = '0'; @@ -99,18 +100,30 @@ function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider) { if (sf in chron_level_map) { this.use_chron = true; curr_chron_level = chron_level_map[sf]; - this.chron_levels[curr_chron_level] = { - caption : value + var chron = {}; + if (value.match(/^\(.*\)$/)) { + chron.display_caption = false; + chron.caption = value.replace(/^\(/, '').replace(/\)$/, ''); + } else { + chron.display_caption = true; + chron.caption = value; } + this.chron_levels[curr_chron_level] = chron; continue; } if (sf in alt_chron_level_map) { - this.use_chron = true; + this.use_alt_chron = true; curr_chron_level = -1; - curr_alt_chron_level = alt_enum_level_map[sf]; - this.alt_chron_levels[curr_alt_chron_level] = { - caption : value + curr_alt_chron_level = alt_chron_level_map[sf]; + var chron = {}; + if (value.match(/^\(.*\)$/)) { + chron.display_caption = false; + chron.caption = value.replace(/^\(/, '').replace(/\)$/, ''); + } else { + chron.display_caption = true; + chron.caption = value; } + this.alt_chron_levels[curr_alt_chron_level] = chron; continue; } @@ -219,11 +232,25 @@ function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider) { day : null }); } + + this.add_chron_level = function() { + if (self.chron_levels.length < 4) { + self.chron_levels.push({ + caption : null, + display_caption : false + }); + } + } + this.drop_chron_level = function() { + if (self.chron_levels.length > 1) { + self.chron_levels.pop(); + } + } } // TODO chron only // dummy pattern - $scope.pattern = new PredictionPattern(["3","0","8","1","a","v.","b","no.","u","6","v","r","g","sequence","i","(year)","j","(month)","w","m","x","06,12"]); + $scope.pattern = new PredictionPattern(["3","0","8","1","a","v.","b","no.","u","6","v","r","g","sequence","i","(year)","j","month","m","(day)","w","m","x","06,12"]); console.debug($scope.pattern); }] } -- 2.11.0