Skip to content
This repository was archived by the owner on Mar 29, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions minion/frontend/static/js/minion/admin/plans.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,19 @@ minionAdminPlansModule.controller("AdminPlansController", function($scope, $rout
});
};

$scope.deletePlan = function(plan) {
var title = 'Delete all from Plan';
var msg = 'Are you sure you want to delete everything relating ' + plan.name + ' plan? ';
msg += 'Warning this will delete every reference to the plan and existing results';
var btns = [{result:false, label: 'Cancel'}, {result:true, label: 'OK', cssClass: 'btn-primary'}];
$dialog.messageBox(title, msg, btns).open().then(function(result) {
if (result) {
$http.delete('/api/admin/plans/' + plan.name).success(function(response) {
reload();
});
}
});
};
$scope.$on('$viewContentLoaded', function() {
reload();
});
Expand Down
2 changes: 1 addition & 1 deletion minion/frontend/static/partials/admin/plans/plans.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h2>Plans</h2><span class="pull-right">
<td>{{plan.description}}</td>
<td>
<a ng-click="editPlan(plan)" class="btn btn-mini">Edit</a>
<a ng-click="removePlan(plan)" class="btn btn-mini">Remove</a>
<a ng-click="deletePlan(plan)" class="btn btn-mini">Delete</a>
</td>
</tr>
</table>
Expand Down