1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

advanced training UI w/ i18n

This commit is contained in:
Sylvain 2016-06-21 17:35:53 +02:00
parent 644a5a9d47
commit ca73e83f7e
8 changed files with 50 additions and 14 deletions

View File

@ -16,6 +16,17 @@ Application.Controllers.controller "NewTrainingController", [ '$scope', ($scope)
## API URL where the form will be posted
$scope.actionUrl = '/api/trainings'
##
# For use with 'ng-class', returns the CSS class name for the uploads previews.
# The preview may show a placeholder or the content of the file depending on the upload state.
# @param v {*} any attribute, will be tested for truthiness (see JS evaluation rules)
##
$scope.fileinputClass = (v)->
if v
'fileinput-exists'
else
'fileinput-new'
]
@ -37,6 +48,17 @@ Application.Controllers.controller "EditTrainingController", [ '$scope', '$state
## Details of the training to edit (id in URL)
$scope.training = trainingPromise
##
# For use with 'ng-class', returns the CSS class name for the uploads previews.
# The preview may show a placeholder or the content of the file depending on the upload state.
# @param v {*} any attribute, will be tested for truthiness (see JS evaluation rules)
##
$scope.fileinputClass = (v)->
if v
'fileinput-exists'
else
'fileinput-new'
]

View File

@ -521,7 +521,7 @@ angular.module('application.router', ['ui.router']).
Machine.query().$promise
]
translations: [ 'Translations', (Translations) ->
Translations.query('app.admin.trainings').$promise
Translations.query(['app.admin.trainings', 'app.shared.trainings']).$promise
]
.state 'app.admin.trainings_new',
url: '/admin/trainings/new'
@ -544,7 +544,7 @@ angular.module('application.router', ['ui.router']).
Training.get(id: $stateParams.id).$promise
]
translations: [ 'Translations', (Translations) ->
Translations.query(['app.admin.trainings_edit', 'app.shared.trainings']).$promise
Translations.query('app.shared.trainings').$promise
]
# events
.state 'app.admin.events',

View File

@ -23,7 +23,7 @@
<ng-include src="'<%= asset_path 'admin/plans/_form.html' %>'"></ng-include>
<div class="panel-footer no-padder">
<input type="submit" value="Enregistrer" class="r-b btn-valid btn btn-warning btn-block p-lg btn-lg text-u-c" ng-disabled="planForm.$invalid || !partnerIsValid()"/>
<input type="submit" value="{{ 'save' | translate }}" class="r-b btn-valid btn btn-warning btn-block p-lg btn-lg text-u-c" ng-disabled="planForm.$invalid || !partnerIsValid()"/>
</div>
</form>

View File

@ -21,7 +21,7 @@
<div class="col-md-9 b-r nopadding">
<div class="alert alert-warning" role="alert">
<div class="alert alert-warning m-lg" role="alert">
{{ 'beware_when_creating_a_training_its_reservation_prices_are_initialized_to_zero' | translate }}
{{ 'dont_forget_to_change_them_before_creating_slots_for_this_training' | translate }}
</div>

View File

@ -46,9 +46,6 @@ en:
trainings:
# track and monitor the trainings
add_a_new_training: "Add a new training"
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."
associated_machines: "Associated machines"
number_of_tickets: "Number of tickets"
training: "Training"
@ -68,6 +65,11 @@ en:
training_successfully_deleted: "Training successfully deleted."
unable_to_delete_the_training_because_some_users_alredy_booked_it: "Unable to delete the training because some users already booked it."
trainings_new:
# create a new training
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."
events:
# courses and workshops tracking and management
fablab_courses_and_workshops: "Fablab courses and workshops"

View File

@ -46,9 +46,6 @@ fr:
trainings:
# suivre et surveiller les formations
add_a_new_training: "Ajouter une nouvelle formation"
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."
associated_machines: "Machines associées"
number_of_tickets: "Nombre de places"
training: "Formation"
@ -68,6 +65,11 @@ fr:
training_successfully_deleted: "La formation a bien été supprimée."
unable_to_delete_the_training_because_some_users_alredy_booked_it: "La formation ne peut pas être supprimée car elle a déjà été réservée par des utilisateurs."
trainings_new:
# créer une nouvelle formation
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."
events:
# gestion et suivi des stages et ateliers
fablab_courses_and_workshops: "Les Stages et ateliers du Fab Lab"

View File

@ -86,6 +86,8 @@ en:
_click_on_the_synchronization_button_opposite_: "click on the synchronization button opposite"
_disconnect_then_reconnect_: "disconnect then reconnect"
_for_your_changes_to_take_effect: "for your changes to take effect."
illustration: "Illustration"
add_an_illustration: "Add an illustration."
messages:
you_will_lose_any_unsaved_modification_if_you_quit_this_page: "You will lose any unsaved modification if you quit this page"
@ -129,8 +131,6 @@ en:
machine:
# machine edition form
name_is_required: "The name is required."
illustration: "Illustration"
add_an_illustration: "Add an illustration."
description_is_required: "Description is required."
technical_specifications_are_required: "Technical specifications are required."
attached_files_(pdf): "Attached files (pdf)"
@ -211,6 +211,11 @@ en:
new_partner: "New partner"
email_address_is_required: "Email address is required."
trainings:
# training edition form
add_a_new_training: "Add a new training"
validate_your_training: "Validate your training"
user_admin:
# partial form to edit/create an user (admin view)
group: "Group"

View File

@ -86,6 +86,8 @@ fr:
_click_on_the_synchronization_button_opposite_: "cliquez sur le bouton de synchronisation ci-contre"
_disconnect_then_reconnect_: "déconnectez-vous puis re-connectez vous"
_for_your_changes_to_take_effect: "pour que les modifications soient prises en compte."
illustration: "Visuel"
add_an_illustration: "Ajouter un visuel"
messages:
you_will_lose_any_unsaved_modification_if_you_quit_this_page: "Vous perdrez les modifications non enregistrées si vous quittez cette page"
@ -129,8 +131,6 @@ fr:
machine:
# formulaire d'édition d'une machine
name_is_required: "Le nom est requis."
illustration: "Visuel"
add_an_illustration: "Ajouter un visuel"
description_is_required: "La description est requise."
technical_specifications_are_required: "Les caractéristiques techniques sont requises."
attached_files_(pdf): "Pièces jointes (pdf)"
@ -211,6 +211,11 @@ fr:
new_partner: "Nouveau partenaire"
email_address_is_required: "L'adresse e-mail est requise."
trainings:
# formulaire d'édition d'une formation
add_a_new_training: "Ajouter une nouvelle formation"
validate_your_training: "Valider votre formation"
user_admin:
# formulaire partiel d'édition/création utilisateur (vue admin)
group: "Groupe"