From 30b3a794d3356469baab85f3788d55e5371b9a6b Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 08:40:07 +0200 Subject: [PATCH 01/17] [bug] managers cannot see passed events --- CHANGELOG.md | 2 ++ app/controllers/api/events_controller.rb | 2 +- app/policies/event_policy.rb | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1874b9d8..9468f9e46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog Fab-manager +- Fix a bug: managers cannot see passed events + ## v4.5.8 2020 Septembre 28 - Fix a bug: unable to run the elastic-upgrade script diff --git a/app/controllers/api/events_controller.rb b/app/controllers/api/events_controller.rb index 2e550018e..e86703835 100644 --- a/app/controllers/api/events_controller.rb +++ b/app/controllers/api/events_controller.rb @@ -14,7 +14,7 @@ class API::EventsController < API::ApiController @events = @events.joins(:event_themes).where('event_themes.id = :theme', theme: params[:theme_id]) if params[:theme_id] @events = @events.where('age_range_id = :age_range', age_range: params[:age_range_id]) if params[:age_range_id] - if current_user&.admin? + if current_user&.admin? || current_user&.manager? @events = case params[:scope] when 'future' @events.where('availabilities.start_at >= ?', DateTime.current).order('availabilities.start_at DESC') diff --git a/app/policies/event_policy.rb b/app/policies/event_policy.rb index 4db834236..1a5a51df5 100644 --- a/app/policies/event_policy.rb +++ b/app/policies/event_policy.rb @@ -5,7 +5,7 @@ class EventPolicy < ApplicationPolicy # Defines the scope of the events index, depending on the role of the current user class Scope < Scope def resolve - if user.nil? || (user && !user.admin?) + if user.nil? || (user && !user.admin? && !user.manager?) scope.includes(:event_image, :event_files, :availability, :category) .where('availabilities.start_at >= ?', DateTime.current) .order('availabilities.start_at ASC') From 13bc5334cc99fe1c1c3af3f358d3d636ec1a2e62 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 09:39:32 +0200 Subject: [PATCH 02/17] ability to configure until when the events are shown on the home page --- CHANGELOG.md | 2 ++ app/assets/javascripts/router.js.erb | 2 +- app/assets/templates/admin/settings/home_page.html | 12 ++++++++++++ app/controllers/api/events_controller.rb | 10 +++++++++- app/models/setting.rb | 3 ++- config/locales/app.admin.en.yml | 7 +++++++ config/locales/app.admin.fr.yml | 7 +++++++ db/seeds.rb | 3 ++- 8 files changed, 42 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9468f9e46..f71aac4a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog Fab-manager +- Ability to configure until when the events are shown on the home page - Fix a bug: managers cannot see passed events +- [TODO DEPLOY] `rails db:seed` ## v4.5.8 2020 Septembre 28 diff --git a/app/assets/javascripts/router.js.erb b/app/assets/javascripts/router.js.erb index fe3e7aa14..d14428204 100644 --- a/app/assets/javascripts/router.js.erb +++ b/app/assets/javascripts/router.js.erb @@ -1043,7 +1043,7 @@ angular.module('application.router', ['ui.router']) 'fablab_name', 'name_genre', 'reminder_enable', 'plans_module', 'confirmation_required', \ 'reminder_delay', 'visibility_yearly', 'visibility_others', 'wallet_module', \ 'display_name_enable', 'machines_sort_by', 'fab_analytics', 'statistics_module', \ - 'link_name', 'home_content', 'home_css', 'phone_required']` }).$promise; + 'link_name', 'home_content', 'home_css', 'phone_required', 'upcoming_events_shown']` }).$promise; }], privacyDraftsPromise: ['Setting', function (Setting) { return Setting.get({ name: 'privacy_draft', history: true }).$promise; }], cguFile: ['CustomAsset', function (CustomAsset) { return CustomAsset.get({ name: 'cgu-file' }).$promise; }], diff --git a/app/assets/templates/admin/settings/home_page.html b/app/assets/templates/admin/settings/home_page.html index 2e25386ce..40de310f7 100644 --- a/app/assets/templates/admin/settings/home_page.html +++ b/app/assets/templates/admin/settings/home_page.html @@ -27,6 +27,18 @@ +
+
+ + +
+
diff --git a/app/controllers/api/events_controller.rb b/app/controllers/api/events_controller.rb index e86703835..3c145cb0f 100644 --- a/app/controllers/api/events_controller.rb +++ b/app/controllers/api/events_controller.rb @@ -36,9 +36,17 @@ class API::EventsController < API::ApiController limit = params[:limit] @events = Event.includes(:event_image, :event_files, :availability, :category) .where('events.nb_total_places != -1 OR events.nb_total_places IS NULL') - .where('availabilities.start_at >= ?', DateTime.current) .order('availabilities.start_at ASC').references(:availabilities) .limit(limit) + + @events = case Setting.get('upcoming_events_shown') + when 'until_start' + @events.where('availabilities.start_at >= ?', DateTime.current) + when '2h_before_end' + @events.where('availabilities.end_at >= ?', DateTime.current + 2.hours) + else + @events.where('availabilities.end_at >= ?', DateTime.current) + end end def show; end diff --git a/app/models/setting.rb b/app/models/setting.rb index d89391f65..7b49466f0 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -105,7 +105,8 @@ class Setting < ApplicationRecord invoice_prefix confirmation_required wallet_module - statistics_module] } + statistics_module + upcoming_events_shown] } # WARNING: when adding a new key, you may also want to add it in app/policies/setting_policy.rb#public_whitelist def value diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml index 3f9be08be..ce6e9656e 100644 --- a/config/locales/app.admin.en.yml +++ b/config/locales/app.admin.en.yml @@ -1112,6 +1112,7 @@ en: confirmation_is_required: "Confirmation required" wallet_module: "wallet module" statistics_module: "statistics module" + upcoming_events_shown: "display limit for upcoming events" general: general: "General" title: "Title" @@ -1151,6 +1152,12 @@ en: statistics: "Statistics" statistics_info_html: "

