mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-22 16:54:15 +01:00
space edition interface
This commit is contained in:
parent
d8acd4c86f
commit
0adb9e29c6
@ -116,6 +116,26 @@ Application.Controllers.controller 'NewSpaceController', ['$scope', '$state', 'C
|
|||||||
new SpacesController($scope, $state)
|
new SpacesController($scope, $state)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
##
|
||||||
|
# Controller used in the space edition page (admin)
|
||||||
|
##
|
||||||
|
Application.Controllers.controller 'EditSpaceController', ['$scope', '$state', '$stateParams', 'spacePromise', 'CSRF',($scope, $state, $stateParams, spacePromise, CSRF) ->
|
||||||
|
CSRF.setMetaTags()
|
||||||
|
|
||||||
|
## API URL where the form will be posted
|
||||||
|
$scope.actionUrl = "/api/spaces/" + $stateParams.id
|
||||||
|
|
||||||
|
## Form action on the above URL
|
||||||
|
$scope.method = "put"
|
||||||
|
|
||||||
|
## space to modify
|
||||||
|
$scope.space = spacePromise
|
||||||
|
|
||||||
|
## Using the SpacesController
|
||||||
|
new SpacesController($scope, $state)
|
||||||
|
]
|
||||||
|
|
||||||
Application.Controllers.controller 'ShowSpaceController', ['$scope', '$state', 'spacePromise', '_t', 'dialogs', 'growl', ($scope, $state, spacePromise, _t, dialogs, growl) ->
|
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
|
## Details of the space witch id/slug is provided in the URL
|
||||||
|
@ -426,6 +426,19 @@ angular.module('application.router', ['ui.router']).
|
|||||||
translations: [ 'Translations', (Translations) ->
|
translations: [ 'Translations', (Translations) ->
|
||||||
Translations.query(['app.public.space_show']).$promise
|
Translations.query(['app.public.space_show']).$promise
|
||||||
]
|
]
|
||||||
|
.state 'app.admin.space_edit',
|
||||||
|
url: '/spaces/:id/edit'
|
||||||
|
views:
|
||||||
|
'main@':
|
||||||
|
templateUrl: '<%= asset_path "spaces/edit.html" %>'
|
||||||
|
controller: 'EditSpaceController'
|
||||||
|
resolve:
|
||||||
|
spacePromise: ['Space', '$stateParams', (Space, $stateParams)->
|
||||||
|
Space.get(id: $stateParams.id).$promise
|
||||||
|
]
|
||||||
|
translations: [ 'Translations', (Translations) ->
|
||||||
|
Translations.query(['app.admin.space_edit', 'app.shared.space']).$promise
|
||||||
|
]
|
||||||
.state 'app.logged.space_reserve',
|
.state 'app.logged.space_reserve',
|
||||||
url: '/spaces/:id/reserve'
|
url: '/spaces/:id/reserve'
|
||||||
|
|
||||||
|
@ -1,17 +1,3 @@
|
|||||||
<form role="form"
|
|
||||||
name="spaceForm"
|
|
||||||
class="form-horizontal"
|
|
||||||
action="{{ actionUrl }}"
|
|
||||||
ng-upload="submited(content)"
|
|
||||||
upload-options-enable-rails-csrf="true"
|
|
||||||
unsaved-warning-form
|
|
||||||
novalidate>
|
|
||||||
|
|
||||||
<input name="_method" type="hidden" ng-value="method">
|
|
||||||
|
|
||||||
<section class="panel panel-default bg-light m-lg">
|
|
||||||
<div class="panel-body m-r">
|
|
||||||
|
|
||||||
<uib-alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)">{{alert.msg}}</uib-alert>
|
<uib-alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)">{{alert.msg}}</uib-alert>
|
||||||
|
|
||||||
<div class="form-group m-b-lg" ng-class="{'has-error': spaceForm['space[name]'].$dirty && spaceForm['space[name]'].$invalid}">
|
<div class="form-group m-b-lg" ng-class="{'has-error': spaceForm['space[name]'].$dirty && spaceForm['space[name]'].$invalid}">
|
||||||
@ -121,14 +107,3 @@
|
|||||||
<a class="btn btn-default" ng-click="addFile()" role="button"> {{ 'space.add_an_attachment' | translate }} <i class="fa fa-file-o fa-fw"></i></a>
|
<a class="btn btn-default" ng-click="addFile()" role="button"> {{ 'space.add_an_attachment' | translate }} <i class="fa fa-file-o fa-fw"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div> <!-- ./panel-body -->
|
|
||||||
|
|
||||||
<div class="panel-footer no-padder">
|
|
||||||
<input type="submit"
|
|
||||||
value="{{ 'space.add_this_space' | translate }}"
|
|
||||||
class="r-b btn-valid btn btn-warning btn-block p-lg btn-lg text-u-c"
|
|
||||||
ng-disabled="spaceForm.$invalid"/>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</form>
|
|
||||||
|
50
app/assets/templates/spaces/edit.html.erb
Normal file
50
app/assets/templates/spaces/edit.html.erb
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<section class="heading b-b">
|
||||||
|
<div class="row no-gutter">
|
||||||
|
<div class="col-md-1 hidden-xs">
|
||||||
|
<section class="heading-btn">
|
||||||
|
<a href="#" ng-click="backPrevLocation($event)"><i class="fa fa-long-arrow-left "></i></a>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-8 b-l b-r">
|
||||||
|
<section class="heading-title">
|
||||||
|
<h1 translate translate-values="{NAME: space.name}">{{ 'space_edit.edit_the_space_NAME' }}</h1>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row no-gutter" >
|
||||||
|
|
||||||
|
<div class="col-md-9 b-r nopadding">
|
||||||
|
<form role="form"
|
||||||
|
name="spaceForm"
|
||||||
|
class="form-horizontal"
|
||||||
|
action="{{ actionUrl }}"
|
||||||
|
ng-upload="submited(content)"
|
||||||
|
upload-options-enable-rails-csrf="true"
|
||||||
|
unsaved-warning-form
|
||||||
|
novalidate>
|
||||||
|
|
||||||
|
<input name="_method" type="hidden" ng-value="method">
|
||||||
|
|
||||||
|
<section class="panel panel-default bg-light m-lg">
|
||||||
|
<div class="panel-body m-r">
|
||||||
|
<ng-include src="'<%= asset_path 'spaces/_form.html' %>'"></ng-include>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="panel-footer no-padder">
|
||||||
|
<input type="submit"
|
||||||
|
value="{{ 'space_edit.validate_the_changes' | translate }}"
|
||||||
|
class="r-b btn-valid btn btn-warning btn-block p-lg btn-lg text-u-c"
|
||||||
|
ng-disabled="spaceForm.$invalid"/>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3"/>
|
||||||
|
</div>
|
@ -7,7 +7,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-8 b-l b-r">
|
<div class="col-md-8 b-l b-r">
|
||||||
<section class="heading-title">
|
<section class="heading-title">
|
||||||
<h1 translate>{{ 'add_a_new_space' }}</h1>
|
<h1 translate>{{ 'space_new.add_a_new_space' }}</h1>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -22,12 +22,36 @@
|
|||||||
<div class="col-md-9 b-r nopadding">
|
<div class="col-md-9 b-r nopadding">
|
||||||
|
|
||||||
<div class="m-lg alert alert-warning" role="alert">
|
<div class="m-lg alert alert-warning" role="alert">
|
||||||
{{ 'watch_out_when_creating_a_new_space_its_prices_are_initialized_at_0_for_all_subscriptions' | translate}}
|
{{ 'space_new.watch_out_when_creating_a_new_space_its_prices_are_initialized_at_0_for_all_subscriptions' | translate}}
|
||||||
{{ 'consider_changing_its_prices_before_creating_any_reservation_slot' | translate }}
|
{{ 'space_new.consider_changing_its_prices_before_creating_any_reservation_slot' | translate }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<form role="form"
|
||||||
|
name="spaceForm"
|
||||||
|
class="form-horizontal"
|
||||||
|
action="{{ actionUrl }}"
|
||||||
|
ng-upload="submited(content)"
|
||||||
|
upload-options-enable-rails-csrf="true"
|
||||||
|
unsaved-warning-form
|
||||||
|
novalidate>
|
||||||
|
|
||||||
|
<input name="_method" type="hidden" ng-value="method">
|
||||||
|
|
||||||
|
<section class="panel panel-default bg-light m-lg">
|
||||||
|
<div class="panel-body m-r">
|
||||||
<ng-include src="'<%= asset_path 'spaces/_form.html' %>'"></ng-include>
|
<ng-include src="'<%= asset_path 'spaces/_form.html' %>'"></ng-include>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="panel-footer no-padder">
|
||||||
|
<input type="submit"
|
||||||
|
value="{{ 'space_new.add_this_space' | translate }}"
|
||||||
|
class="r-b btn-valid btn btn-warning btn-block p-lg btn-lg text-u-c"
|
||||||
|
ng-disabled="spaceForm.$invalid"/>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3"/>
|
<div class="col-md-3"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
json.extract! @space, :id, :name, :description, :characteristics, :created_at, :updated_at
|
json.extract! @space, :id, :name, :description, :characteristics, :created_at, :updated_at, :slug, :default_places
|
||||||
json.space_image @space.space_image.attachment.large.url if @space.space_image
|
json.space_image @space.space_image.attachment.large.url if @space.space_image
|
||||||
json.space_files_attributes @space.space_files do |f|
|
json.space_files_attributes @space.space_files do |f|
|
||||||
json.id f.id
|
json.id f.id
|
||||||
|
@ -69,12 +69,6 @@ en:
|
|||||||
beware_when_creating_a_training_its_reservation_prices_are_initialized_to_zero: "Beware, when creating a training, its reservation prices are initialized at zero."
|
beware_when_creating_a_training_its_reservation_prices_are_initialized_to_zero: "Beware, when creating a training, its reservation prices are initialized at zero."
|
||||||
dont_forget_to_change_them_before_creating_slots_for_this_training: "Don't forget to change them before creating slots for this training."
|
dont_forget_to_change_them_before_creating_slots_for_this_training: "Don't forget to change them before creating slots for this training."
|
||||||
|
|
||||||
space_new:
|
|
||||||
# create a new space
|
|
||||||
add_a_new_space: "Add a new space"
|
|
||||||
watch_out_when_creating_a_new_space_its_prices_are_initialized_at_0_for_all_subscriptions: "Watch out! When creating a new space, its prices are initialized at 0 for all subscriptions."
|
|
||||||
consider_changing_its_prices_before_creating_any_reservation_slot: "Consider changing its prices before creating any reservation slot."
|
|
||||||
|
|
||||||
events:
|
events:
|
||||||
# events tracking and management
|
# events tracking and management
|
||||||
events_monitoring: "Events monitoring"
|
events_monitoring: "Events monitoring"
|
||||||
@ -581,3 +575,17 @@ en:
|
|||||||
client_successfully_updated: "Client successfully updated."
|
client_successfully_updated: "Client successfully updated."
|
||||||
client_successfully_deleted: "Client successfully deleted."
|
client_successfully_deleted: "Client successfully deleted."
|
||||||
access_successfully_revoked: "Access successfully revoked."
|
access_successfully_revoked: "Access successfully revoked."
|
||||||
|
|
||||||
|
space_new:
|
||||||
|
# create a new space
|
||||||
|
space_new:
|
||||||
|
add_a_new_space: "Add a new space"
|
||||||
|
watch_out_when_creating_a_new_space_its_prices_are_initialized_at_0_for_all_subscriptions: "Watch out! When creating a new space, its prices are initialized at 0 for all subscriptions."
|
||||||
|
consider_changing_its_prices_before_creating_any_reservation_slot: "Consider changing its prices before creating any reservation slot."
|
||||||
|
add_this_space: "Add this space"
|
||||||
|
|
||||||
|
space_edit:
|
||||||
|
# modify an exiting space
|
||||||
|
space_edit:
|
||||||
|
edit_the_space_NAME: "Edit the space: {{NAME}}" # angular interpolation
|
||||||
|
validate_the_changes: "Validate the changes"
|
||||||
|
@ -69,12 +69,6 @@ fr:
|
|||||||
beware_when_creating_a_training_its_reservation_prices_are_initialized_to_zero: "Attention, lors de la création d'une formation, ses tarifs de réservation sont initialisés à zero."
|
beware_when_creating_a_training_its_reservation_prices_are_initialized_to_zero: "Attention, lors de la création d'une formation, ses tarifs de réservation sont initialisés à zero."
|
||||||
dont_forget_to_change_them_before_creating_slots_for_this_training: "Pensez à les modifier avant de créer des créneaux pour cette formation."
|
dont_forget_to_change_them_before_creating_slots_for_this_training: "Pensez à les modifier avant de créer des créneaux pour cette formation."
|
||||||
|
|
||||||
space_new:
|
|
||||||
# créer un nouvel espace
|
|
||||||
add_a_new_space: "Ajouter un nouvel espace"
|
|
||||||
watch_out_when_creating_a_new_space_its_prices_are_initialized_at_0_for_all_subscriptions: "Attention, lors de la création d'un espace, ses tarifs de réservation sont initialisés à zero pour tout les abonnements."
|
|
||||||
consider_changing_its_prices_before_creating_any_reservation_slot: "Pensez à modifier ces prix avant de créer des créneaux pour cet espace."
|
|
||||||
|
|
||||||
events:
|
events:
|
||||||
# gestion et suivi des évènements
|
# gestion et suivi des évènements
|
||||||
events_monitoring: "Suivi des évènements"
|
events_monitoring: "Suivi des évènements"
|
||||||
@ -581,3 +575,17 @@ fr:
|
|||||||
client_successfully_updated: "Les modifications ont été enregistrées."
|
client_successfully_updated: "Les modifications ont été enregistrées."
|
||||||
client_successfully_deleted: "Le compte client a bien été supprimé."
|
client_successfully_deleted: "Le compte client a bien été supprimé."
|
||||||
access_successfully_revoked: "L'accès a bien été revoqué."
|
access_successfully_revoked: "L'accès a bien été revoqué."
|
||||||
|
|
||||||
|
space_new:
|
||||||
|
# créer un nouvel espace
|
||||||
|
space_new:
|
||||||
|
add_a_new_space: "Ajouter un nouvel espace"
|
||||||
|
watch_out_when_creating_a_new_space_its_prices_are_initialized_at_0_for_all_subscriptions: "Attention, lors de la création d'un espace, ses tarifs de réservation sont initialisés à zero pour tout les abonnements."
|
||||||
|
consider_changing_its_prices_before_creating_any_reservation_slot: "Pensez à modifier ces prix avant de créer des créneaux pour cet espace."
|
||||||
|
add_this_space: "Ajouter cet espace"
|
||||||
|
|
||||||
|
space_edit:
|
||||||
|
# modifier un espace existant
|
||||||
|
space_edit:
|
||||||
|
edit_the_space_NAME: "Modifier l'espace : {{NAME}}" # angular interpolation
|
||||||
|
validate_the_changes: "Valider les modifications"
|
||||||
|
@ -396,6 +396,5 @@ en:
|
|||||||
attached_files_(pdf): "Attached files (pdf)"
|
attached_files_(pdf): "Attached files (pdf)"
|
||||||
attach_a_file: "Attach a file"
|
attach_a_file: "Attach a file"
|
||||||
add_an_attachment: "Add an attachment"
|
add_an_attachment: "Add an attachment"
|
||||||
add_this_space: "Add this space"
|
|
||||||
default_places: "Default maximum tickets"
|
default_places: "Default maximum tickets"
|
||||||
default_places_is_required: "Default maximum tickets is required."
|
default_places_is_required: "Default maximum tickets is required."
|
@ -396,6 +396,5 @@ fr:
|
|||||||
attached_files_(pdf): "Pièces jointes (pdf)"
|
attached_files_(pdf): "Pièces jointes (pdf)"
|
||||||
attach_a_file: "Joindre un fichier"
|
attach_a_file: "Joindre un fichier"
|
||||||
add_an_attachment: "Ajouter une pièce jointe"
|
add_an_attachment: "Ajouter une pièce jointe"
|
||||||
add_this_space: "Ajouter cet espace"
|
|
||||||
default_places: "Maximum de places par défaut"
|
default_places: "Maximum de places par défaut"
|
||||||
default_places_is_required: "Le nombre de places maximum par défaut est requis."
|
default_places_is_required: "Le nombre de places maximum par défaut est requis."
|
Loading…
x
Reference in New Issue
Block a user