Fix Deleting playbooks

- Update Screenshot
This commit is contained in:
Matej Kramny 2015-01-30 15:51:14 +00:00
parent dc2dac98ad
commit fdf0d4d616
3 changed files with 8 additions and 13 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 254 KiB

View File

@ -2,8 +2,8 @@ define([
'app',
'services/playbooks'
], function(app) {
app.registerController('PlaybookCtrl', ['$scope', '$state', 'playbooks', function($scope, $state, playbooks) {
console.log($scope.playbook);
app.registerController('PlaybookCtrl', ['$scope', '$state', 'playbooks', 'playbook', function($scope, $state, playbooks, playbook) {
$scope.playbook = playbook;
$scope.delete = function () {
$scope.playbook.delete();

View File

@ -27,11 +27,13 @@ define([
.state('playbook', {
abstract: true,
url: '/playbook/:playbook_id',
controller: 'PlaybookCtrl',
templateUrl: '/view/playbook/view',
controller: ['$scope', 'playbook', function ($scope, playbook) {
$scope.playbook = playbook;
}],
resolve: {
dummy: $couchPotatoProvider.resolve(['controllers/playbook/playbook',
'controllers/host/hosts',
'controllers/job/jobs',
'controllers/task/tasks']),
playbook: function (Playbook, $stateParams, $q, $state) {
var deferred = $q.defer();
@ -50,14 +52,7 @@ define([
})
.state('playbook.view', {
url: '/',
controller: 'PlaybookCtrl',
resolve: {
dummy: $couchPotatoProvider.resolve(['controllers/playbook/playbook',
'controllers/host/hosts',
'controllers/job/jobs',
'controllers/task/tasks'])
},
url: '',
views: {
tasks: {
templateUrl: '/view/task/tasks',