Enable or disable the statistics module.

If enabled, every nights, the data of the day just passed will be consolidated in the database of a powerful analysis engine. Then, every administrators will be able to browse statistical charts and tables in the corresponding section.

" enable_statistics: "Enable statistics" + home: + show_upcoming_events: "Show upcoming events" + upcoming_events: + until_start: "Until they start" + 2h_before_end: "Until 2 hours before they end" + until_end: "Until they end" privacy: title: "Privacy" privacy_policy: "Privacy policy" diff --git a/config/locales/app.admin.fr.yml b/config/locales/app.admin.fr.yml index a96687d9a..086c7017c 100644 --- a/config/locales/app.admin.fr.yml +++ b/config/locales/app.admin.fr.yml @@ -1112,6 +1112,7 @@ fr: confirmation_is_required: "Confirmation requise" wallet_module: "module porte-monnaie" statistics_module: "module de statistiques" + upcoming_events_shown: "la limite d'affichage des événements à venir" general: general: "Général" title: "Titre" @@ -1151,6 +1152,12 @@ fr: statistics: "Statistiques" statistics_info_html: "

Activer ou désactiver le module de statistiques.

Si activé, chaque nuit, les données de la journée qui vient de s'écouler seront consolidées dans la base de données d'un puissant moteur d'analyse. Ensuite, chaque administrateur pourra parcourir les tableaux et graphiques statistiques dans la section correspondante.

