diff --git a/app/assets/javascripts/controllers/admin/events.coffee b/app/assets/javascripts/controllers/admin/events.coffee index 779e2e118..adebce44b 100644 --- a/app/assets/javascripts/controllers/admin/events.coffee +++ b/app/assets/javascripts/controllers/admin/events.coffee @@ -192,7 +192,7 @@ Application.Controllers.controller "AdminEventsController", ["$scope", "$state", ## $scope.removeElement = (model, index) -> if model == 'category' and getModel(model)[1].length == 1 - growl.error(_t('at_least_one_category_is_required_unable_to_delete_the_last_one')) + growl.error(_t('at_least_one_category_is_required')+' '+_t('unable_to_delete_the_last_one')) return false if getModel(model)[1][index].related_to > 0 growl.error(_t('unable_to_delete_ELEMENT_already_in_use_NUMBER_times', {ELEMENT:model, NUMBER:getModel(model)[1][index].related_to}, "messageformat")) diff --git a/app/assets/templates/admin/events/filters.html.erb b/app/assets/templates/admin/events/filters.html.erb index b9a8d1a30..7a2e5d130 100644 --- a/app/assets/templates/admin/events/filters.html.erb +++ b/app/assets/templates/admin/events/filters.html.erb @@ -1,5 +1,6 @@

{{ 'categories' }}

+

{{ 'at_least_one_category_is_required' }}

diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml index 1d5975b30..7f6ac062f 100644 --- a/config/locales/app.admin.en.yml +++ b/config/locales/app.admin.en.yml @@ -86,7 +86,8 @@ en: add_a_range: "Add a range" do_you_really_want_to_delete_this_ELEMENT: "Do you really want to delete this {ELEMENT, select, category{category} theme{theme} age_range{age range} other{element}}?" # messageFormat interpolation unable_to_delete_ELEMENT_already_in_use_NUMBER_times: "Unable to delete this {ELEMENT, select, category{category} theme{theme} age_range{age range} other{element}} because it is already associated with {NUMBER, plural, =0{no events} one{one event} other{{NUMBER} events}}." # messageFormat interpolation - at_least_one_category_is_required_unable_to_delete_the_last_one: "At least one category is required. Unable to delete the last one." + at_least_one_category_is_required: "At least one category is required." + unable_to_delete_the_last_one: "Unable to delete the last one." unable_to_delete_an_error_occured: "Unable to delete: an error occurred." events_new: diff --git a/config/locales/app.admin.fr.yml b/config/locales/app.admin.fr.yml index afc937009..817466743 100644 --- a/config/locales/app.admin.fr.yml +++ b/config/locales/app.admin.fr.yml @@ -69,7 +69,7 @@ fr: 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." events: - # gestion et suivi des stages et ateliers + # gestion et suivi des évènements events_monitoring: "Suivi des évènements" manage_filters: "Gérer les filtres" fablab_events: "Les évènements du Fab Lab" @@ -86,11 +86,12 @@ fr: add_a_range: "Ajouter une tranche" do_you_really_want_to_delete_this_ELEMENT: "Voulez-vous vraiment supprimer cette {ELEMENT, select, category{catégorie} theme{thématique} age_range{tranche d'âge} other{élément}} ?" # messageFormat interpolation unable_to_delete_ELEMENT_already_in_use_NUMBER_times: "Impossible de supprimer cette {ELEMENT, select, category{catégorie} theme{thématique} age_range{tranche d'âge} other{élément}} car elle est actuellement associée à {NUMBER, plural, =0{aucun évènement} one{un évènement} other{{NUMBER} évènements}}." # messageFormat interpolation - at_least_one_category_is_required_unable_to_delete_the_last_one: "Au moins une catégorie est requise. Impossible de supprimer la dernière." + at_least_one_category_is_required: "Au moins une catégorie est requise." + unable_to_delete_the_last_one: "Impossible de supprimer la dernière." unable_to_delete_an_error_occured: "Impossible de supprimer : une erreur est survenue." events_new: - # ajouter un nouveau atelier/stage + # ajouter un nouvel évènement none: "Aucune" every_days: "Tous les jours" every_week: "Chaque semaine" diff --git a/config/locales/app.shared.fr.yml b/config/locales/app.shared.fr.yml index 93df97090..79b0817aa 100644 --- a/config/locales/app.shared.fr.yml +++ b/config/locales/app.shared.fr.yml @@ -164,7 +164,7 @@ fr: here_is_the_summary_of_the_slots_to_book_for_the_current_user: "Voici le récapitulatif des créneaux à réserver pour l'utilisateur courant :" event: - # formulaire d'édition d'un événement (stage/atelier) + # formulaire d'édition d'un événement title_is_required: "Le titre est requis." matching_visual: "Visuel associé" choose_a_picture: "Choisir une image" diff --git a/db/migrate/20160630140204_add_slugs_to_existing_categories.rb b/db/migrate/20160630140204_add_slugs_to_existing_categories.rb new file mode 100644 index 000000000..a6a4ed6cf --- /dev/null +++ b/db/migrate/20160630140204_add_slugs_to_existing_categories.rb @@ -0,0 +1,13 @@ +class AddSlugsToExistingCategories < ActiveRecord::Migration + def up + execute 'UPDATE categories + SET slug=name + WHERE slug IS NULL;' + end + + def down + execute 'UPDATE categories + SET slug=NULL + WHERE slug=name;' + end +end diff --git a/db/schema.rb b/db/schema.rb index b1a1ff5a6..3f21d9526 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160630100137) do +ActiveRecord::Schema.define(version: 20160630140204) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql"