webstaff serials: pattern wizard shows 'share as' widgets conditionally
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 5 Jul 2017 19:35:00 +0000 (15:35 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Wed, 5 Jul 2017 19:35:00 +0000 (15:35 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/templates/staff/serials/t_pattern_editor_dialog.tt2
Open-ILS/src/templates/staff/serials/t_prediction_wizard.tt2
Open-ILS/web/js/ui/default/staff/admin/serials/pattern_template.js
Open-ILS/web/js/ui/default/staff/serials/directives/prediction_wizard.js

index a42db74..d34f5a0 100644 (file)
@@ -7,7 +7,9 @@
   </div>
   <div class="modal-body">
     <div class="container-fluid">
-      <eg-prediction-wizard pattern-code="patternCode" on-save="ok"></eg-prediction-wizard pattern-code>
+      <eg-prediction-wizard pattern-code="patternCode" on-save="ok"
+                            show-share="showShare"
+      ></eg-prediction-wizard pattern-code>
    </div>
  </div>
 </div> <!-- modal-content -->
index df52a2c..78c2ac7 100644 (file)
         </div>
       </div>
       <hr/>
-      <div class="row">
+      <div class="row" ng-if="showShare">
         <div class="col-md-6">
           <label for="pattern_name">[% l('Share this pattern using name') %]</label>
           <input id="pattern_name" type="text" ng-model="share.pattern_name">
index 3b9c528..603ecc3 100644 (file)
@@ -42,6 +42,7 @@ function($scope , $q , $timeout , $location , $window , $uibModal , egCore , egG
                             controller:
                                 ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) {
                                 $scope.focusMe = true;
+                                $scope.showShare = false;
                                 $scope.patternCode = pred.pattern_code;
                                 $scope.ok = function(patternCode) { $uibModalInstance.close(patternCode) }
                                 $scope.cancel = function () { $uibModalInstance.dismiss() }
index 78e1e5f..ff6002b 100644 (file)
@@ -6,7 +6,8 @@ angular.module('egSerialsAppDep')
         restrict:   'E',
         scope: {
             patternCode : '=',
-            onSave      : '='
+            onSave      : '=',
+            showShare   : '='
         },
         templateUrl: './serials/t_prediction_wizard',
         controller:
@@ -14,6 +15,10 @@ angular.module('egSerialsAppDep')
 function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider) {
 
     $scope.tab = { active : 0 };
+    if (angular.isUndefined($scope.showShare)) {
+        $scope.showShare = true;
+    }
+
     // for use by ng-value
     $scope.True = true;
     $scope.False = false;