" enable_statistics: "Activer les statistiques" + home: + show_upcoming_events: "Afficher les prochains événements" + upcoming_events: + until_start: "Jusqu'à ce qu'ils commencent" + 2h_before_end: "Jusqu'à 2 heures avant la fin" + until_end: "Jusqu'à ce qu'ils finissent" privacy: title: "Confidentialité" privacy_policy: "Politique de confidentialité" diff --git a/db/seeds.rb b/db/seeds.rb index 99d950073..a257f13b4 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true if StatisticIndex.count.zero? StatisticIndex.create!([ @@ -892,6 +891,8 @@ Setting.set('wallet_module', true) unless Setting.find_by(name: 'wallet_module') Setting.set('statistics_module', true) unless Setting.find_by(name: 'statistics_module').try(:value) +Setting.set('upcoming_events_shown', 'until_start') unless Setting.find_by(name: 'upcoming_events_shown').try(:value) + if StatisticCustomAggregation.count.zero? # available reservations hours for machines machine_hours = StatisticType.find_by(key: 'hour', statistic_index_id: 2) From eae9332083e41b252250c910ac298cee047a738c Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 10:46:33 +0200 Subject: [PATCH 03/17] Improved documentation about upgrade process --- CHANGELOG.md | 1 + doc/production_readme.md | 4 +++- doc/upgrade_v1.md | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f71aac4a5..06122b8ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog Fab-manager - Ability to configure until when the events are shown on the home page +- Improved documentation about upgrade process - Fix a bug: managers cannot see passed events - [TODO DEPLOY] `rails db:seed` diff --git a/doc/production_readme.md b/doc/production_readme.md index 820e6c300..f7431340c 100644 --- a/doc/production_readme.md +++ b/doc/production_readme.md @@ -157,7 +157,9 @@ Then, you'll need to perform the upgrade with the following command: *This procedure updates Fab-manager to the most recent version by default.* -> ⚠ If you are upgrading from a very outdated version, you must first upgrade to v2.8.3, then to v3.1.2 and finally to the last version +> ⚠ If you are upgrading from a very outdated version, you must first upgrade to v2.8.3, then to v3.1.2, then to 4.0.4 and finally to the last version + +> ⚠ With versions < 4.3.3, you must replace `bundle exec rails` with `bundle exec rake` in all the commands above ### Steps diff --git a/doc/upgrade_v1.md b/doc/upgrade_v1.md index 8f93028c7..b16b86bdf 100644 --- a/doc/upgrade_v1.md +++ b/doc/upgrade_v1.md @@ -3,7 +3,7 @@ Steps to follow: - Dump database of v1 - Make a gzipped tarball of public/uploads -- Install Fab-manager v4.3.4+ +- Install Fab-manager v4.3.4 or above - Restore the DB dump in the new postgres instance - Open a psql shell, then: ```sql From 6d2b833ebd83628d9a2407bec57a087af7e9fdfd Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 12:02:03 +0200 Subject: [PATCH 04/17] New translations app.shared.en.yml (Zulu) --- config/locales/app.shared.zu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/app.shared.zu.yml b/config/locales/app.shared.zu.yml index 360ab6518..c2a9c371e 100644 --- a/config/locales/app.shared.zu.yml +++ b/config/locales/app.shared.zu.yml @@ -411,7 +411,7 @@ zu: unable_to_select_plan_if_slots_in_the_past: "crwdns20136:0crwdne20136:0" unable_to_change_the_reservation: "crwdns10091:0crwdne10091:0" confirmation_required: "crwdns10093:0crwdne10093:0" - do_you_really_want_to_cancel_this_reservation: "crwdns10095:0crwdne10095:0" + do_you_really_want_to_cancel_this_reservation_html: "crwdns20908:0crwdne20908:0" reservation_was_cancelled_successfully: "crwdns10097:0crwdne10097:0" cancellation_failed: "crwdns10099:0crwdne10099:0" confirm_payment_of_html: "crwdns10101:0ROLE={ROLE}crwdnd10101:0AMOUNT={AMOUNT}crwdne10101:0" #eg. confirm my payment of $20.00 From 1462eccc9f96590d4ef80bc6f731929a0ac4877f Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 12:02:06 +0200 Subject: [PATCH 05/17] New translations app.admin.en.yml (Zulu) --- config/locales/app.admin.zu.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/locales/app.admin.zu.yml b/config/locales/app.admin.zu.yml index c09dcdbf3..73fdd53d8 100644 --- a/config/locales/app.admin.zu.yml +++ b/config/locales/app.admin.zu.yml @@ -1112,6 +1112,7 @@ zu: confirmation_is_required: "crwdns20722:0crwdne20722:0" wallet_module: "crwdns20724:0crwdne20724:0" statistics_module: "crwdns20864:0crwdne20864:0" + upcoming_events_shown: "crwdns20898:0crwdne20898:0" general: general: "crwdns20726:0crwdne20726:0" title: "crwdns20728:0crwdne20728:0" @@ -1151,6 +1152,12 @@ zu: statistics: "crwdns20866:0crwdne20866:0" statistics_info_html: "crwdns20868:0crwdne20868:0" enable_statistics: "crwdns20870:0crwdne20870:0" + home: + show_upcoming_events: "crwdns20900:0crwdne20900:0" + upcoming_events: + until_start: "crwdns20902:0crwdne20902:0" + 2h_before_end: "crwdns20904:0crwdne20904:0" + until_end: "crwdns20906:0crwdne20906:0" privacy: title: "crwdns20792:0crwdne20792:0" privacy_policy: "crwdns20794:0crwdne20794:0" From b84e569ab0292ef3d7eecd227380b245569d4c9b Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 12:02:16 +0200 Subject: [PATCH 06/17] New translations app.shared.en.yml (Portuguese) --- config/locales/app.shared.pt.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/app.shared.pt.yml b/config/locales/app.shared.pt.yml index 029cce4ac..c14dfae96 100755 --- a/config/locales/app.shared.pt.yml +++ b/config/locales/app.shared.pt.yml @@ -411,7 +411,7 @@ pt: unable_to_select_plan_if_slots_in_the_past: "Não é possível selecionar um plano se algum dos slots selecionados estiver no passado" unable_to_change_the_reservation: "Não permitido alterar esta reserva" confirmation_required: "Confirmação é obrigatória" - do_you_really_want_to_cancel_this_reservation: "Você realmente quer cancelar essa reserva?" + do_you_really_want_to_cancel_this_reservation_html: "

Do you really want to cancel this reservation?

Warning: if this reservation was made free of charge, as part of a subscription, the credits used will not be re-credited.

" reservation_was_cancelled_successfully: "Reserva a foi cancelada com sucesso." cancellation_failed: "Cancelamento falhou." confirm_payment_of_html: "{ROLE, select, admin{Pagamento pelo site} other{Pagar}}: {AMOUNT}" #eg. confirm my payment of $20.00 From dda606e91ec01f00e7df0cefb438e72d0eb28de4 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 12:02:18 +0200 Subject: [PATCH 07/17] New translations app.admin.en.yml (French) --- config/locales/app.admin.fr.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/locales/app.admin.fr.yml b/config/locales/app.admin.fr.yml index a96687d9a..8278a3f62 100644 --- a/config/locales/app.admin.fr.yml +++ b/config/locales/app.admin.fr.yml @@ -1112,6 +1112,7 @@ fr: confirmation_is_required: "Confirmation requise" wallet_module: "module porte-monnaie" statistics_module: "module de statistiques" + upcoming_events_shown: "display limit for upcoming events" general: general: "Général" title: "Titre" @@ -1151,6 +1152,12 @@ fr: statistics: "Statistiques" statistics_info_html: "

Activer ou désactiver le module de statistiques.

Si activé, chaque nuit, les données de la journée qui vient de s'écouler seront consolidées dans la base de données d'un puissant moteur d'analyse. Ensuite, chaque administrateur pourra parcourir les tableaux et graphiques statistiques dans la section correspondante.

" enable_statistics: "Activer les statistiques" + home: + show_upcoming_events: "Show upcoming events" + upcoming_events: + until_start: "Until they start" + 2h_before_end: "Until 2 hours before they end" + until_end: "Until they end" privacy: title: "Confidentialité" privacy_policy: "Politique de confidentialité" From 137286ea5b6dc28b07c72a6198c00665e61d9082 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 12:02:22 +0200 Subject: [PATCH 08/17] New translations app.admin.en.yml (Portuguese) --- config/locales/app.admin.pt.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/locales/app.admin.pt.yml b/config/locales/app.admin.pt.yml index 4028a7731..190cc5baf 100755 --- a/config/locales/app.admin.pt.yml +++ b/config/locales/app.admin.pt.yml @@ -1112,6 +1112,7 @@ pt: confirmation_is_required: "Confirmation required" wallet_module: "wallet module" statistics_module: "statistics module" + upcoming_events_shown: "display limit for upcoming events" general: general: "General" title: "Title" @@ -1151,6 +1152,12 @@ pt: statistics: "Statistics" statistics_info_html: "

