diff --git a/CHANGELOG.md b/CHANGELOG.md index 183d8b00c..98877aa7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog Fab Manager -- Ability to configure reservation slot restrict for plans +- Ability to configure reservation slot restricted for plan subscribers - Ability to create and delete periodic calendar availabilities (recurrence) - Ability to fully customize the home page - Automated setup assistant diff --git a/app/assets/javascripts/directives/cart.js.erb b/app/assets/javascripts/directives/cart.js.erb index cbe5a6980..6ea6805a8 100644 --- a/app/assets/javascripts/directives/cart.js.erb +++ b/app/assets/javascripts/directives/cart.js.erb @@ -137,9 +137,9 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs', // first, we check that a user was selected if (Object.keys($scope.user).length > 0) { - // check user was selected a plan if slot is restricted for subcriptions + // check user was selected a plan if slot is restricted for subscriptions const slotHasPlan = []; - $scope.events.reserved.forEach(slot => { + $scope.events.reserved.forEach(function (slot) { if (slot.plan_ids.length > 0) { if ( ($scope.selectedPlan && _.include(slot.plan_ids, $scope.selectedPlan.id)) || @@ -151,9 +151,9 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs', } } }); - const hasPlanForSlot = slotHasPlan.every(a => a); + const hasPlanForSlot = slotHasPlan.every(function (a) { return a }); if (!hasPlanForSlot) { - return growl.error(_t('app.shared.cart.slot_restrict_subcriptions_must_select_plan')); + return growl.error(_t('app.shared.cart.slot_restrict_subscriptions_must_select_plan')); } @@ -285,9 +285,9 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs', */ var slotSelectionChanged = function () { if ($scope.slot) { - // build a list of plans if this slot is restricted for subcriptions + // build a list of plans if this slot is restricted for subscriptions if ($scope.slot.plan_ids.length > 0) { - const _plans = _.filter($scope.plans, p => _.include($scope.slot.plan_ids, p.id)); + const _plans = _.filter($scope.plans, function (p) { return _.include($scope.slot.plan_ids, p.id) }); $scope.slot.plansGrouped = []; for (let group of Array.from($scope.groups)) { const groupObj = { id: group.id, name: group.name, plans: [] }; diff --git a/app/assets/templates/admin/calendar/eventModal.html.erb b/app/assets/templates/admin/calendar/eventModal.html.erb index 6773e1e78..065a01241 100644 --- a/app/assets/templates/admin/calendar/eventModal.html.erb +++ b/app/assets/templates/admin/calendar/eventModal.html.erb @@ -94,7 +94,7 @@
-

{{ 'app.admin.calendar.restrict_this_slot_for_subcriptions_optional' }}

+

{{ 'app.admin.calendar.restrict_this_slot_for_subscriptions_optional' }}

diff --git a/app/assets/templates/plans/index.html.erb b/app/assets/templates/plans/index.html.erb index 69c2ac6c3..090eb9822 100644 --- a/app/assets/templates/plans/index.html.erb +++ b/app/assets/templates/plans/index.html.erb @@ -7,7 +7,7 @@
-

{{ 'app.public.plans.subcriptions' }}

+

{{ 'app.public.plans.subscriptions' }}

diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml index 0f6766af0..3fda351c6 100644 --- a/config/locales/app.admin.en.yml +++ b/config/locales/app.admin.en.yml @@ -46,7 +46,7 @@ en: adjust_the_opening_hours: "Adjust the opening hours" to_time: "to" # context: time. eg. 'from 18:00 to 21:00' restrict_this_slot_with_labels_optional: "Restrict this slot with labels (optional)" - restrict_this_slot_for_subcriptions_optional: "Restrict this slot for subscription users (optional)" + restrict_this_slot_for_subscriptions_optional: "Restrict this slot for subscription users (optional)" select_some_plans: "Select some plans" plans: "Plan(s):" recurrence: "Recurrence" diff --git a/config/locales/app.admin.es.yml b/config/locales/app.admin.es.yml index 263a58454..965d0138f 100644 --- a/config/locales/app.admin.es.yml +++ b/config/locales/app.admin.es.yml @@ -44,7 +44,7 @@ es: adjust_the_opening_hours: "Ajustar el horario de apertura" to_time: a restrict_this_slot_with_labels_optional: "Restringir este horario con etiquetas (opcional)" - restrict_this_slot_for_subcriptions_optional: "Restrict this slot for subscription users (optional)" + restrict_this_slot_for_subscriptions_optional: "Restrict this slot for subscription users (optional)" select_some_plans: "Select some plans" plans: "Plan(s):" recurrence: "Recurrencia" diff --git a/config/locales/app.admin.fr.yml b/config/locales/app.admin.fr.yml index b4024cdbf..bdb5ba723 100644 --- a/config/locales/app.admin.fr.yml +++ b/config/locales/app.admin.fr.yml @@ -46,7 +46,7 @@ fr: adjust_the_opening_hours: "Ajuster l'horaire" to_time: "à" # context: time. eg. 'from 18:00 to 21:00' restrict_this_slot_with_labels_optional: "Restreindre ce créneau avec des étiquettes (optionnel)" - restrict_this_slot_for_subcriptions_optional: "Restreindre ce créneau pour les abonnements (optionnel)" + restrict_this_slot_for_subscriptions_optional: "Restreindre ce créneau pour les abonnements (optionnel)" select_some_plans: "Sélectionnez des formules d'abonnement" plans: "Abonnement(s):" recurrence: "Récurrence" diff --git a/config/locales/app.admin.pt.yml b/config/locales/app.admin.pt.yml index cdd97fe9e..d0473aa6c 100755 --- a/config/locales/app.admin.pt.yml +++ b/config/locales/app.admin.pt.yml @@ -46,7 +46,7 @@ pt: adjust_the_opening_hours: "Ajustar o horário de funcionamento" to_time: "ás" # context: time. eg. 'from 18:00 to 21:00' restrict_this_slot_with_labels_optional: "Restrinja este slot com etiquetas (opcional)" - restrict_this_slot_for_subcriptions_optional: "Restrict this slot for subscription users (optional)" + restrict_this_slot_for_subscriptions_optional: "Restrict this slot for subscription users (optional)" select_some_plans: "Select some plans" plans: "Plan(s):" recurrence: "Recurrence" diff --git a/config/locales/app.public.ach.yml b/config/locales/app.public.ach.yml index 6e8290c80..bc623609c 100644 --- a/config/locales/app.public.ach.yml +++ b/config/locales/app.public.ach.yml @@ -229,7 +229,7 @@ ach: the_training_cant_be_deleted_because_it_is_already_reserved_by_some_users: "crwdns9167:0crwdne9167:0" plans: #summary of the subscriptions - subcriptions: "crwdns9169:0crwdne9169:0" + subscriptions: "crwdns9169:0crwdne9169:0" i_choose_that_plan: "crwdns9171:0crwdne9171:0" i_subscribe_online: "crwdns9173:0crwdne9173:0" i_already_subscribed: "crwdns9175:0crwdne9175:0" diff --git a/config/locales/app.public.en.yml b/config/locales/app.public.en.yml index 4122457c7..ee71749c6 100644 --- a/config/locales/app.public.en.yml +++ b/config/locales/app.public.en.yml @@ -253,7 +253,7 @@ en: plans: # summary of the subscriptions - subcriptions: "Subscriptions" + subscriptions: "Subscriptions" i_choose_that_plan: "I choose that plan" i_subscribe_online: "I subscribe online" i_already_subscribed: "I already subscribed" diff --git a/config/locales/app.public.es.yml b/config/locales/app.public.es.yml index b1150d2ea..5524a1134 100644 --- a/config/locales/app.public.es.yml +++ b/config/locales/app.public.es.yml @@ -229,7 +229,7 @@ es: the_training_cant_be_deleted_because_it_is_already_reserved_by_some_users: "El curso no puede borrarse porque ya ha sido reservado por algún usuario." plans: #summary of the subscriptions - subcriptions: "Suscripciones" + subscriptions: "Suscripciones" i_choose_that_plan: "Elijo este plan" i_subscribe_online: "Suscribirme online" i_already_subscribed: "Ya me he suscrito" diff --git a/config/locales/app.public.fr.yml b/config/locales/app.public.fr.yml index 6a969ff36..679caf697 100644 --- a/config/locales/app.public.fr.yml +++ b/config/locales/app.public.fr.yml @@ -253,7 +253,7 @@ fr: plans: # page récapitulative des abonnements - subcriptions: "Les abonnements" + subscriptions: "Les abonnements" i_choose_that_plan: "Je choisis cette formule" i_subscribe_online: "Je m'abonne en ligne" i_already_subscribed: "Je suis déjà abonné" diff --git a/config/locales/app.public.pt.yml b/config/locales/app.public.pt.yml index 671d8ff3d..8c935f5ca 100755 --- a/config/locales/app.public.pt.yml +++ b/config/locales/app.public.pt.yml @@ -253,7 +253,7 @@ pt: plans: # summary of the subscriptions - subcriptions: "Assinaturas" + subscriptions: "Assinaturas" i_choose_that_plan: "Eu escolho esse plano" i_subscribe_online: "Me inscrever online" i_already_subscribed: "Eu já estou inscrito" diff --git a/config/locales/app.shared.en.yml b/config/locales/app.shared.en.yml index 38e729b3b..e4524982e 100644 --- a/config/locales/app.shared.en.yml +++ b/config/locales/app.shared.en.yml @@ -440,4 +440,4 @@ en: none: "None" online_payment_disabled: "Online payment is not available. Please contact the Fablab reception directly." slot_restrict_plans: "This slot is restricted for the plans below:" - slot_restrict_subcriptions_must_select_plan: "The slot is restricted for subscriptions, please select a plan first." + slot_restrict_subscriptions_must_select_plan: "The slot is restricted for the subscribers. Please select a plan first." diff --git a/config/locales/app.shared.es.yml b/config/locales/app.shared.es.yml index 76428ab9d..2da7aeab8 100644 --- a/config/locales/app.shared.es.yml +++ b/config/locales/app.shared.es.yml @@ -417,4 +417,4 @@ es: none: "Ninguno" online_payment_disabled: "El pago en línea no está disponible. Póngase en contacto directamente con la recepción de Fablab." slot_restrict_plans: "This slot is restricted for the plans below:" - slot_restrict_subcriptions_must_select_plan: "The slot is restricted for subscriptions, please select a plan first." + slot_restrict_subscriptions_must_select_plan: "The slot is restricted for the subscribers. Please select a plan first." diff --git a/config/locales/app.shared.fr.yml b/config/locales/app.shared.fr.yml index 77fb1dc5f..bc0fc98cf 100644 --- a/config/locales/app.shared.fr.yml +++ b/config/locales/app.shared.fr.yml @@ -440,4 +440,4 @@ fr: none: "Aucune" online_payment_disabled: "Le payment par carte bancaire n'est pas disponible. Merci de contacter directement l'accueil du Fablab." slot_restrict_plans: "Ce créneau est restreint pour les formules d'abonnement ci-desous:" - slot_restrict_subcriptions_must_select_plan: "Le créneau est restreint pour les abonnements, Veuillez tout d'abord sélectionner un formule d'abonnement" + slot_restrict_subscriptions_must_select_plan: "Le créneau est restreint pour les abonnés. Veuillez tout d'abord sélectionner une formule d'abonnement" diff --git a/config/locales/app.shared.pt.yml b/config/locales/app.shared.pt.yml index 197ba6c55..1456ec5f1 100755 --- a/config/locales/app.shared.pt.yml +++ b/config/locales/app.shared.pt.yml @@ -440,4 +440,4 @@ pt: none: "Vazio" online_payment_disabled: "O pagamento online não está disponível. Entre em contato diretamente com a recepção do Fablab." slot_restrict_plans: "This slot is restricted for the plans below:" - slot_restrict_subcriptions_must_select_plan: "The slot is restricted for subscriptions, please select a plan first." + slot_restrict_subscriptions_must_select_plan: "The slot is restricted for the subscribers. Please select a plan first." diff --git a/db/schema.rb b/db/schema.rb index ee59f3f76..5990b14f6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -15,8 +15,8 @@ ActiveRecord::Schema.define(version: 20200206132857) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" - enable_extension "unaccent" enable_extension "pg_trgm" + enable_extension "unaccent" create_table "abuses", force: :cascade do |t| t.integer "signaled_id"