<button class="btn btn-default" ng-click="openPatternEditorDialog(pred)">[% l('Edit Pattern') %]</button>
</div>
<div>
+ <button type="submit" class="btn btn-default" ng-click="deleteScap(pred)">[% l('Delete') %]</button>
<button type="submit" class="btn btn-primary" ng-disabled="!pred.predform.$dirty" ng-click="updateScap(pred)">[% l('Save') %]</button>
</div>
</form>
});
});
}
+ $scope.deleteScap = function(pred) {
+ var scap = egCore.idl.fromTypedHash(pred);
+ // TODO ask to confirm
+ // TODO check whether there are linked issuances
+ egCore.pcrud.remove(scap).then(function() {
+ // completely reset the model in order to reset the
+ // forms; causes a blink, alas
+ $scope.predictions = [];
+ egSerialsCoreSvc.fetch($scope.bibId).then(function() {
+ reload($scope.ssubId);
+ });
+ });
+ }
$scope.startNewScap = function() {
$scope.new_prediction = egCore.idl.toTypedHash(new egCore.idl.scap());