Enable or disable the statistics module.

If enabled, every nights, the data of the day just passed will be consolidated in the database of a powerful analysis engine. Then, every administrators will be able to browse statistical charts and tables in the corresponding section.

" enable_statistics: "Enable statistics" + home: + show_upcoming_events: "Show upcoming events" + upcoming_events: + until_start: "Until they start" + 2h_before_end: "Until 2 hours before they end" + until_end: "Until they end" privacy: title: "Privacidade" privacy_policy: "Política de privacidade" From 2d86f4b8b03a9d50d74206621d0b2602d2fd83cc Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 12:02:24 +0200 Subject: [PATCH 09/17] New translations app.shared.en.yml (Spanish) --- config/locales/app.shared.es.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/app.shared.es.yml b/config/locales/app.shared.es.yml index 160e4d109..6536dc12a 100644 --- a/config/locales/app.shared.es.yml +++ b/config/locales/app.shared.es.yml @@ -411,7 +411,7 @@ es: unable_to_select_plan_if_slots_in_the_past: "No se puede seleccionar un plan si alguno de los espacios seleccionados está en el pasado" unable_to_change_the_reservation: "Imposible cambiar reserva" confirmation_required: "Confirmación requerida" - do_you_really_want_to_cancel_this_reservation: "¿Está seguro de querer cancelar la reserva?" + do_you_really_want_to_cancel_this_reservation_html: "

Do you really want to cancel this reservation?

Warning: if this reservation was made free of charge, as part of a subscription, the credits used will not be re-credited.

" reservation_was_cancelled_successfully: "La reserva se ha cancelado con éxito." cancellation_failed: "Cancelación fallida." confirm_payment_of_html: "{ROLE, select, admin{Payment on site} other{Pay}}: {AMOUNT}" #eg. confirm my payment of $20.00 From 139af2c76841eeee09957e8f956b3af973d6fb28 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 12:02:28 +0200 Subject: [PATCH 10/17] New translations app.admin.en.yml (Spanish) --- config/locales/app.admin.es.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/locales/app.admin.es.yml b/config/locales/app.admin.es.yml index 54bb0adb4..70a95c79d 100644 --- a/config/locales/app.admin.es.yml +++ b/config/locales/app.admin.es.yml @@ -1112,6 +1112,7 @@ es: confirmation_is_required: "Confirmation required" wallet_module: "wallet module" statistics_module: "statistics module" + upcoming_events_shown: "display limit for upcoming events" general: general: "General" title: "Title" @@ -1151,6 +1152,12 @@ es: statistics: "Statistics" statistics_info_html: "

Enable or disable the statistics module.

If enabled, every nights, the data of the day just passed will be consolidated in the database of a powerful analysis engine. Then, every administrators will be able to browse statistical charts and tables in the corresponding section.

" enable_statistics: "Enable statistics" + home: + show_upcoming_events: "Show upcoming events" + upcoming_events: + until_start: "Until they start" + 2h_before_end: "Until 2 hours before they end" + until_end: "Until they end" privacy: title: "Privacidad" privacy_policy: "Política de privacidad" From 510af9d53b78a1d37f6404e6ce73f6524cb076d2 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 12:02:30 +0200 Subject: [PATCH 11/17] New translations app.shared.en.yml (French) --- config/locales/app.shared.fr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/app.shared.fr.yml b/config/locales/app.shared.fr.yml index e892b2e89..085af58f0 100644 --- a/config/locales/app.shared.fr.yml +++ b/config/locales/app.shared.fr.yml @@ -411,7 +411,7 @@ fr: unable_to_select_plan_if_slots_in_the_past: "Impossible de sélectionner un abonnement si l'un des créneaux sélectionné est dans le passé" unable_to_change_the_reservation: "Impossible de modifier la réservation" confirmation_required: "Confirmation requise" - do_you_really_want_to_cancel_this_reservation: "Êtes-vous sur de vouloir annuler cette réservation ?" + do_you_really_want_to_cancel_this_reservation_html: "

