1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

fix ui issues on space creation/deletion

This commit is contained in:
Sylvain 2017-02-14 12:51:30 +01:00
parent 73a5689140
commit d8acd4c86f
3 changed files with 14 additions and 14 deletions

View File

@ -116,7 +116,7 @@ Application.Controllers.controller 'NewSpaceController', ['$scope', '$state', 'C
new SpacesController($scope, $state)
]
Application.Controllers.controller 'ShowSpaceController', ['$scope', '$state', 'spacePromise', '_t', 'dialogs', ($scope, $state, spacePromise, _t, dialogs) ->
Application.Controllers.controller 'ShowSpaceController', ['$scope', '$state', 'spacePromise', '_t', 'dialogs', 'growl', ($scope, $state, spacePromise, _t, dialogs, growl) ->
## Details of the space witch id/slug is provided in the URL
$scope.space = spacePromise
@ -147,8 +147,7 @@ Application.Controllers.controller 'ShowSpaceController', ['$scope', '$state', '
, -> # deletion confirmed
# delete the machine then redirect to the machines listing
$scope.space.$delete ->
$state.go('app.public.machines_list')
$state.go('app.public.spaces_list')
, (error)->
growl.warning(_t('space_show.the_space_cant_be_deleted_because_it_is_already_reserved_by_some_users'))
##
]
]

View File

@ -403,6 +403,16 @@ angular.module('application.router', ['ui.router']).
translations: [ 'Translations', (Translations) ->
Translations.query(['app.public.spaces_list']).$promise
]
.state 'app.admin.space_new',
url: '/spaces/new'
views:
'main@':
templateUrl: '<%= asset_path "spaces/new.html" %>'
controller: 'NewSpaceController'
resolve:
translations: [ 'Translations', (Translations) ->
Translations.query(['app.admin.space_new', 'app.shared.space']).$promise
]
.state 'app.public.space_show',
url: '/spaces/:id'
views:
@ -418,16 +428,6 @@ angular.module('application.router', ['ui.router']).
]
.state 'app.logged.space_reserve',
url: '/spaces/:id/reserve'
.state 'app.admin.space_new',
url: '/spaces/new'
views:
'main@':
templateUrl: '<%= asset_path "spaces/new.html" %>'
controller: 'NewSpaceController'
resolve:
translations: [ 'Translations', (Translations) ->
Translations.query(['app.admin.space_new', 'app.shared.space']).$promise
]
# trainings
.state 'app.public.trainings_list',

View File

@ -31,6 +31,7 @@ class API::SpacesController < API::ApiController
end
def destroy
@space = get_space
authorize @space
@space.destroy
head :no_content