<div>
<eg-sub-selector bib-id="bibId" ssub-id="ssubId"></eg-sub-selector>
</div>
+
+<div>
+ <div class="row" ng-repeat="pred in predictions | orderBy: 'id' as filtered track by pred.id">
+ <ng-form name="predform" class="form-inline">
+ <div class="col-md-1"><label>[% l('ID') %] {{pred.id}}</label></div>
+ <div class="col-md-1">
+ <label class="checkbox-inline">
+ <input type="checkbox" ng-model="pred.active">[% l('Active') %]
+ </label>
+ </div>
+ <div class="col-md-2">
+ <label>[% l('Start Date') %]</label>
+ {{pred.create_date | date:"shortDate"}}
+ </div>
+ <div class="col-md-3">
+ <label>[% l('Type') %]</label>
+ <select ng-model="pred.type">
+ <option value="basic">[% l('Basic') %]</option>
+ <option value="supplement">[% l('Supplement') %]</option>
+ <option value="index">[% l('Index') %]</option>
+ </select>
+ <button class="btn btn-default">[% l('Edit Pattern') %]</button>
+ </div>
+ <div>
+ <button class="btn btn-primary" ng-disabled="!predform.$dirty">[% l('Save') %]</button>
+ </div>
+ </form>
+ </div>
+</div>
'$uibModal',
function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider ,
$uibModal) {
+
+ egSerialsCoreSvc.fetch($scope.bibId).then(function() {
+ reload($scope.ssubId);
+ });
+
+ function reload(ssubId) {
+ var ssub = egSerialsCoreSvc.get_ssub(ssubId);
+ $scope.predictions = egCore.idl.toTypedHash(ssub.scaps());
+ }
+
+ $scope.$watch('ssubId', function(newVal, oldVal) {
+ if (newVal && newVal != oldVal) reload(newVal);
+ });
+
}]
}
})