Do you really want to cancel this reservation?

Warning: if this reservation was made free of charge, as part of a subscription, the credits used will not be re-credited.

" reservation_was_cancelled_successfully: "La réservation a bien été annulée." cancellation_failed: "L'annulation a échouée." confirm_payment_of_html: "{ROLE, select, admin{Paiement sur place} other{Payer}} : {AMOUNT}" #eg. confirm my payment of $20.00 From 57b76d156b6c4514cde69af8cfdce6b770bf61bc Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 12:01:10 +0200 Subject: [PATCH 12/17] Alert before cancelling a reservation that credits will be lost --- CHANGELOG.md | 1 + app/assets/javascripts/directives/cart.js.erb | 2 +- app/models/users_credit.rb | 1 + config/locales/app.shared.en.yml | 2 +- config/locales/app.shared.fr.yml | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06122b8ea..dedb773a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog Fab-manager - Ability to configure until when the events are shown on the home page +- Alert before cancelling a reservation that credits will be lost - Improved documentation about upgrade process - Fix a bug: managers cannot see passed events - [TODO DEPLOY] `rails db:seed` diff --git a/app/assets/javascripts/directives/cart.js.erb b/app/assets/javascripts/directives/cart.js.erb index f3085bb84..0ab5ea607 100644 --- a/app/assets/javascripts/directives/cart.js.erb +++ b/app/assets/javascripts/directives/cart.js.erb @@ -464,7 +464,7 @@ Application.Directives.directive('cart', [ '$rootScope', '$uibModal', 'dialogs', object () { return { title: _t('app.shared.cart.confirmation_required'), - msg: _t('app.shared.cart.do_you_really_want_to_cancel_this_reservation') + msg: _t('app.shared.cart.do_you_really_want_to_cancel_this_reservation_html') }; } } diff --git a/app/models/users_credit.rb b/app/models/users_credit.rb index 17a6019b9..a34681235 100644 --- a/app/models/users_credit.rb +++ b/app/models/users_credit.rb @@ -8,4 +8,5 @@ class UsersCredit < ApplicationRecord belongs_to :training_credit, -> { where('credits.creditable_type = ?', 'Training') }, foreign_key: 'credit_id', class_name: 'Credit' belongs_to :machine_credit, -> { where('credits.creditable_type = ?', 'Machine') }, foreign_key: 'credit_id', class_name: 'Credit' + belongs_to :space_credit, -> { where('credits.creditable_type = ?', 'Space') }, foreign_key: 'credit_id', class_name: 'Credit' end diff --git a/config/locales/app.shared.en.yml b/config/locales/app.shared.en.yml index a57521b74..a246e8dc2 100644 --- a/config/locales/app.shared.en.yml +++ b/config/locales/app.shared.en.yml @@ -411,7 +411,7 @@ en: unable_to_select_plan_if_slots_in_the_past: "Unable to select a plan if any of the selected slots is in the past" unable_to_change_the_reservation: "Unable to change the reservation" confirmation_required: "Confirmation required" - do_you_really_want_to_cancel_this_reservation: "Do you really want to cancel this reservation?" + do_you_really_want_to_cancel_this_reservation_html: "

Do you really want to cancel this reservation?

Warning: if this reservation was made free of charge, as part of a subscription, the credits used will not be re-credited.

" reservation_was_cancelled_successfully: "Reservation was cancelled successfully." cancellation_failed: "Cancellation failed." confirm_payment_of_html: "{ROLE, select, admin{Payment on site} other{Pay}}: {AMOUNT}" #eg. confirm my payment of $20.00 diff --git a/config/locales/app.shared.fr.yml b/config/locales/app.shared.fr.yml index e892b2e89..ba46e4698 100644 --- a/config/locales/app.shared.fr.yml +++ b/config/locales/app.shared.fr.yml @@ -411,7 +411,7 @@ fr: unable_to_select_plan_if_slots_in_the_past: "Impossible de sélectionner un abonnement si l'un des créneaux sélectionné est dans le passé" unable_to_change_the_reservation: "Impossible de modifier la réservation" confirmation_required: "Confirmation requise" - do_you_really_want_to_cancel_this_reservation: "Êtes-vous sur de vouloir annuler cette réservation ?" + do_you_really_want_to_cancel_this_reservation_html: "

