From a8ca94ce3292def03c0ec8c856f72d74fb84c59a Mon Sep 17 00:00:00 2001 From: Sylvain Date: Wed, 15 Jun 2022 09:59:19 +0200 Subject: [PATCH] (bug) times are not shown in admin/events monitoring page --- CHANGELOG.md | 1 + app/frontend/templates/admin/events/monitoring.html | 6 +++--- app/policies/event_policy.rb | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64bae9a67..07c0b8c14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - During the setup, autoconfigure the main domain - During the setup, ask to set ALLOW_INSECURE_HTTP if DEFAULT_PROTOCOL was set to http - Fix a bug: unable to edit an event +- Fix a bug: times are not shown in admin/events monitoring page - Fix a bug: unable to generate the secret key base during the setup - Fix a bug: error message during the setup: the input device is not a TTY - Fix a bug: when Fab-manager was installed as non-root user, unable to compile the assets during the upgrade diff --git a/app/frontend/templates/admin/events/monitoring.html b/app/frontend/templates/admin/events/monitoring.html index 3324372ef..7d77bf9ed 100644 --- a/app/frontend/templates/admin/events/monitoring.html +++ b/app/frontend/templates/admin/events/monitoring.html @@ -28,7 +28,7 @@ {{ 'app.admin.events.on_DATE' | translate:{DATE:(event.start_date | amDateFormat:'LL')} }} - + {{ 'app.admin.events.from_TIME' | translate:{TIME:(event.start_date | amDateFormat:'LT')} }} {{ 'app.admin.events.to_time' }} {{event.end_date | amDateFormat:'LT'}} @@ -39,8 +39,8 @@ {{'app.admin.events.from_DATE' | translate:{DATE:(event.start_date | amDateFormat:'LL')} }} {{'app.admin.events.to_date' | translate}} {{event.end_date | amDateFormat:'LL'}} -
- +
+ {{ 'app.admin.events.from_TIME' | translate:{TIME:(event.start_date | amDateFormat:'LT')} }} {{ 'app.admin.events.to_time' }} {{event.end_date | amDateFormat:'LT'}} diff --git a/app/policies/event_policy.rb b/app/policies/event_policy.rb index 1a5a51df5..8e350a944 100644 --- a/app/policies/event_policy.rb +++ b/app/policies/event_policy.rb @@ -6,12 +6,12 @@ class EventPolicy < ApplicationPolicy class Scope < Scope def resolve if user.nil? || (user && !user.admin? && !user.manager?) - scope.includes(:event_image, :event_files, :availability, :category) + scope.includes(:event_image, :event_files, :availability, :category, :event_price_categories, :age_range, :events_event_themes, :event_themes) .where('availabilities.start_at >= ?', DateTime.current) .order('availabilities.start_at ASC') .references(:availabilities) else - scope.includes(:event_image, :event_files, :availability, :category) + scope.includes(:event_image, :event_files, :availability, :category, :event_price_categories, :age_range, :events_event_themes, :event_themes) .references(:availabilities) end end