Êtes-vous sur de vouloir annuler cette réservation ?

Attention : si cette réservation a été effectuée gratuitement, dans le cadre d'un abonnement, les crédits utilisés ne seront pas re-crédités.

" reservation_was_cancelled_successfully: "La réservation a bien été annulée." cancellation_failed: "L'annulation a échouée." confirm_payment_of_html: "{ROLE, select, admin{Paiement sur place} other{Payer}} : {AMOUNT}" #eg. confirm my payment of $20.00 From 93b65d63ea26cc67ca81c0ff4f1ed1d05c5496ca Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 12:07:45 +0200 Subject: [PATCH 13/17] New translations app.admin.en.yml (French) --- config/locales/app.admin.fr.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/locales/app.admin.fr.yml b/config/locales/app.admin.fr.yml index 8278a3f62..086c7017c 100644 --- a/config/locales/app.admin.fr.yml +++ b/config/locales/app.admin.fr.yml @@ -1112,7 +1112,7 @@ fr: confirmation_is_required: "Confirmation requise" wallet_module: "module porte-monnaie" statistics_module: "module de statistiques" - upcoming_events_shown: "display limit for upcoming events" + upcoming_events_shown: "la limite d'affichage des événements à venir" general: general: "Général" title: "Titre" @@ -1153,11 +1153,11 @@ fr: statistics_info_html: "

Activer ou désactiver le module de statistiques.

Si activé, chaque nuit, les données de la journée qui vient de s'écouler seront consolidées dans la base de données d'un puissant moteur d'analyse. Ensuite, chaque administrateur pourra parcourir les tableaux et graphiques statistiques dans la section correspondante.

" enable_statistics: "Activer les statistiques" home: - show_upcoming_events: "Show upcoming events" + show_upcoming_events: "Afficher les prochains événements" upcoming_events: - until_start: "Until they start" - 2h_before_end: "Until 2 hours before they end" - until_end: "Until they end" + until_start: "Jusqu'à ce qu'ils commencent" + 2h_before_end: "Jusqu'à 2 heures avant la fin" + until_end: "Jusqu'à ce qu'ils finissent" privacy: title: "Confidentialité" privacy_policy: "Politique de confidentialité" From 93c157c38ef8f513771880e84dff87b3818918ce Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 12:07:52 +0200 Subject: [PATCH 14/17] New translations app.shared.en.yml (French) --- config/locales/app.shared.fr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/app.shared.fr.yml b/config/locales/app.shared.fr.yml index 085af58f0..ba46e4698 100644 --- a/config/locales/app.shared.fr.yml +++ b/config/locales/app.shared.fr.yml @@ -411,7 +411,7 @@ fr: unable_to_select_plan_if_slots_in_the_past: "Impossible de sélectionner un abonnement si l'un des créneaux sélectionné est dans le passé" unable_to_change_the_reservation: "Impossible de modifier la réservation" confirmation_required: "Confirmation requise" - do_you_really_want_to_cancel_this_reservation_html: "

Do you really want to cancel this reservation?

Warning: if this reservation was made free of charge, as part of a subscription, the credits used will not be re-credited.

" + do_you_really_want_to_cancel_this_reservation_html: "

Êtes-vous sur de vouloir annuler cette réservation ?

Attention : si cette réservation a été effectuée gratuitement, dans le cadre d'un abonnement, les crédits utilisés ne seront pas re-crédités.

" reservation_was_cancelled_successfully: "La réservation a bien été annulée." cancellation_failed: "L'annulation a échouée." confirm_payment_of_html: "{ROLE, select, admin{Paiement sur place} other{Payer}} : {AMOUNT}" #eg. confirm my payment of $20.00 From d536f1f39f16b898ecaa35b91845f8a62e02e9e5 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 12:11:01 +0200 Subject: [PATCH 15/17] New translations app.shared.en.yml (Portuguese) --- config/locales/app.shared.pt.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/app.shared.pt.yml b/config/locales/app.shared.pt.yml index c14dfae96..fa6c5f8e2 100755 --- a/config/locales/app.shared.pt.yml +++ b/config/locales/app.shared.pt.yml @@ -411,7 +411,7 @@ pt: unable_to_select_plan_if_slots_in_the_past: "Não é possível selecionar um plano se algum dos slots selecionados estiver no passado" unable_to_change_the_reservation: "Não permitido alterar esta reserva" confirmation_required: "Confirmação é obrigatória" - do_you_really_want_to_cancel_this_reservation_html: "

Do you really want to cancel this reservation?

Warning: if this reservation was made free of charge, as part of a subscription, the credits used will not be re-credited.

" + do_you_really_want_to_cancel_this_reservation_html: "

Você realmente quer cancelar essa reserva?

Warning: if this reservation was made free of charge, as part of a subscription, the credits used will not be re-credited.

" reservation_was_cancelled_successfully: "Reserva a foi cancelada com sucesso." cancellation_failed: "Cancelamento falhou." confirm_payment_of_html: "{ROLE, select, admin{Pagamento pelo site} other{Pagar}}: {AMOUNT}" #eg. confirm my payment of $20.00 From 29237e1592cdc20bde0d1d18c7bec5d75e04d8c8 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 12:11:05 +0200 Subject: [PATCH 16/17] New translations app.shared.en.yml (Spanish) --- config/locales/app.shared.es.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/app.shared.es.yml b/config/locales/app.shared.es.yml index 6536dc12a..7ebf121ab 100644 --- a/config/locales/app.shared.es.yml +++ b/config/locales/app.shared.es.yml @@ -411,7 +411,7 @@ es: unable_to_select_plan_if_slots_in_the_past: "No se puede seleccionar un plan si alguno de los espacios seleccionados está en el pasado" unable_to_change_the_reservation: "Imposible cambiar reserva" confirmation_required: "Confirmación requerida" - do_you_really_want_to_cancel_this_reservation_html: "

Do you really want to cancel this reservation?

Warning: if this reservation was made free of charge, as part of a subscription, the credits used will not be re-credited.

" + do_you_really_want_to_cancel_this_reservation_html: "

¿Está seguro de querer cancelar la reserva?

Advertencia: si esta reserva se realizó de forma gratuita, como parte de una suscripción, los créditos utilizados no serán reacreditados.

" reservation_was_cancelled_successfully: "La reserva se ha cancelado con éxito." cancellation_failed: "Cancelación fallida." confirm_payment_of_html: "{ROLE, select, admin{Payment on site} other{Pay}}: {AMOUNT}" #eg. confirm my payment of $20.00 From f167e342681b7824f39c6ad9059c660449e8f75b Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 12:15:30 +0200 Subject: [PATCH 17/17] Version 4.5.9 --- CHANGELOG.md | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dedb773a2..e6942516c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,14 @@ # Changelog Fab-manager +## v4.5.9 2020 September 29 + - Ability to configure until when the events are shown on the home page - Alert before cancelling a reservation that credits will be lost - Improved documentation about upgrade process - Fix a bug: managers cannot see passed events - [TODO DEPLOY] `rails db:seed` -## v4.5.8 2020 Septembre 28 +## v4.5.8 2020 September 28 - Fix a bug: unable to run the elastic-upgrade script - Fix a security issue: updated rails to 5.2.4.4 to fix [CVE-2020-15169](https://nvd.nist.gov/vuln/detail/CVE-2020-15169) diff --git a/package.json b/package.json index 7723c147c..05484804b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fab-manager", - "version": "4.5.8", + "version": "4.5.9", "description": "Fab-manager is the FabLab management solution. It provides a comprehensive, web-based, open-source tool to simplify your administrative tasks and your marker's projects.", "keywords": [ "fablab",