diff --git a/.gitignore b/.gitignore index d5b342488..286270d43 100644 --- a/.gitignore +++ b/.gitignore @@ -77,3 +77,6 @@ yarn-debug.log* /yarn-error.log yarn-debug.log* .yarn-integrity + +*.sql +*.tar.gz \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dffb3842..e1061a755 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,118 @@ # Changelog Fab-manager -## next deploy +## v6.3.8 2023 December 29 + +- Fix a bug: unable to build docker image + +## v6.3.7 2023 December 28 + +- Fix a bug: unable to show wallet payment mean for invoice +- Fix a bug: PayZen amount of subscription compute error for Coupon validity per user = forever +- Fix a bug: unable to create Stripe coupon with duration = forever +- improvement: remove show_username_in_admin_list setting +- improvement: show invoice payment method in accounting line +- [TODO DEPLOY] `rails fablab:setup:build_accounting_lines` +- [TODO DEPLOY] `rails fablab:fix:stripe_coupon_duration` + +## v6.3.6 2023 December 6 + +- fix a bug: fix event service +- updates translations + +## v6.3.5 2023 December 4 + +- fix a bug: user was not able to reserve at the same time of an event with pre-registration invalidated +- fix a bug: avoids crash if invoicing_profile has no address associated to it +- improvement: improves how pay_zen transactions are matched with payment_schedule_items +- improvement: improves rrule of pay_zen subscriptions +- improvement: better text contrast on customizable colors. Good for accessibility. +- Improvement: set the number of new attempts available in case the payment is rejected to 1 for PayZen + +## v6.3.4 2023 November 23 + +- fix a bug: wrong amount when pay a reservation with payment schedule +- fix a bug: regression on PaymentScheduleItemWorker from v6.3.2 +- fix a bug: event.pre_registration_end_date (was set to beginning_of_day instead of end_of_day) + +## v6.3.3 2023 November 14 + +- fix a bug: wrong currency unit for locale fr-CH + +## v6.3.2 2023 November 14 + +- updates sidekiq and sidekiq-scheduler +- fix a bug: wrong locale was causing wrong currency in cron jobs, now we manually set the currency locale in number_to_currency + +## v6.3.1 2023 November 10 + +- Fix a bug: statistic_sub_type.label of plan was nil +- adds a migrations to fix all statistic_sub_types of plans having label = nil +- Fix a bug: unable to show wallet payment mean for avoir +- updates spanish translations and adds translations +- Fix a bug: avoids crash due to oidc config with scope = nil +- Fix a bug: unable to see value for input group with long label on eventModal +- Improvement: when deleting an event, all reservations are canceled +- Improvement: replace original image by large generated version (event, machine, space, training) + +## v6.3.0 2023 November 3 + +- Fix a bug: fix all failing tasks of rake task file chain.rake +- Fix a bug: file_size_validator.rb was broken since ruby v3, see https://github.com/rails/rails/issues/41270 +- improvement: pre-registration event reservations limit places +- improvement: add including_deleted_users param for open api users +- decreases sidekiq concurrency from 25 to 5, 25 is too much and consumes memory for nothing +- do not log Notifications#polling action anymore, by default, can be enable via env variable ENABLE_NOTIFICATIONS_POLLING_LOGGING=true +- Fix a bug: api/products/index bug when sorting by amount +- adds a rake task to regenerate invoices by ids (see maintenance.rake) +- Fix a bug: replaces custom ServerLocale middleware with sidekiq i18n middleware +- adds a rake task to erase all reservations and invoices (fablab:maintenance:delete_all_reservations_and_invoices) +- improvement: dynamic label (i18n) for stats structure tables +- [TODO DEPLOY] upgrade to v6.2.0 BEFORE upgrading to v6.3.0 !!! + +## v6.2.0 2023 October 13 + +- Fix a bug: fix ReservationReminderWorker, was sending reservation reminder to users with a event reservation not validated by admin + adds tests for all scenarios +- Fix a bug: admin could not create new SupportingDocumentType (problem was on js side) +- Fix a bug: fix back button on space edit page +- Fix a bug: fix members tour (help), a selector was not valid anymore +- Fix a bug: unable to save OpenID extra_authorize_params as json +- Fix machine list bug : when there is no user logged in and access machines list with at least one machine associated to a space +- [TODO DEPLOY] `rails db:seed` + +## v6.1.2 2023 October 2 + +- Fix a bug: minor pb (exception raised) when bot hit api/projects#search without being authenticated +- Fix a bug: minor pb (exception raised) when a bot or unauthenticated user hit api/auth_providers actions +- Fix a bug: when calling .to_json on an "avoir", there was a bug because order_number delegates on invoice which can be nil, it was causing errors in notifications rendering +- Fix a bug: when getting status of users/subscriptions export +- improvement : adds/edit spanish translations + +## v6.1.1 2023 September 28 + +- Fix a bug: unable to sync projects with openprojects +- Fix a bug: public availabilities (no user) was buggy (server error) +- Fix a bug: unable to generate statistic +- Fix a bug: rss/projects was failing with project without image +- improvement : performance of members#show and reservations#index + +- [TODO DEPLOY] `rails fablab:openlab:bulk_export` +- [TODO DEPLOY] `rails fablab:openlab:bulk_update` +- [TODO DEPLOY] `rails fablab:maintenance:regenerate_statistics[2023,9]` + +## v6.1.0 2023 September 25 - improves api/notification controller to avoid failing when there is a notification with wrong notification_type in db - Add extra_authorize_params to OpenIdConnect config - Improvement : add a notification to remind users to upload their supporting documents - Cancel payment schedule subscription after update the payment mean - admin can see reservations of a member +- Fix a bug: unable to update card for payment schedule +- Fix a bug: user is_allow_contact is active by default +- Fix a bug: unable to export projects +- Fix a bug: unable to update card bank of payment schedule +- Feature: family compte for event +- Feature: pre-registration event +- [TODO DEPLOY] `rails db:seed` ## v6.0.14 2023 September 6 @@ -68,7 +174,7 @@ - Improved projects list filter - Fix a bug: unable to refresh machine/space/training calender after pay an reservation -- Fix a bug: Accouning Line in duplicate +- Fix a bug: Accounting Line in duplicate - Fix a bug: displays "my orders" link only if store module is active - [TODO DEPLOY] `rails fablab:setup:build_accounting_lines` @@ -77,7 +183,7 @@ - Fix a bug: OpenAPI accounting gateway_object_id missing error - Fix a bug: unable to modify the price of prepaid pack - Fix a bug: notification type missing -- Fix critical bug: Incorrect amount calculation when paying monthly subcription with a wallet for PayZen +- Fix critical bug: Incorrect amount calculation when paying monthly subscription with a wallet for PayZen ## v6.0.6 2023 May 4 @@ -168,7 +274,7 @@ - Ability to restrict machine availabilities per plan - Ability to configure a prior period for each reservation type to prevent booking (#440) - Admins cannot select the date when creating a refund invoice anymore -- Fix a bug: JS date is initalialized 1 day before in negative timezones (#445) +- Fix a bug: JS date is initialized 1 day before in negative timezones (#445) - Fix a bug: user's profile field gender is now marked as required - Fix a bug: logical sequence of invoices references is broken, when using the store module or the payments schedules - Fix a bug: refund invoices may generate duplicates in invoices references @@ -204,11 +310,11 @@ - OpenAPI reservation endpoint will return details for the reserved slots - Display info messages if the user cannot buy prepaid packs - Fix a bug: some OpenAPI endpoints struggle and expire with timeout -- Fix a bug: OpenAPI events endpoint documentation does not refect the returned data +- Fix a bug: OpenAPI events endpoint documentation does not reflect the returned data - Fix a bug: members can't change/cancel their reservations - Fix a bug: admin events view should default to the list tab - Fix a bug: event creation form should not allow setting multiple times the same price category -- Fix a bug: MAX_SIZE env varibles should not be quoted (#438) +- Fix a bug: MAX_SIZE env variables should not be quoted (#438) - Fix a bug: unable to add OIDC scopes without discovery - [BREAKING CHANGE] GET `open_api/v1/events` will necessarily be paginated - [BREAKING CHANGE] GET `open_api/v1/invoices` will necessarily be paginated @@ -247,7 +353,7 @@ - Automatically cancel trainings with insufficient attendees - Check SCSS syntax before saving home page style - Use Time instead of DateTime objects -- Fix a bug: missing statististics subtypes +- Fix a bug: missing statistics subtypes - Fix a bug: wrong times in admin/event monitoring - Fix a bug: daylight saving time is ignored and result in wrong dates and/or times when dealing around the DST day - Fix a bug: date shift in event creation/update @@ -282,7 +388,7 @@ - Fix a bug: invalid duration for machine/spaces reservations in statistics, when using slots of not 1 hour - Fix a bug: invalid month in date format - Fix a bug: do not show theme and age-range fields in event form if no options were set -- Fix a bug: do not show catgory select in plan form if no options were set +- Fix a bug: do not show category select in plan form if no options were set - Fix a bug: new setups doesn't log - [TODO DEPLOY] `rails db:seed` - [TODO DEPLOY] `rails fablab:es:build_stats` THEN `rails fablab:maintenance:regenerate_statistics[2014,1]` @@ -321,7 +427,7 @@ ## v5.6.3 2023 January 9 - Fix a bug: unable to build the docker image (yarn error extracting tar content of undefined failed) -- Fix a security issue: logged users but non-admins can access to analytics data throught the API +- Fix a security issue: logged users but non-admins can access to analytics data through the API ## v5.6.2 2023 January 9 @@ -363,7 +469,7 @@ - OpenAPI endpoint to fetch accounting data - Add reservation deadline parameter (#414) - Verify current password at server side when changing password -- Password strengh indicator +- Password strength indicator - Updated OpenAPI documentation - Updated OpenID Connect documentation - OpenAPI users endpoint offer ability to filter by created_after @@ -371,7 +477,7 @@ - Default accounting codes and labels if not set - Active serving static files from the `/public` folder by default from rails - Display custom error message if the PDF invoice is not found -- Report subsription mismatch with user's group +- Report subscription mismatch with user's group - Added sentry for error reporting - Report details of the due for invoices related to a payment schedule - Migrated plan/machine/space/event forms to react diff --git a/Dockerfile b/Dockerfile index 69e8c020c..437ea175c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,8 @@ RUN apk update && apk upgrade && \ libsass-dev \ libsass \ libc6-compat \ - libidn-dev && \ + libidn-dev \ + shared-mime-info && \ # Install buildtime apk dependencies apk add --update --no-cache --virtual .build-deps \ alpine-sdk \ diff --git a/Gemfile b/Gemfile index f7198a90f..99433f7bb 100644 --- a/Gemfile +++ b/Gemfile @@ -91,9 +91,9 @@ gem 'friendly_id', '~> 5.1.0' gem 'aasm' # Background job processing -gem 'sidekiq', '>= 6.0.7' +gem 'sidekiq', '6.5.12' # Recurring jobs for Sidekiq -gem 'sidekiq-scheduler' +gem 'sidekiq-scheduler', '5.0.3' gem 'sidekiq-unique-jobs', '~> 7.1.23' gem 'stripe', '5.29.0' @@ -153,3 +153,4 @@ gem 'sentry-ruby' gem "reverse_markdown" gem "ancestry" +gem 'silencer', require: false \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 1d41c1961..b798e07fe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -125,7 +125,7 @@ GEM coercible (1.0.0) descendants_tracker (~> 0.0.1) concurrent-ruby (1.2.2) - connection_pool (2.2.5) + connection_pool (2.4.1) coveralls_reborn (0.18.0) simplecov (>= 0.18.1, < 0.20.0) term-ansicolor (~> 1.6) @@ -182,7 +182,7 @@ GEM forgery (0.7.0) friendly_id (5.1.0) activerecord (>= 4.0.0) - fugit (1.5.3) + fugit (1.9.0) et-orbi (~> 1, >= 1.2.7) raabro (~> 1.4) globalid (1.1.0) @@ -428,7 +428,7 @@ GEM nokogiri (>= 1.10.8) rubyzip (>= 1.3.0) rubyzip (2.3.2) - rufus-scheduler (3.8.1) + rufus-scheduler (3.9.1) fugit (~> 1.1, >= 1.1.6) safe_yaml (1.0.5) sassc (2.4.0) @@ -448,20 +448,20 @@ GEM rack-proxy (>= 0.6.1) railties (>= 5.2) semantic_range (>= 2.3.0) - sidekiq (6.4.2) - connection_pool (>= 2.2.2) + sidekiq (6.5.12) + connection_pool (>= 2.2.5, < 3) rack (~> 2.0) - redis (>= 4.2.0) - sidekiq-scheduler (4.0.0) - redis (>= 4.2.0) + redis (>= 4.5.0, < 5) + sidekiq-scheduler (5.0.3) rufus-scheduler (~> 3.2) - sidekiq (>= 4) + sidekiq (>= 6, < 8) tilt (>= 1.4.0) sidekiq-unique-jobs (7.1.23) brpoplpush-redis_script (> 0.1.1, <= 2.0.0) concurrent-ruby (~> 1.0, >= 1.0.5) sidekiq (>= 5.0, < 8.0) thor (>= 0.20, < 3.0) + silencer (2.0.0) simplecov (0.19.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -483,7 +483,7 @@ GEM tins (~> 1.0) thor (1.2.1) thread_safe (0.3.6) - tilt (2.0.10) + tilt (2.3.0) timeout (0.3.2) tins (1.25.0) sync @@ -532,6 +532,7 @@ GEM PLATFORMS x86_64-darwin-20 x86_64-darwin-21 + x86_64-darwin-23 x86_64-linux DEPENDENCIES @@ -608,9 +609,10 @@ DEPENDENCIES sentry-ruby sha3 shakapacker (= 6.6.0) - sidekiq (>= 6.0.7) - sidekiq-scheduler + sidekiq (= 6.5.12) + sidekiq-scheduler (= 5.0.3) sidekiq-unique-jobs (~> 7.1.23) + silencer spring (~> 4) spring-watcher-listen (~> 2.1.0) stripe (= 5.29.0) diff --git a/app/controllers/api/auth_providers_controller.rb b/app/controllers/api/auth_providers_controller.rb index 82fa50388..e975e42f1 100644 --- a/app/controllers/api/auth_providers_controller.rb +++ b/app/controllers/api/auth_providers_controller.rb @@ -3,7 +3,9 @@ # API Controller for resources of type AuthProvider # AuthProvider are used to connect users through single-sign on systems class API::AuthProvidersController < API::APIController + before_action :authenticate_user! before_action :set_provider, only: %i[show update destroy] + def index @providers = policy_scope(AuthProvider) end diff --git a/app/controllers/api/members_controller.rb b/app/controllers/api/members_controller.rb index c98edcc6e..309ae12cd 100644 --- a/app/controllers/api/members_controller.rb +++ b/app/controllers/api/members_controller.rb @@ -67,7 +67,7 @@ class API::MembersController < API::APIController def export_subscriptions authorize :export - export = ExportService.last_export('users/subscription') + export = ExportService.last_export('users/subscriptions') if export.nil? || !FileTest.exist?(export.file) @export = Export.new(category: 'users', export_type: 'subscriptions', user: current_user) if @export.save diff --git a/app/controllers/api/notifications_controller.rb b/app/controllers/api/notifications_controller.rb index c226d2b82..8f8c72c03 100644 --- a/app/controllers/api/notifications_controller.rb +++ b/app/controllers/api/notifications_controller.rb @@ -52,9 +52,9 @@ class API::NotificationsController < API::APIController def polling @notifications = current_user.notifications - .with_valid_notification_type - .where('notifications.is_read = false AND notifications.created_at >= :date', date: params[:last_poll]) - .order('notifications.created_at DESC') + .with_valid_notification_type + .where('notifications.is_read = false AND notifications.created_at >= :date', date: params[:last_poll]) + .order('notifications.created_at DESC') @totals = { total: current_user.notifications.with_valid_notification_type.delivered_in_system(current_user).count, unread: current_user.notifications.with_valid_notification_type.delivered_in_system(current_user).where(is_read: false).count diff --git a/app/controllers/api/projects_controller.rb b/app/controllers/api/projects_controller.rb index a844f7ab3..1b38f40e3 100644 --- a/app/controllers/api/projects_controller.rb +++ b/app/controllers/api/projects_controller.rb @@ -71,7 +71,7 @@ class API::ProjectsController < API::APIController render :index end format.zip do - head :forbidden unless current_user.admin? || current_user.manager? + head :forbidden unless current_user && (current_user.admin? || current_user.manager?) send_data ProjectsArchive.new(res[:projects]).call, filename: "projets.zip", disposition: 'attachment', type: 'application/zip' end diff --git a/app/controllers/api/reservations_controller.rb b/app/controllers/api/reservations_controller.rb index 260fec568..495b95c9b 100644 --- a/app/controllers/api/reservations_controller.rb +++ b/app/controllers/api/reservations_controller.rb @@ -16,8 +16,10 @@ class API::ReservationsController < API::APIController where_clause[:reservable_id] = params[:reservable_id] if params[:reservable_id] @reservations = Reservation.where(where_clause) + .preload(:reservable, :booking_users, :tickets, { statistic_profile: { user: :profile }, slots_reservations: :slot }) elsif params[:reservable_id] && params[:reservable_type] && (current_user.admin? || current_user.manager?) @reservations = Reservation.where(params.permit(:reservable_id, :reservable_type)) + .preload(:reservable, :booking_users, :tickets, { statistic_profile: { user: :profile }, slots_reservations: :slot }) else @reservations = [] end diff --git a/app/controllers/open_api/v1/users_controller.rb b/app/controllers/open_api/v1/users_controller.rb index 91713096d..ad24798d9 100644 --- a/app/controllers/open_api/v1/users_controller.rb +++ b/app/controllers/open_api/v1/users_controller.rb @@ -7,7 +7,9 @@ class OpenAPI::V1::UsersController < OpenAPI::V1::BaseController expose_doc def index - @users = User.order(created_at: :desc).includes(:group, :profile, :invoicing_profile) + @users = InvoicingProfile.order(created_at: :desc).includes(user: %i[group profile statistic_profile]) + + @users = @users.where.not(user_id: nil) if params[:including_deleted_users].blank? if params[:email].present? email_param = params[:email].is_a?(String) ? params[:email].downcase : params[:email].map(&:downcase) diff --git a/app/doc/open_api/v1/users_doc.rb b/app/doc/open_api/v1/users_doc.rb index 731858985..7206f02d9 100644 --- a/app/doc/open_api/v1/users_doc.rb +++ b/app/doc/open_api/v1/users_doc.rb @@ -18,6 +18,7 @@ class OpenAPI::V1::UsersDoc < OpenAPI::V1::BaseDoc param :email, [String, Array], optional: true, desc: 'Filter users by *email* using strict matching.' param :user_id, [Integer, Array], optional: true, desc: 'Filter users by *id* using strict matching.' param :created_after, DateTime, optional: true, desc: 'Filter users to accounts created after the given date.' + param :including_deleted_users, [true, false], optional: true, desc: 'Filter users to accounts deleted or not.' example <<-USERS # /open_api/v1/users?page=1&per_page=4 { diff --git a/app/frontend/src/javascript/components/events/event-form.tsx b/app/frontend/src/javascript/components/events/event-form.tsx index 8102db622..be1330378 100644 --- a/app/frontend/src/javascript/components/events/event-form.tsx +++ b/app/frontend/src/javascript/components/events/event-form.tsx @@ -103,7 +103,7 @@ export const EventForm: React.FC = ({ action, event, onError, on const onSubmit: SubmitHandler = (data: Event) => { setSubmitting(true); if (submitting) return; - if (data.pre_registration_end_date?.toString() === 'Invalid Date') { + if (data.pre_registration_end_date?.toString() === 'Invalid Date' || !data.pre_registration) { data.pre_registration_end_date = null; } if (action === 'update') { @@ -218,7 +218,8 @@ export const EventForm: React.FC = ({ action, event, onError, on id="event_image_attributes" accept="image/*" defaultImage={output.event_image_attributes} - label={t('app.admin.event_form.matching_visual')} /> + label={t('app.admin.event_form.illustration')} + tooltip={t('app.admin.event_form.illustration_recommendation')} /> = FormComponent /** * This component allows to upload image, in forms managed by react-hook-form. */ -export const FormImageUpload = ({ id, label, register, control, defaultImage, className, rules, disabled, error, warning, formState, onFileChange, onFileRemove, accept, setValue, size, onFileIsMain, mainOption = false }: FormImageUploadProps) => { +export const FormImageUpload = ({ id, label, register, control, defaultImage, className, rules, disabled, error, warning, formState, onFileChange, onFileRemove, accept, setValue, size, onFileIsMain, mainOption = false, tooltip }: FormImageUploadProps) => { const { t } = useTranslation('shared'); const [file, setFile] = useState(defaultImage); @@ -125,7 +125,8 @@ export const FormImageUpload = + placeholder={placeholder()} + tooltip={tooltip} /> {hasImage() && } className="is-main" />} diff --git a/app/frontend/src/javascript/components/form/form-input.tsx b/app/frontend/src/javascript/components/form/form-input.tsx index 5a1aed014..493a11904 100644 --- a/app/frontend/src/javascript/components/form/form-input.tsx +++ b/app/frontend/src/javascript/components/form/form-input.tsx @@ -67,11 +67,10 @@ export const FormInput = ({ id, re return num; } if (type === 'date') { - const date: Date = new Date(value + 'T00:00:00'); - if (Number.isNaN(date) && nullable) { + if (Number.isNaN(value) && nullable) { return null; } - return date; + return value; } setCharacterCount(value?.length || 0); return value; diff --git a/app/frontend/src/javascript/components/machines/machine-card.tsx b/app/frontend/src/javascript/components/machines/machine-card.tsx index dd7bb372d..7c0a2770a 100644 --- a/app/frontend/src/javascript/components/machines/machine-card.tsx +++ b/app/frontend/src/javascript/components/machines/machine-card.tsx @@ -58,7 +58,7 @@ const MachineCard: React.FC = ({ user, machine, onShowMachine, return (
{machinePicture()} - {machine.space && user.role === 'admin' && } + {machine.space && user && user.role === 'admin' && }
{machine.name}
diff --git a/app/frontend/src/javascript/components/machines/machine-form.tsx b/app/frontend/src/javascript/components/machines/machine-form.tsx index 886b1e5fa..f000232b3 100644 --- a/app/frontend/src/javascript/components/machines/machine-form.tsx +++ b/app/frontend/src/javascript/components/machines/machine-form.tsx @@ -123,7 +123,8 @@ export const MachineForm: React.FC = ({ action, machine, onErr id="machine_image_attributes" accept="image/*" defaultImage={output.machine_image_attributes} - label={t('app.admin.machine_form.illustration')} /> + label={t('app.admin.machine_form.illustration')} + tooltip={t('app.admin.machine_form.illustration_recommendation')} /> = ({ onSubmit, onSuccess, onE try { const { result } = await PayZenKR.current.validateForm(); if (result === null) { - if (!order) { + if (!order && !updateCard) { await PayzenAPI.checkCart(cart, customer); } await PayZenKR.current.onSubmit(onPaid); diff --git a/app/frontend/src/javascript/components/spaces/space-form.tsx b/app/frontend/src/javascript/components/spaces/space-form.tsx index 9da75107d..722ec55a9 100644 --- a/app/frontend/src/javascript/components/spaces/space-form.tsx +++ b/app/frontend/src/javascript/components/spaces/space-form.tsx @@ -123,7 +123,8 @@ export const SpaceForm: React.FC = ({ action, space, onError, on id="space_image_attributes" accept="image/*" defaultImage={output.space_image_attributes} - label={t('app.admin.space_form.illustration')} /> + label={t('app.admin.space_form.illustration')} + tooltip={t('app.admin.space_form.illustration_recommendation')} /> { + return (supportingDocumentType == null || supportingDocumentType?.document_type === 'User') && (groups.length > 0); + }; + return (
{t('app.admin.settings.account.supporting_documents_type_form.type_form_info')}
- {supportingDocumentType?.document_type === 'User' && + {displayGroupsSelect() &&
+
diff --git a/app/frontend/templates/admin/authentications/index.html b/app/frontend/templates/admin/authentications/index.html index d9f542266..d98ece61d 100644 --- a/app/frontend/templates/admin/authentications/index.html +++ b/app/frontend/templates/admin/authentications/index.html @@ -7,7 +7,7 @@
- + diff --git a/app/frontend/templates/admin/calendar/calendar.html b/app/frontend/templates/admin/calendar/calendar.html index 4bf33cb26..3b7b0b84f 100644 --- a/app/frontend/templates/admin/calendar/calendar.html +++ b/app/frontend/templates/admin/calendar/calendar.html @@ -93,7 +93,7 @@ {{ 'app.admin.calendar.deleted_user' }} - {{ r.start_at | amDateFormat:'LLL' }} - {{ r.end_at | amDateFormat:'LT' }} - {{r.reservable.name}} - +
{{ 'app.admin.calendar.without_reservation' }}
@@ -109,7 +109,7 @@
  • {{m.name}} - +
@@ -126,7 +126,7 @@
  • {{::plan.base_name}} - +
diff --git a/app/frontend/templates/admin/calendar/eventModal.html b/app/frontend/templates/admin/calendar/eventModal.html index 12b0dac7d..0f7d3c551 100644 --- a/app/frontend/templates/admin/calendar/eventModal.html +++ b/app/frontend/templates/admin/calendar/eventModal.html @@ -82,18 +82,18 @@

{{ 'app.admin.calendar.divide_this_availability' }}

-
- - {{ 'app.admin.calendar.slots' }} -
+
+ +
+

{{ 'app.admin.calendar.slots_of' }}

-
- - {{ 'app.admin.calendar.minutes' }} +
+ +
@@ -223,7 +223,7 @@

{{ 'app.admin.calendar.summary' }}

{{ 'app.admin.calendar.about_to_create' | translate:{NUMBER:occurrences.length,TYPE:availability.available_type} }} -
    +
    • {{slot.start_at | amDateFormat:'L LT'}} - {{slot.end_at | amDateFormat:'LT'}}
    @@ -246,12 +246,12 @@
diff --git a/app/frontend/templates/admin/calendar/icalendar.html b/app/frontend/templates/admin/calendar/icalendar.html index edd60ecfe..cee1881e1 100644 --- a/app/frontend/templates/admin/calendar/icalendar.html +++ b/app/frontend/templates/admin/calendar/icalendar.html @@ -86,7 +86,7 @@ switch-animate="true"/>
-
diff --git a/app/frontend/templates/admin/coupons/edit.html b/app/frontend/templates/admin/coupons/edit.html index e7e4597a0..98e78c427 100644 --- a/app/frontend/templates/admin/coupons/edit.html +++ b/app/frontend/templates/admin/coupons/edit.html @@ -31,7 +31,7 @@ diff --git a/app/frontend/templates/admin/coupons/new.html b/app/frontend/templates/admin/coupons/new.html index f4f198cef..9f0019aa2 100644 --- a/app/frontend/templates/admin/coupons/new.html +++ b/app/frontend/templates/admin/coupons/new.html @@ -23,7 +23,7 @@ diff --git a/app/frontend/templates/admin/events/filters.html b/app/frontend/templates/admin/events/filters.html index dd3974b74..4974d8f19 100644 --- a/app/frontend/templates/admin/events/filters.html +++ b/app/frontend/templates/admin/events/filters.html @@ -1,7 +1,7 @@

{{ 'app.admin.events.categories' }}

{{ 'app.admin.events.at_least_one_category_is_required' }}

- +
@@ -19,10 +19,10 @@
- -
@@ -40,7 +40,7 @@

{{ 'app.admin.events.themes' }}

- + @@ -58,10 +58,10 @@
- -
@@ -79,7 +79,7 @@

{{ 'app.admin.events.age_ranges' }}

- + @@ -97,10 +97,10 @@
- -
diff --git a/app/frontend/templates/admin/events/index.html b/app/frontend/templates/admin/events/index.html index 9d4d8bd93..8afb3f5dd 100644 --- a/app/frontend/templates/admin/events/index.html +++ b/app/frontend/templates/admin/events/index.html @@ -13,41 +13,41 @@ - -
-
-
- - - - - - - - - - - - - - - - - -
-
- -
-
-
+ + +
+
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
diff --git a/app/frontend/templates/admin/events/monitoring.html b/app/frontend/templates/admin/events/monitoring.html index ed4aa9d61..37f671a08 100644 --- a/app/frontend/templates/admin/events/monitoring.html +++ b/app/frontend/templates/admin/events/monitoring.html @@ -79,6 +79,6 @@ diff --git a/app/frontend/templates/admin/events/prices.html b/app/frontend/templates/admin/events/prices.html index bcf00aca2..1c2baaa3d 100644 --- a/app/frontend/templates/admin/events/prices.html +++ b/app/frontend/templates/admin/events/prices.html @@ -1,7 +1,7 @@

{{ 'app.admin.events.prices_categories' }}

- + diff --git a/app/frontend/templates/admin/events/reservations.html b/app/frontend/templates/admin/events/reservations.html index 69590232c..2b3cab01f 100644 --- a/app/frontend/templates/admin/events/reservations.html +++ b/app/frontend/templates/admin/events/reservations.html @@ -60,7 +60,7 @@

{{ 'app.admin.event_reservations.no_reservations_for_now' }}

- +
diff --git a/app/frontend/templates/admin/groups/index.html b/app/frontend/templates/admin/groups/index.html index 2bb4fa8aa..9c943b93e 100644 --- a/app/frontend/templates/admin/groups/index.html +++ b/app/frontend/templates/admin/groups/index.html @@ -1,7 +1,6 @@
-
@@ -30,10 +29,10 @@
- -
diff --git a/app/frontend/templates/admin/invoices/accountingExportModal.html b/app/frontend/templates/admin/invoices/accountingExportModal.html index 4d6f97523..c67cc5eee 100644 --- a/app/frontend/templates/admin/invoices/accountingExportModal.html +++ b/app/frontend/templates/admin/invoices/accountingExportModal.html @@ -95,7 +95,7 @@ - + - + diff --git a/app/frontend/templates/admin/invoices/avoirModal.html b/app/frontend/templates/admin/invoices/avoirModal.html index f49217f39..5de448199 100644 --- a/app/frontend/templates/admin/invoices/avoirModal.html +++ b/app/frontend/templates/admin/invoices/avoirModal.html @@ -38,6 +38,6 @@ diff --git a/app/frontend/templates/admin/invoices/closePeriodModal.html b/app/frontend/templates/admin/invoices/closePeriodModal.html index ebc9ca54c..50af814b7 100644 --- a/app/frontend/templates/admin/invoices/closePeriodModal.html +++ b/app/frontend/templates/admin/invoices/closePeriodModal.html @@ -76,6 +76,6 @@ diff --git a/app/frontend/templates/admin/invoices/list.html b/app/frontend/templates/admin/invoices/list.html index 0ba0b00ef..cbaac2cbc 100644 --- a/app/frontend/templates/admin/invoices/list.html +++ b/app/frontend/templates/admin/invoices/list.html @@ -83,7 +83,7 @@
- +

{{ 'app.admin.invoices.no_invoices_for_now' }}

diff --git a/app/frontend/templates/admin/invoices/settings/editCode.html b/app/frontend/templates/admin/invoices/settings/editCode.html index 3ac4e5d2e..6a481647e 100644 --- a/app/frontend/templates/admin/invoices/settings/editCode.html +++ b/app/frontend/templates/admin/invoices/settings/editCode.html @@ -21,7 +21,7 @@
diff --git a/app/frontend/templates/admin/invoices/settings/editNumber.html b/app/frontend/templates/admin/invoices/settings/editNumber.html index c37d107f3..db9c04a0c 100644 --- a/app/frontend/templates/admin/invoices/settings/editNumber.html +++ b/app/frontend/templates/admin/invoices/settings/editNumber.html @@ -25,7 +25,7 @@ diff --git a/app/frontend/templates/admin/invoices/settings/editReference.html b/app/frontend/templates/admin/invoices/settings/editReference.html index 9985cab17..580ac2ef5 100644 --- a/app/frontend/templates/admin/invoices/settings/editReference.html +++ b/app/frontend/templates/admin/invoices/settings/editReference.html @@ -29,7 +29,7 @@ diff --git a/app/frontend/templates/admin/invoices/settings/stripeKeys.html b/app/frontend/templates/admin/invoices/settings/stripeKeys.html index a468239f9..aa87c8ece 100644 --- a/app/frontend/templates/admin/invoices/settings/stripeKeys.html +++ b/app/frontend/templates/admin/invoices/settings/stripeKeys.html @@ -42,7 +42,7 @@ diff --git a/app/frontend/templates/admin/managers/new.html b/app/frontend/templates/admin/managers/new.html index 716e38922..d654b14e5 100644 --- a/app/frontend/templates/admin/managers/new.html +++ b/app/frontend/templates/admin/managers/new.html @@ -25,7 +25,7 @@ diff --git a/app/frontend/templates/admin/members/administrators.html b/app/frontend/templates/admin/members/administrators.html index a714e15dd..ad8c43625 100644 --- a/app/frontend/templates/admin/members/administrators.html +++ b/app/frontend/templates/admin/members/administrators.html @@ -7,7 +7,7 @@
- diff --git a/app/frontend/templates/admin/members/edit.html b/app/frontend/templates/admin/members/edit.html index c3a01fbb6..ff91767bd 100644 --- a/app/frontend/templates/admin/members/edit.html +++ b/app/frontend/templates/admin/members/edit.html @@ -62,14 +62,14 @@ - - - - + + + +
- +

{{ 'app.admin.members_edit.cannot_credit_own_wallet' }} diff --git a/app/frontend/templates/admin/members/import.html b/app/frontend/templates/admin/members/import.html index b72a77154..c18eacc5b 100644 --- a/app/frontend/templates/admin/members/import.html +++ b/app/frontend/templates/admin/members/import.html @@ -163,7 +163,7 @@

diff --git a/app/frontend/templates/admin/members/managers.html b/app/frontend/templates/admin/members/managers.html index 8cb73451c..282f4a902 100644 --- a/app/frontend/templates/admin/members/managers.html +++ b/app/frontend/templates/admin/members/managers.html @@ -11,7 +11,7 @@
- diff --git a/app/frontend/templates/admin/members/members.html b/app/frontend/templates/admin/members/members.html index 22fe77590..e02f954a8 100644 --- a/app/frontend/templates/admin/members/members.html +++ b/app/frontend/templates/admin/members/members.html @@ -19,7 +19,7 @@
-
@@ -40,6 +40,6 @@
- +
diff --git a/app/frontend/templates/admin/members/partners.html b/app/frontend/templates/admin/members/partners.html index a01401ce0..e844c52f5 100644 --- a/app/frontend/templates/admin/members/partners.html +++ b/app/frontend/templates/admin/members/partners.html @@ -11,7 +11,7 @@
- + diff --git a/app/frontend/templates/admin/open_api_clients/index.html.erb b/app/frontend/templates/admin/open_api_clients/index.html.erb index b9ea45aed..71ddd37ae 100644 --- a/app/frontend/templates/admin/open_api_clients/index.html.erb +++ b/app/frontend/templates/admin/open_api_clients/index.html.erb @@ -15,7 +15,7 @@
diff --git a/app/frontend/templates/admin/pricing/coupons.html b/app/frontend/templates/admin/pricing/coupons.html index b1118e4cb..ab076fb30 100644 --- a/app/frontend/templates/admin/pricing/coupons.html +++ b/app/frontend/templates/admin/pricing/coupons.html @@ -1,7 +1,7 @@

{{ 'app.admin.pricing.list_of_the_coupons' }}

- @@ -44,5 +44,5 @@
- +
diff --git a/app/frontend/templates/admin/pricing/credits.html b/app/frontend/templates/admin/pricing/credits.html index b4e0c193b..794ded221 100644 --- a/app/frontend/templates/admin/pricing/credits.html +++ b/app/frontend/templates/admin/pricing/credits.html @@ -27,15 +27,15 @@
- -
-
@@ -48,7 +48,7 @@

{{ 'app.admin.pricing.machines' }}

- +
@@ -79,18 +79,18 @@
- -
- -
@@ -103,7 +103,7 @@

{{ 'app.admin.pricing.spaces' }}

- +
@@ -133,18 +133,18 @@
- -
- -
diff --git a/app/frontend/templates/admin/pricing/sendCoupon.html b/app/frontend/templates/admin/pricing/sendCoupon.html index 83e63e536..f3e37a681 100644 --- a/app/frontend/templates/admin/pricing/sendCoupon.html +++ b/app/frontend/templates/admin/pricing/sendCoupon.html @@ -25,6 +25,6 @@ diff --git a/app/frontend/templates/admin/pricing/subscriptions.html b/app/frontend/templates/admin/pricing/subscriptions.html index 100db083e..a15d43f62 100644 --- a/app/frontend/templates/admin/pricing/subscriptions.html +++ b/app/frontend/templates/admin/pricing/subscriptions.html @@ -6,7 +6,7 @@
- diff --git a/app/frontend/templates/admin/projects/index.html b/app/frontend/templates/admin/projects/index.html index c1cf88997..84b46ccdd 100644 --- a/app/frontend/templates/admin/projects/index.html +++ b/app/frontend/templates/admin/projects/index.html @@ -12,7 +12,7 @@
diff --git a/app/frontend/templates/admin/projects/licences.html b/app/frontend/templates/admin/projects/licences.html index e60a0b6fe..a248b0491 100644 --- a/app/frontend/templates/admin/projects/licences.html +++ b/app/frontend/templates/admin/projects/licences.html @@ -1,4 +1,4 @@ - + @@ -23,18 +23,18 @@
- -
- -
diff --git a/app/frontend/templates/admin/projects/materials.html b/app/frontend/templates/admin/projects/materials.html index f74b94113..b61f8378c 100644 --- a/app/frontend/templates/admin/projects/materials.html +++ b/app/frontend/templates/admin/projects/materials.html @@ -1,4 +1,4 @@ - + @@ -17,18 +17,18 @@
- -
- -
diff --git a/app/frontend/templates/admin/projects/project_categories.html b/app/frontend/templates/admin/projects/project_categories.html index 37881502e..077fabd2a 100644 --- a/app/frontend/templates/admin/projects/project_categories.html +++ b/app/frontend/templates/admin/projects/project_categories.html @@ -1,4 +1,4 @@ - + @@ -16,18 +16,18 @@
- -
- -
diff --git a/app/frontend/templates/admin/projects/settings.html b/app/frontend/templates/admin/projects/settings.html index a192e5f89..0cd7b06e0 100644 --- a/app/frontend/templates/admin/projects/settings.html +++ b/app/frontend/templates/admin/projects/settings.html @@ -56,7 +56,7 @@ - + diff --git a/app/frontend/templates/admin/projects/themes.html b/app/frontend/templates/admin/projects/themes.html index d56998fdb..a0de16f7c 100644 --- a/app/frontend/templates/admin/projects/themes.html +++ b/app/frontend/templates/admin/projects/themes.html @@ -1,4 +1,4 @@ - + @@ -17,18 +17,18 @@ diff --git a/app/views/notifications_mailer/notify_admin_payment_schedule_check_deadline.html.erb b/app/views/notifications_mailer/notify_admin_payment_schedule_check_deadline.html.erb index 5cdc9b065..9666b59b5 100644 --- a/app/views/notifications_mailer/notify_admin_payment_schedule_check_deadline.html.erb +++ b/app/views/notifications_mailer/notify_admin_payment_schedule_check_deadline.html.erb @@ -3,7 +3,7 @@

<%= t('.body.remember', REFERENCE: @attached_object.payment_schedule.reference, - AMOUNT: number_to_currency(@attached_object.amount / 100.00), + AMOUNT: number_to_currency(@attached_object.amount / 100.00, locale: CURRENCY_LOCALE), DATE: I18n.l(@attached_object.due_date, format: :long)) %> <%= t('.body.date') %>

diff --git a/app/views/notifications_mailer/notify_admin_payment_schedule_error.html.erb b/app/views/notifications_mailer/notify_admin_payment_schedule_error.html.erb index 3566d4983..4883a48b4 100644 --- a/app/views/notifications_mailer/notify_admin_payment_schedule_error.html.erb +++ b/app/views/notifications_mailer/notify_admin_payment_schedule_error.html.erb @@ -3,7 +3,7 @@

<%= t('.body.remember', REFERENCE: @attached_object.payment_schedule.reference, - AMOUNT: number_to_currency(@attached_object.amount / 100.00), + AMOUNT: number_to_currency(@attached_object.amount / 100.00, locale: CURRENCY_LOCALE), DATE: I18n.l(@attached_object.due_date, format: :long)) %> <%= t('.body.error', GATEWAY: @attached_object.payment_gateway_object.gateway_object.gateway) %>

diff --git a/app/views/notifications_mailer/notify_admin_payment_schedule_failed.html.erb b/app/views/notifications_mailer/notify_admin_payment_schedule_failed.html.erb index 57eb813ba..7f266b240 100644 --- a/app/views/notifications_mailer/notify_admin_payment_schedule_failed.html.erb +++ b/app/views/notifications_mailer/notify_admin_payment_schedule_failed.html.erb @@ -3,7 +3,7 @@

<%= t('.body.remember', REFERENCE: @attached_object.payment_schedule.reference, - AMOUNT: number_to_currency(@attached_object.amount / 100.00), + AMOUNT: number_to_currency(@attached_object.amount / 100.00, locale: CURRENCY_LOCALE), DATE: I18n.l(@attached_object.due_date, format: :long)) %> <%= t('.body.error') %>

diff --git a/app/views/notifications_mailer/notify_admin_payment_schedule_transfer_deadline.html.erb b/app/views/notifications_mailer/notify_admin_payment_schedule_transfer_deadline.html.erb index 5cdc9b065..9666b59b5 100644 --- a/app/views/notifications_mailer/notify_admin_payment_schedule_transfer_deadline.html.erb +++ b/app/views/notifications_mailer/notify_admin_payment_schedule_transfer_deadline.html.erb @@ -3,7 +3,7 @@

<%= t('.body.remember', REFERENCE: @attached_object.payment_schedule.reference, - AMOUNT: number_to_currency(@attached_object.amount / 100.00), + AMOUNT: number_to_currency(@attached_object.amount / 100.00, locale: CURRENCY_LOCALE), DATE: I18n.l(@attached_object.due_date, format: :long)) %> <%= t('.body.date') %>

diff --git a/app/views/notifications_mailer/notify_admin_refund_created.html.erb b/app/views/notifications_mailer/notify_admin_refund_created.html.erb index c4c1941ba..837c1e366 100644 --- a/app/views/notifications_mailer/notify_admin_refund_created.html.erb +++ b/app/views/notifications_mailer/notify_admin_refund_created.html.erb @@ -1,11 +1,11 @@ <%= render 'notifications_mailer/shared/hello', recipient: @recipient %>

<%= t('.body.refund_created', - AMOUNT: number_to_currency(@attached_object.total / 100.00), + AMOUNT: number_to_currency(@attached_object.total / 100.00, locale: CURRENCY_LOCALE), INVOICE: @attached_object.invoice.reference, USER: @attached_object.invoicing_profile&.full_name) if @attached_object.invoice %> <%= t('.body.wallet_refund_created', - AMOUNT: number_to_currency(@attached_object.total / 100.00), + AMOUNT: number_to_currency(@attached_object.total / 100.00, locale: CURRENCY_LOCALE), USER: @attached_object.invoicing_profile&.full_name) if @attached_object.main_item.object_type === WalletTransaction.name %>

" target="_blank"><%= t('.body.download') %>

diff --git a/app/views/notifications_mailer/notify_admin_user_wallet_is_credited.html.erb b/app/views/notifications_mailer/notify_admin_user_wallet_is_credited.html.erb index b03e5aad2..45d7deac6 100644 --- a/app/views/notifications_mailer/notify_admin_user_wallet_is_credited.html.erb +++ b/app/views/notifications_mailer/notify_admin_user_wallet_is_credited.html.erb @@ -2,7 +2,7 @@ <%= render 'notifications_mailer/shared/hello', recipient: @recipient %>

<%= t('.body.wallet_credit_html', - AMOUNT: number_to_currency(@attached_object.amount), + AMOUNT: number_to_currency(@attached_object.amount, locale: CURRENCY_LOCALE), USER: @attached_object.wallet.user&.profile&.full_name || t('api.notifications.deleted_user'), ADMIN: @attached_object.user&.profile&.full_name || t('api.notifications.deleted_user')) %> diff --git a/app/views/notifications_mailer/notify_member_about_coupon.html.erb b/app/views/notifications_mailer/notify_member_about_coupon.html.erb index 6a664eecf..797811304 100644 --- a/app/views/notifications_mailer/notify_member_about_coupon.html.erb +++ b/app/views/notifications_mailer/notify_member_about_coupon.html.erb @@ -8,7 +8,7 @@

<% else %>

<%= t('.body.enjoy_a_discount_of_AMOUNT_with_code_CODE', - AMOUNT: number_to_currency(@attached_object.amount_off / 100.00), + AMOUNT: number_to_currency(@attached_object.amount_off / 100.00, locale: CURRENCY_LOCALE), CODE: @attached_object.code ) %>

diff --git a/app/views/notifications_mailer/notify_member_avoir_ready.html.erb b/app/views/notifications_mailer/notify_member_avoir_ready.html.erb index 01bc5066b..cbbee932b 100644 --- a/app/views/notifications_mailer/notify_member_avoir_ready.html.erb +++ b/app/views/notifications_mailer/notify_member_avoir_ready.html.erb @@ -4,7 +4,7 @@ <%= _t('.body.please_find_attached_html', { DATE: I18n.l(@attached_object.avoir_date.to_date), - AMOUNT: number_to_currency(@attached_object.total / 100.0), + AMOUNT: number_to_currency(@attached_object.total / 100.0, locale: CURRENCY_LOCALE), TYPE: @attached_object.main_item.object_type }) # messageFormat diff --git a/app/views/notifications_mailer/notify_member_invoice_ready.html.erb b/app/views/notifications_mailer/notify_member_invoice_ready.html.erb index 6636dcd38..31dbf366d 100644 --- a/app/views/notifications_mailer/notify_member_invoice_ready.html.erb +++ b/app/views/notifications_mailer/notify_member_invoice_ready.html.erb @@ -4,7 +4,7 @@ <%= _t('.body.please_find_attached_html', { DATE: I18n.l(@attached_object.created_at.to_date), - AMOUNT: number_to_currency(@attached_object.total / 100.0), + AMOUNT: number_to_currency(@attached_object.total / 100.0, locale: CURRENCY_LOCALE), TYPE: @attached_object.main_item.object_type }) # messageFormat diff --git a/app/views/notifications_mailer/notify_member_payment_schedule_failed.html.erb b/app/views/notifications_mailer/notify_member_payment_schedule_failed.html.erb index 584de552c..1be062e61 100644 --- a/app/views/notifications_mailer/notify_member_payment_schedule_failed.html.erb +++ b/app/views/notifications_mailer/notify_member_payment_schedule_failed.html.erb @@ -3,7 +3,7 @@

<%= t('.body.remember', REFERENCE: @attached_object.payment_schedule.reference, - AMOUNT: number_to_currency(@attached_object.amount / 100.00), + AMOUNT: number_to_currency(@attached_object.amount / 100.00, locale: CURRENCY_LOCALE), DATE: I18n.l(@attached_object.due_date, format: :long)) %> <%= t('.body.error') %>

diff --git a/app/views/notifications_mailer/notify_member_payment_schedule_gateway_canceled.html.erb b/app/views/notifications_mailer/notify_member_payment_schedule_gateway_canceled.html.erb index 57eb813ba..7f266b240 100644 --- a/app/views/notifications_mailer/notify_member_payment_schedule_gateway_canceled.html.erb +++ b/app/views/notifications_mailer/notify_member_payment_schedule_gateway_canceled.html.erb @@ -3,7 +3,7 @@

<%= t('.body.remember', REFERENCE: @attached_object.payment_schedule.reference, - AMOUNT: number_to_currency(@attached_object.amount / 100.00), + AMOUNT: number_to_currency(@attached_object.amount / 100.00, locale: CURRENCY_LOCALE), DATE: I18n.l(@attached_object.due_date, format: :long)) %> <%= t('.body.error') %>

diff --git a/app/views/notifications_mailer/notify_member_payment_schedule_ready.html.erb b/app/views/notifications_mailer/notify_member_payment_schedule_ready.html.erb index 0f2ed1bf0..91a518b65 100644 --- a/app/views/notifications_mailer/notify_member_payment_schedule_ready.html.erb +++ b/app/views/notifications_mailer/notify_member_payment_schedule_ready.html.erb @@ -4,7 +4,7 @@ <%= _t('.body.please_find_attached_html', { DATE: I18n.l(@attached_object.created_at.to_date), - AMOUNT: number_to_currency(@attached_object.total / 100.0), + AMOUNT: number_to_currency(@attached_object.total / 100.0, locale: CURRENCY_LOCALE), TYPE: @attached_object.main_object.object_type }) # messageFormat diff --git a/app/views/notifications_mailer/notify_member_reservation_invalidated.html.erb b/app/views/notifications_mailer/notify_member_reservation_invalidated.html.erb index caa17bc2c..f29e64cef 100644 --- a/app/views/notifications_mailer/notify_member_reservation_invalidated.html.erb +++ b/app/views/notifications_mailer/notify_member_reservation_invalidated.html.erb @@ -1,3 +1,3 @@ <%= render 'notifications_mailer/shared/hello', recipient: @recipient %> -

<%= t('.body.reservation_invalidated_html', RESERVATION: @attached_object.reservable.name) %>

+

<%= t('.body.reservation_invalidated_html', RESERVABLE: @attached_object.reservable.name) %>

diff --git a/app/views/notifications_mailer/notify_member_reservation_validated.html.erb b/app/views/notifications_mailer/notify_member_reservation_validated.html.erb index 635bb1e98..8a2c1b20d 100644 --- a/app/views/notifications_mailer/notify_member_reservation_validated.html.erb +++ b/app/views/notifications_mailer/notify_member_reservation_validated.html.erb @@ -1,6 +1,6 @@ <%= render 'notifications_mailer/shared/hello', recipient: @recipient %> -

<%= t('.body.reservation_validated_html', RESERVATION: @attached_object.reservable.name) %>

+

<%= t('.body.reservation_validated_html', RESERVABLE: @attached_object.reservable.name) %>

<%= t('.body.your_reserved_slots') %>

- -
- -
diff --git a/app/frontend/templates/admin/settings/about.html b/app/frontend/templates/admin/settings/about.html index b40671d23..cbf4fc131 100644 --- a/app/frontend/templates/admin/settings/about.html +++ b/app/frontend/templates/admin/settings/about.html @@ -23,7 +23,7 @@

{{ 'app.admin.settings.shift_enter_to_force_carriage_return' | translate }} - +
@@ -41,7 +41,7 @@ {{ 'app.admin.settings.drag_and_drop_to_insert_images' | translate }} (max. 1200px) - +
{{ 'app.admin.settings.shift_enter_to_force_carriage_return' | translate }} - +

{{ 'app.admin.settings.about_follow_us' }}

diff --git a/app/frontend/templates/admin/settings/analyticsModal.html b/app/frontend/templates/admin/settings/analyticsModal.html index 0236e545e..ac4d68d75 100644 --- a/app/frontend/templates/admin/settings/analyticsModal.html +++ b/app/frontend/templates/admin/settings/analyticsModal.html @@ -30,5 +30,5 @@
diff --git a/app/frontend/templates/admin/settings/compte.html b/app/frontend/templates/admin/settings/compte.html index 241196c69..44f0f14a9 100644 --- a/app/frontend/templates/admin/settings/compte.html +++ b/app/frontend/templates/admin/settings/compte.html @@ -105,28 +105,6 @@ -
-
- {{ 'app.admin.settings.accounts_management' }} -
-
-
-

{{ 'app.admin.settings.members_list' }}

-

- {{ 'app.admin.settings.members_list_info' }} -

-
- - -
-
-
-
-
{{ 'app.admin.settings.account.customize_account_settings' }} diff --git a/app/frontend/templates/admin/settings/general.html b/app/frontend/templates/admin/settings/general.html index 36b6971a8..83bd64e34 100644 --- a/app/frontend/templates/admin/settings/general.html +++ b/app/frontend/templates/admin/settings/general.html @@ -31,7 +31,7 @@ {{ 'app.admin.settings.general.neutral' | translate }} {{ 'app.admin.settings.general.eg' | translate }} {{ 'app.admin.settings.general.the_team' | translate }} {{ 'app.admin.settings.general.neutral_preposition' }} {{allSettings.fablab_name}}
- +
@@ -57,7 +57,7 @@ }'> - +

{{ 'app.admin.settings.warning_message_of_the_training_booking_page'}}

@@ -70,7 +70,7 @@ }'>
- +

{{ 'app.admin.settings.information_message_of_the_training_reservation_page'}}

@@ -83,7 +83,7 @@ }'>
- +

{{ 'app.admin.settings.message_of_the_subscriptions_page' }}

@@ -95,7 +95,7 @@ "targetBlank": true }'>
- +

{{ 'app.admin.settings.message_of_the_events_page' }}

@@ -107,7 +107,7 @@ "targetBlank": true }'>
- +

{{ 'app.admin.settings.message_of_the_spaces_page' }}

@@ -119,7 +119,7 @@ "targetBlank": true }'>
- + @@ -154,7 +154,7 @@ - +
@@ -178,7 +178,7 @@
- + @@ -219,7 +219,7 @@ - +
@@ -245,7 +245,7 @@
- +
@@ -271,7 +271,7 @@
- + @@ -288,7 +288,7 @@
- +
@@ -304,7 +304,7 @@
- +
@@ -332,8 +332,9 @@ - - + + {{ 'app.admin.settings.background_picture_recommendation' }} + diff --git a/app/frontend/templates/admin/settings/home_page.html b/app/frontend/templates/admin/settings/home_page.html index dfa3073af..2cfbc93fb 100644 --- a/app/frontend/templates/admin/settings/home_page.html +++ b/app/frontend/templates/admin/settings/home_page.html @@ -3,12 +3,12 @@

{{ 'app.admin.settings.customize_home_page' }}

- + - +
@@ -24,7 +24,7 @@ }'>
{{ 'app.admin.settings.leave_it_empty_to_not_bring_up_any_news_on_the_home_page' | translate }} - +
{{ 'app.admin.settings.home_css_notice_html' }}

- +
diff --git a/app/frontend/templates/admin/settings/newSelectOption.html b/app/frontend/templates/admin/settings/newSelectOption.html index 5be384d90..e9598fcfb 100644 --- a/app/frontend/templates/admin/settings/newSelectOption.html +++ b/app/frontend/templates/admin/settings/newSelectOption.html @@ -9,7 +9,7 @@ diff --git a/app/frontend/templates/admin/settings/number.html b/app/frontend/templates/admin/settings/number.html index 833b8dbf1..c0dc68f77 100644 --- a/app/frontend/templates/admin/settings/number.html +++ b/app/frontend/templates/admin/settings/number.html @@ -11,5 +11,5 @@ {{ helperText | translate }} - + diff --git a/app/frontend/templates/admin/settings/privacy.html b/app/frontend/templates/admin/settings/privacy.html index da577abcc..16ae6ab32 100644 --- a/app/frontend/templates/admin/settings/privacy.html +++ b/app/frontend/templates/admin/settings/privacy.html @@ -15,7 +15,7 @@ {{ 'app.admin.settings.drag_and_drop_to_insert_images' | translate }} - +
- +
diff --git a/app/frontend/templates/admin/settings/reservations.html b/app/frontend/templates/admin/settings/reservations.html index 104e2458b..d3a59e504 100644 --- a/app/frontend/templates/admin/settings/reservations.html +++ b/app/frontend/templates/admin/settings/reservations.html @@ -11,14 +11,14 @@
- +

{{ 'app.admin.settings.closing_time' }}

- +
@@ -269,7 +269,7 @@

{{ 'app.admin.settings.reservation_context_options' }}

- + @@ -299,18 +299,18 @@
- -
- -
diff --git a/app/frontend/templates/admin/settings/save_policy.html b/app/frontend/templates/admin/settings/save_policy.html index 5d608f5c7..fe7893425 100644 --- a/app/frontend/templates/admin/settings/save_policy.html +++ b/app/frontend/templates/admin/settings/save_policy.html @@ -6,7 +6,7 @@

{{ 'app.admin.settings.privacy.publish_will_notify' }}

diff --git a/app/frontend/templates/admin/settings/select-multiple.html b/app/frontend/templates/admin/settings/select-multiple.html index 1a020aed7..bb868651b 100644 --- a/app/frontend/templates/admin/settings/select-multiple.html +++ b/app/frontend/templates/admin/settings/select-multiple.html @@ -13,5 +13,5 @@ - + diff --git a/app/frontend/templates/admin/settings/select.html b/app/frontend/templates/admin/settings/select.html index f17fa48b8..d469d36eb 100644 --- a/app/frontend/templates/admin/settings/select.html +++ b/app/frontend/templates/admin/settings/select.html @@ -12,5 +12,5 @@ - + diff --git a/app/frontend/templates/admin/settings/text.html b/app/frontend/templates/admin/settings/text.html index ffcb1966e..ddd51ebe5 100644 --- a/app/frontend/templates/admin/settings/text.html +++ b/app/frontend/templates/admin/settings/text.html @@ -17,5 +17,5 @@ ng-readonly="readOnly"> - + diff --git a/app/frontend/templates/admin/statistics/graphs.html b/app/frontend/templates/admin/statistics/graphs.html index 6bc3b9ac2..6f1f6561b 100644 --- a/app/frontend/templates/admin/statistics/graphs.html +++ b/app/frontend/templates/admin/statistics/graphs.html @@ -12,7 +12,7 @@ diff --git a/app/frontend/templates/admin/statistics/index.html b/app/frontend/templates/admin/statistics/index.html index 7a85e3f04..75afdadfa 100644 --- a/app/frontend/templates/admin/statistics/index.html +++ b/app/frontend/templates/admin/statistics/index.html @@ -12,9 +12,9 @@ @@ -299,7 +299,7 @@
- +
diff --git a/app/frontend/templates/admin/tags/index.html b/app/frontend/templates/admin/tags/index.html index ece11564c..910152fdd 100644 --- a/app/frontend/templates/admin/tags/index.html +++ b/app/frontend/templates/admin/tags/index.html @@ -1,4 +1,4 @@ - + @@ -16,18 +16,18 @@
- -
- -
diff --git a/app/frontend/templates/admin/trainings/modal_edit.html b/app/frontend/templates/admin/trainings/modal_edit.html index a4171f2f1..44db2caa6 100644 --- a/app/frontend/templates/admin/trainings/modal_edit.html +++ b/app/frontend/templates/admin/trainings/modal_edit.html @@ -10,5 +10,5 @@ diff --git a/app/frontend/templates/admin/trainings/validTrainingModal.html b/app/frontend/templates/admin/trainings/validTrainingModal.html index 868fd45e9..08902c78f 100644 --- a/app/frontend/templates/admin/trainings/validTrainingModal.html +++ b/app/frontend/templates/admin/trainings/validTrainingModal.html @@ -16,6 +16,6 @@

{{ 'app.admin.trainings.no_reservation' }}

diff --git a/app/frontend/templates/admin/versions/upgradeModal.html b/app/frontend/templates/admin/versions/upgradeModal.html index 6bc7343e6..1f033f973 100644 --- a/app/frontend/templates/admin/versions/upgradeModal.html +++ b/app/frontend/templates/admin/versions/upgradeModal.html @@ -15,5 +15,5 @@

diff --git a/app/frontend/templates/dashboard/projects.html b/app/frontend/templates/dashboard/projects.html index 8621f7808..7a0fce689 100644 --- a/app/frontend/templates/dashboard/projects.html +++ b/app/frontend/templates/dashboard/projects.html @@ -10,7 +10,7 @@
{{ 'app.logged.dashboard.projects.you_dont_have_any_projects' }}
@@ -20,7 +20,7 @@ {{project.author_id == currentUser.id ? 'app.logged.dashboard.projects.author' : 'app.logged.dashboard.projects.collaborator' | translate}} {{ 'app.logged.dashboard.projects.rough_draft' }}
diff --git a/app/frontend/templates/dashboard/settings.html b/app/frontend/templates/dashboard/settings.html index 5d7e3da3c..6eee1e415 100644 --- a/app/frontend/templates/dashboard/settings.html +++ b/app/frontend/templates/dashboard/settings.html @@ -31,7 +31,7 @@
-
{{ 'app.logged.dashboard.settings.no_subscriptions' | translate }}
{{ 'app.logged.dashboard.settings.i_want_to_subscribe' }}
+
{{ 'app.logged.dashboard.settings.no_subscriptions' | translate }}
{{ 'app.logged.dashboard.settings.i_want_to_subscribe' }}
@@ -70,10 +70,10 @@
{{ 'app.logged.dashboard.settings.cookies_accepted' }}
{{ 'app.logged.dashboard.settings.cookies_declined' }}
{{ 'app.logged.dashboard.settings.cookies_unset' }}
- +
- +
@@ -94,13 +94,13 @@
- + {{ 'app.logged.dashboard.settings.change_my_data' | translate }}

{{ 'app.logged.dashboard.settings.once_your_data_are_up_to_date_' | translate }} {{ 'app.logged.dashboard.settings._click_on_the_synchronization_button_opposite_' }} {{ 'app.logged.dashboard.settings.or' | translate}} {{ 'app.logged.dashboard.settings._disconnect_then_reconnect_' }} {{ 'app.logged.dashboard.settings._for_your_changes_to_take_effect' | translate }}

diff --git a/app/frontend/templates/events/deleteRecurrent.html b/app/frontend/templates/events/deleteRecurrent.html index 9ed1a1847..90acecbf8 100644 --- a/app/frontend/templates/events/deleteRecurrent.html +++ b/app/frontend/templates/events/deleteRecurrent.html @@ -5,6 +5,7 @@ - @@ -266,11 +266,11 @@
diff --git a/app/frontend/templates/home/members.html b/app/frontend/templates/home/members.html index e39df627d..876828a00 100644 --- a/app/frontend/templates/home/members.html +++ b/app/frontend/templates/home/members.html @@ -18,10 +18,10 @@
- +
- +
diff --git a/app/frontend/templates/machines/show.html b/app/frontend/templates/machines/show.html index a56e8f9c9..31c75e0d9 100644 --- a/app/frontend/templates/machines/show.html +++ b/app/frontend/templates/machines/show.html @@ -16,7 +16,7 @@ diff --git a/app/frontend/templates/members/index.html b/app/frontend/templates/members/index.html index 0acbcbc2e..0f193771e 100644 --- a/app/frontend/templates/members/index.html +++ b/app/frontend/templates/members/index.html @@ -40,7 +40,7 @@
{{ member.email }}
-
@@ -49,7 +49,7 @@
- +

{{ 'app.logged.members.no_members_for_now' }}

diff --git a/app/frontend/templates/members/show.html b/app/frontend/templates/members/show.html index c538d76f5..5b30f7d03 100644 --- a/app/frontend/templates/members/show.html +++ b/app/frontend/templates/members/show.html @@ -15,7 +15,7 @@ diff --git a/app/frontend/templates/profile/_token.html b/app/frontend/templates/profile/_token.html index 2c9b5a166..42b5bbe99 100644 --- a/app/frontend/templates/profile/_token.html +++ b/app/frontend/templates/profile/_token.html @@ -23,7 +23,7 @@ diff --git a/app/frontend/templates/projects/_form.html b/app/frontend/templates/projects/_form.html index 14590b707..5456aae15 100644 --- a/app/frontend/templates/projects/_form.html +++ b/app/frontend/templates/projects/_form.html @@ -28,12 +28,13 @@
+ {{ 'app.shared.project.illustration_recommendation' }}
- {{ 'app.shared.project.add_an_illustration' | translate }} {{ 'app.shared.buttons.change' }} + {{ 'app.shared.project.add_an_illustration' | translate }} {{ 'app.shared.buttons.change' }} - {{ 'app.shared.buttons.delete' }} + {{ 'app.shared.buttons.delete' }}
@@ -63,7 +64,7 @@ - {{ 'app.shared.project.add_a_new_file' | translate }} + {{ 'app.shared.project.add_a_new_file' | translate }} @@ -83,7 +84,7 @@
-
- {{ 'app.shared.buttons.browse' | translate }} {{ 'app.shared.buttons.change' }} + {{ 'app.shared.buttons.browse' | translate }} {{ 'app.shared.buttons.change' }} - {{ 'app.shared.buttons.delete' }} + {{ 'app.shared.buttons.delete' }}
- + {{ 'app.shared.project.add_a_new_step' }} @@ -148,12 +149,12 @@ diff --git a/app/frontend/templates/projects/edit.html b/app/frontend/templates/projects/edit.html index dd14a9b70..8b9db5ae1 100644 --- a/app/frontend/templates/projects/edit.html +++ b/app/frontend/templates/projects/edit.html @@ -18,9 +18,9 @@
- -
{{ 'app.logged.projects_edit.publish' }}
+
{{ 'app.logged.projects_edit.publish' }}
diff --git a/app/frontend/templates/projects/index.html b/app/frontend/templates/projects/index.html index fde57a138..1fd2dca66 100644 --- a/app/frontend/templates/projects/index.html +++ b/app/frontend/templates/projects/index.html @@ -13,7 +13,7 @@ @@ -42,7 +42,7 @@
- +
@@ -108,7 +108,7 @@ @@ -126,8 +126,7 @@

{{project.name}}

{{ project.app_name }} - - {{ 'app.public.projects_list.load_next_projects' }} + {{ 'app.public.projects_list.load_next_projects' }} diff --git a/app/frontend/templates/projects/show.html b/app/frontend/templates/projects/show.html index d9c59ce2f..ba8d332ad 100644 --- a/app/frontend/templates/projects/show.html +++ b/app/frontend/templates/projects/show.html @@ -16,8 +16,8 @@ diff --git a/app/frontend/templates/shared/ConfirmationNewModal.html b/app/frontend/templates/shared/ConfirmationNewModal.html index e183e6928..c2eefd77b 100644 --- a/app/frontend/templates/shared/ConfirmationNewModal.html +++ b/app/frontend/templates/shared/ConfirmationNewModal.html @@ -27,7 +27,7 @@ diff --git a/app/frontend/templates/shared/_cart.html b/app/frontend/templates/shared/_cart.html index 488bf509a..cb1d98827 100644 --- a/app/frontend/templates/shared/_cart.html +++ b/app/frontend/templates/shared/_cart.html @@ -57,7 +57,7 @@
- +
@@ -68,7 +68,7 @@

{{ 'app.shared.cart.to_benefit_from_attractive_prices' }}

-
+

{{ 'app.shared.cart.or' }}

@@ -103,7 +103,7 @@
diff --git a/app/frontend/templates/shared/_partner_new_modal.html b/app/frontend/templates/shared/_partner_new_modal.html index 3cc9f036f..af5656b77 100644 --- a/app/frontend/templates/shared/_partner_new_modal.html +++ b/app/frontend/templates/shared/_partner_new_modal.html @@ -1,35 +1,35 @@ diff --git a/app/frontend/templates/shared/confirm_modify_slot_modal.html b/app/frontend/templates/shared/confirm_modify_slot_modal.html index bc78c162a..b6987fa43 100644 --- a/app/frontend/templates/shared/confirm_modify_slot_modal.html +++ b/app/frontend/templates/shared/confirm_modify_slot_modal.html @@ -7,8 +7,8 @@

{{ 'app.shared.confirm_modify_slot_modal.do_you_want_to_change_NAME_s_booking_slot_initially_planned_at' }}

{{object.start | amDateFormat: 'LL'}} : {{object.start | amDateFormat:'LT'}} - {{object.end | amDateFormat:'LT'}}

- diff --git a/app/frontend/templates/shared/passwordNewModal.html b/app/frontend/templates/shared/passwordNewModal.html index 4101b3f60..15c63247e 100644 --- a/app/frontend/templates/shared/passwordNewModal.html +++ b/app/frontend/templates/shared/passwordNewModal.html @@ -26,7 +26,7 @@ diff --git a/app/frontend/templates/shared/signupModal.html b/app/frontend/templates/shared/signupModal.html index 00413f4d7..0d5b79d27 100644 --- a/app/frontend/templates/shared/signupModal.html +++ b/app/frontend/templates/shared/signupModal.html @@ -322,5 +322,5 @@ diff --git a/app/frontend/templates/spaces/edit.html b/app/frontend/templates/spaces/edit.html index c79fa80c1..d399072c8 100644 --- a/app/frontend/templates/spaces/edit.html +++ b/app/frontend/templates/spaces/edit.html @@ -2,7 +2,7 @@
diff --git a/app/frontend/templates/spaces/index.html b/app/frontend/templates/spaces/index.html index 5d41285a5..79c4414c1 100644 --- a/app/frontend/templates/spaces/index.html +++ b/app/frontend/templates/spaces/index.html @@ -13,7 +13,7 @@
@@ -39,7 +39,7 @@
diff --git a/app/frontend/templates/spaces/show.html b/app/frontend/templates/spaces/show.html index e8ef623eb..d46d7a206 100644 --- a/app/frontend/templates/spaces/show.html +++ b/app/frontend/templates/spaces/show.html @@ -15,10 +15,10 @@ diff --git a/app/frontend/templates/trainings/reserve.html b/app/frontend/templates/trainings/reserve.html index 5a77f0d61..dd5426fcf 100644 --- a/app/frontend/templates/trainings/reserve.html +++ b/app/frontend/templates/trainings/reserve.html @@ -13,7 +13,7 @@ diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb index c82f0f62c..da4c92808 100644 --- a/app/helpers/settings_helper.rb +++ b/app/helpers/settings_helper.rb @@ -166,7 +166,6 @@ module SettingsHelper user_change_group user_validation_required user_validation_required_list - show_username_in_admin_list family_account child_validation_required store_module diff --git a/app/models/accounting_line.rb b/app/models/accounting_line.rb index 2f94fa990..4c980fe5b 100644 --- a/app/models/accounting_line.rb +++ b/app/models/accounting_line.rb @@ -5,4 +5,16 @@ class AccountingLine < ApplicationRecord belongs_to :invoice belongs_to :invoicing_profile + + def invoice_payment_method + # if the invoice was 100% payed with the wallet ... + return 'wallet' if (!invoice.wallet_amount.nil? && (invoice.wallet_amount - invoice.total == 0)) || invoice.payment_method == 'wallet' + + # else + if invoice.paid_by_card? + 'card' + else + 'other' + end + end end diff --git a/app/models/avoir.rb b/app/models/avoir.rb index 7c731e69f..7fce27de0 100644 --- a/app/models/avoir.rb +++ b/app/models/avoir.rb @@ -12,7 +12,7 @@ class Avoir < Invoice attr_accessor :invoice_items_ids - delegate :order_number, to: :invoice + delegate :order_number, to: :invoice, allow_nil: true def expire_subscription user.subscription.expire diff --git a/app/models/chained_element.rb b/app/models/chained_element.rb index 44e76d689..a7edcf348 100644 --- a/app/models/chained_element.rb +++ b/app/models/chained_element.rb @@ -7,7 +7,6 @@ require 'json' class ChainedElement < ApplicationRecord belongs_to :element, polymorphic: true belongs_to :previous, class_name: 'ChainedElement' - has_one :next, class_name: 'ChainedElement', inverse_of: :previous, dependent: :restrict_with_exception before_create :set_content, :chain_record diff --git a/app/models/concerns/label_i18n_concern.rb b/app/models/concerns/label_i18n_concern.rb new file mode 100644 index 000000000..f1d80c11c --- /dev/null +++ b/app/models/concerns/label_i18n_concern.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module LabelI18nConcern + extend ActiveSupport::Concern + + def label + super.present? ? super : I18n.t(label_i18n_path) + end +end diff --git a/app/models/invoice.rb b/app/models/invoice.rb index b607fd08a..fb4c0ed90 100644 --- a/app/models/invoice.rb +++ b/app/models/invoice.rb @@ -160,9 +160,13 @@ class Invoice < PaymentDocument # return a summary of the payment means used def payment_means res = [] - res.push(means: :wallet, amount: wallet_amount) if paid_by_wallet? + res.push(means: :wallet, amount: wallet_amount || total) if paid_by_wallet? + return res if is_a?(Avoir) + if paid_by_card? res.push(means: :card, amount: amount_paid) + elsif paid_by_wallet? + res.push(means: :wallet, amount: amount_paid) else res.push(means: :other, amount: amount_paid) end @@ -195,7 +199,7 @@ class Invoice < PaymentDocument end def paid_by_wallet? - wallet_transaction && wallet_amount.positive? + (wallet_transaction && wallet_amount.positive?) || payment_method == 'wallet' end def render_resource diff --git a/app/models/open_id_connect_provider.rb b/app/models/open_id_connect_provider.rb index 26989cc32..ba94049cf 100644 --- a/app/models/open_id_connect_provider.rb +++ b/app/models/open_id_connect_provider.rb @@ -16,4 +16,16 @@ class OpenIdConnectProvider < ApplicationRecord validates :display, inclusion: { in: %w[page popup touch wap], allow_nil: true } validates :prompt, inclusion: { in: %w[none login consent select_account], allow_nil: true } validates :client_auth_method, inclusion: { in: %w[basic jwks] } + store_accessor :extra_authorize_params + + def extra_authorize_params=(val) + return unless val.is_a?(String) + + begin + super JSON.parse(val) + rescue JSON::ParserError + errors[:extra_authorize_params].add('is not valid JSON') + super + end + end end diff --git a/app/models/plan.rb b/app/models/plan.rb index a2aa4df3f..f3c2ca05b 100644 --- a/app/models/plan.rb +++ b/app/models/plan.rb @@ -35,8 +35,8 @@ class Plan < ApplicationRecord after_create :create_machines_prices after_create :create_spaces_prices - after_create :create_statistic_type after_create :set_name + after_create :create_statistic_type after_create :update_gateway_product after_update :update_gateway_product, if: :saved_change_to_base_name? diff --git a/app/models/slots_reservation.rb b/app/models/slots_reservation.rb index 030eb55ff..f81ef4c59 100644 --- a/app/models/slots_reservation.rb +++ b/app/models/slots_reservation.rb @@ -69,7 +69,7 @@ class SlotsReservation < ApplicationRecord Slots::PlacesCacheService.change_places(target_slot, reservation.reservable_type, reservation.reservable_id, - reservation.total_booked_seats, + reservation.reservable.pre_registration ? 0 : reservation.total_booked_seats, operation) else Slots::PlacesCacheService.change_places(target_slot, reservation.reservable_type, reservation.reservable_id, 1, operation) diff --git a/app/models/statistic_field.rb b/app/models/statistic_field.rb index 3daba6c21..fc3d204b0 100644 --- a/app/models/statistic_field.rb +++ b/app/models/statistic_field.rb @@ -1,3 +1,5 @@ class StatisticField < ApplicationRecord + include LabelI18nConcern + has_one :statistic_index end diff --git a/app/models/statistic_index.rb b/app/models/statistic_index.rb index 24b6ee0bf..8572e3e95 100644 --- a/app/models/statistic_index.rb +++ b/app/models/statistic_index.rb @@ -1,4 +1,6 @@ class StatisticIndex < ApplicationRecord + include LabelI18nConcern + has_many :statistic_types has_many :statistic_fields has_one :statistic_graph diff --git a/app/models/statistic_sub_type.rb b/app/models/statistic_sub_type.rb index c9317f5af..62da3aa87 100644 --- a/app/models/statistic_sub_type.rb +++ b/app/models/statistic_sub_type.rb @@ -1,4 +1,6 @@ class StatisticSubType < ApplicationRecord + include LabelI18nConcern + has_many :statistic_type_sub_types, dependent: :destroy has_many :statistic_types, through: :statistic_type_sub_types end diff --git a/app/models/statistic_type.rb b/app/models/statistic_type.rb index d0b44526d..c833730f2 100644 --- a/app/models/statistic_type.rb +++ b/app/models/statistic_type.rb @@ -3,6 +3,8 @@ # Allows splinting a StatisticIndex into multiple types. # e.g. The StatisticIndex "subscriptions" may have types like "1 month", "1 year", etc. class StatisticType < ApplicationRecord + include LabelI18nConcern + belongs_to :statistic_index has_many :statistic_type_sub_types, dependent: :destroy has_many :statistic_sub_types, through: :statistic_type_sub_types diff --git a/app/models/stylesheet.rb b/app/models/stylesheet.rb index 8a4a620b7..f1e3ac918 100644 --- a/app/models/stylesheet.rb +++ b/app/models/stylesheet.rb @@ -4,10 +4,6 @@ # a picture for the background of the user's profile. # There's only one stylesheet record in the database, which is updated on each colour change. class Stylesheet < ApplicationRecord - # brightness limits to change the font color to black or white - BRIGHTNESS_HIGH_LIMIT = 160 - BRIGHTNESS_LOW_LIMIT = 40 - validates :contents, presence: true ## ===== COMMON ===== @@ -81,15 +77,15 @@ class Stylesheet < ApplicationRecord end def self.primary_text_color - Stylesheet.primary.paint.brightness >= BRIGHTNESS_HIGH_LIMIT ? 'black' : 'white' + Stylesheet.primary.paint.brightness > 100 ? 'black' : 'white' end def self.primary_decoration_color - Stylesheet.primary.paint.brightness <= BRIGHTNESS_LOW_LIMIT ? 'white' : 'black' + Stylesheet.primary.paint.brightness > 100 ? 'black' : 'white' end def self.secondary_text_color - Stylesheet.secondary.paint.brightness <= BRIGHTNESS_LOW_LIMIT ? 'white' : 'black' + Stylesheet.secondary.paint.brightness > 100 ? 'black' : 'white' end def self.theme_css diff --git a/app/models/user.rb b/app/models/user.rb index 1c5c7643d..e714b15d7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -118,7 +118,7 @@ class User < ApplicationRecord statistic_profile.gender.nil? || profile.first_name.blank? || profile.last_name.blank? || username.blank? || email.blank? || encrypted_password.blank? || group_id.nil? || statistic_profile.birthday.blank? || (Setting.get('phone_required') && profile.phone.blank?) || - (Setting.get('address_required') && invoicing_profile.address&.address&.blank?) + (Setting.get('address_required') && invoicing_profile&.address&.address&.blank?) end def self.mapping diff --git a/app/pdfs/pdf/invoice.rb b/app/pdfs/pdf/invoice.rb index c7559eb78..fa77b22a9 100644 --- a/app/pdfs/pdf/invoice.rb +++ b/app/pdfs/pdf/invoice.rb @@ -75,7 +75,7 @@ class Pdf::Invoice < Prawn::Document invoice.invoice_items.each do |item| price = item.amount.to_i / 100.00 - data += [[Invoices::ItemLabelService.build(invoice, item), number_to_currency(price)]] + data += [[Invoices::ItemLabelService.build(invoice, item), number_to_currency(price, locale: CURRENCY_LOCALE)]] total_calc += price total_ht += item.net_amount total_vat += item.vat @@ -92,13 +92,13 @@ class Pdf::Invoice < Prawn::Document # discount textual description literal_discount = cp.percent_off - literal_discount = number_to_currency(cp.amount_off / 100.00) if cp.type == 'amount_off' + literal_discount = number_to_currency(cp.amount_off / 100.00, locale: CURRENCY_LOCALE) if cp.type == 'amount_off' # add a row for the coupon data += [[_t('invoices.coupon_CODE_discount_of_DISCOUNT', CODE: cp.code, DISCOUNT: literal_discount, - TYPE: cp.type), number_to_currency(-discount)]] + TYPE: cp.type), number_to_currency(-discount, locale: CURRENCY_LOCALE)]] end # total verification @@ -109,18 +109,18 @@ class Pdf::Invoice < Prawn::Document vat_service = VatHistoryService.new vat_rate_group = vat_service.invoice_vat(invoice) if total_vat.zero? - data += [[I18n.t('invoices.total_amount'), number_to_currency(total)]] + data += [[I18n.t('invoices.total_amount'), number_to_currency(total, locale: CURRENCY_LOCALE)]] else - data += [[I18n.t('invoices.total_including_all_taxes'), number_to_currency(total)]] + data += [[I18n.t('invoices.total_including_all_taxes'), number_to_currency(total, locale: CURRENCY_LOCALE)]] vat_rate_group.each do |_type, rate| data += [[I18n.t('invoices.including_VAT_RATE', **{ RATE: rate[:vat_rate], - AMOUNT: number_to_currency(rate[:amount] / 100.00), + AMOUNT: number_to_currency(rate[:amount] / 100.00, locale: CURRENCY_LOCALE), NAME: Setting.get('invoice_VAT-name') }), - number_to_currency(rate[:total_vat] / 100.00)]] + number_to_currency(rate[:total_vat] / 100.00, locale: CURRENCY_LOCALE)]] end - data += [[I18n.t('invoices.including_total_excluding_taxes'), number_to_currency(total_ht / 100.00)]] - data += [[I18n.t('invoices.including_amount_payed_on_ordering'), number_to_currency(total)]] + data += [[I18n.t('invoices.including_total_excluding_taxes'), number_to_currency(total_ht / 100.00, locale: CURRENCY_LOCALE)]] + data += [[I18n.t('invoices.including_amount_payed_on_ordering'), number_to_currency(total, locale: CURRENCY_LOCALE)]] # checking the round number rounded = (sprintf('%.2f', total_vat / 100.00).to_f + sprintf('%.2f', total_ht / 100.00).to_f).to_s diff --git a/app/pdfs/pdf/payment_schedule.rb b/app/pdfs/pdf/payment_schedule.rb index a959e3af8..690b887a7 100644 --- a/app/pdfs/pdf/payment_schedule.rb +++ b/app/pdfs/pdf/payment_schedule.rb @@ -80,9 +80,9 @@ class Pdf::PaymentSchedule < Prawn::Document price = item.amount.to_i / 100.00 date = I18n.l(item.due_date.to_date) - data += [[date, number_to_currency(price)]] + data += [[date, number_to_currency(price, locale: CURRENCY_LOCALE)]] end - data += [[I18n.t('payment_schedules.total_amount'), number_to_currency(payment_schedule.total / 100.0)]] + data += [[I18n.t('payment_schedules.total_amount'), number_to_currency(payment_schedule.total / 100.0, locale: CURRENCY_LOCALE)]] # display table font_size(8) do @@ -100,7 +100,7 @@ class Pdf::PaymentSchedule < Prawn::Document payment_verbose = _t('payment_schedules.settlement_by_METHOD', METHOD: payment_schedule.payment_method) if payment_schedule.wallet_amount payment_verbose += I18n.t('payment_schedules.settlement_by_wallet', - **{ AMOUNT: number_to_currency(payment_schedule.wallet_amount / 100.00) }) + **{ AMOUNT: number_to_currency(payment_schedule.wallet_amount / 100.00, locale: CURRENCY_LOCALE) }) end text payment_verbose diff --git a/app/services/availabilities/availabilities_service.rb b/app/services/availabilities/availabilities_service.rb index 8df177504..c870fd1d3 100644 --- a/app/services/availabilities/availabilities_service.rb +++ b/app/services/availabilities/availabilities_service.rb @@ -40,7 +40,6 @@ class Availabilities::AvailabilitiesService if @level == 'slot' slots = availabilities.map(&:slots).flatten - blocked_slots = Slots::InterblockingService.new.blocked_slots_for_machines(machines, slots) flag_or_remove_blocked_slots(slots, blocked_slots, @current_user) else @@ -141,7 +140,7 @@ class Availabilities::AvailabilitiesService end def flag_or_remove_blocked_slots(slots, blocked_slots, user) - if user.admin? || user.manager? + if user && (user.admin? || user.manager?) blocked_slots.each do |slot| slot.is_blocked = true end diff --git a/app/services/cart_service.rb b/app/services/cart_service.rb index 24fff5c47..d3eae9efd 100644 --- a/app/services/cart_service.rb +++ b/app/services/cart_service.rb @@ -191,33 +191,36 @@ class CartService def reservable_from_payment_schedule_object(object, plan) reservable = object.reservation.reservable + cart_item_reservation_slots = object.reservation.slots_reservations.map do |s| + { slot_id: s.slot_id, slots_reservation_id: s.id, offered: s.offered } + end case reservable when Machine CartItem::MachineReservation.new(customer_profile: @customer.invoicing_profile, operator_profile: @operator.invoicing_profile, reservable: reservable, - cart_item_reservation_slots_attributes: object.reservation.slots_reservations, + cart_item_reservation_slots_attributes: cart_item_reservation_slots, plan: plan, new_subscription: true) when Training CartItem::TrainingReservation.new(customer_profile: @customer.invoicing_profile, operator_profile: @operator.invoicing_profile, reservable: reservable, - cart_item_reservation_slots_attributes: object.reservation.slots_reservations, + cart_item_reservation_slots_attributes: cart_item_reservation_slots, plan: plan, new_subscription: true) when Event CartItem::EventReservation.new(customer_profile: @customer.invoicing_profile, operator_profile: @operator.invoicing_profile, event: reservable, - cart_item_reservation_slots_attributes: object.reservation.slots_reservation, + cart_item_reservation_slots_attributes: cart_item_reservation_slots, normal_tickets: object.reservation.nb_reserve_places, cart_item_event_reservation_tickets_attributes: object.reservation.tickets) when Space CartItem::SpaceReservation.new(customer_profile: @customer.invoicing_profile, operator_profile: @operator.invoicing_profile, reservable: reservable, - cart_item_reservation_slots_attributes: object.reservation.slots_reservations, + cart_item_reservation_slots_attributes: cart_item_reservation_slots, plan: plan, new_subscription: true) else diff --git a/app/services/event_service.rb b/app/services/event_service.rb index 7a6adcaf6..b41ef36bd 100644 --- a/app/services/event_service.rb +++ b/app/services/event_service.rb @@ -28,6 +28,7 @@ class EventService price_cat[:amount] = to_centimes(price_cat[:amount]) end end + params[:pre_registration_end_date] = Date.parse(params[:pre_registration_end_date]).end_of_day if params[:pre_registration_end_date].present? # return the resulting params object params end @@ -71,7 +72,16 @@ class EventService events.each do |e| method = e.destroyable? ? :destroy : :soft_destroy! # we use double negation because destroy can return either a boolean (false) or an Event (in case of delete success) - results.push status: !!e.send(method), event: e # rubocop:disable Style/DoubleNegation + + ActiveRecord::Base.transaction do + status = !!e.send(method) + if status + e.reservations.preload(:slots_reservations).map(&:slots_reservations).flatten.map do |slots_reservation| + SlotsReservationsService.cancel(slots_reservation) + end + end + results.push status: status, event: e # rubocop:disable Style/DoubleNegation + end end results end diff --git a/app/services/export_service.rb b/app/services/export_service.rb index e9023149c..dec69c61f 100644 --- a/app/services/export_service.rb +++ b/app/services/export_service.rb @@ -10,7 +10,7 @@ class ExportService last_export_members(query, key, extension) when 'users/reservations' last_export_reservations(query, key, extension) - when 'users/subscription' + when 'users/subscriptions' last_export_subscriptions(query, key, extension) when 'availabilities/index' last_export_availabilities(query, key, extension) @@ -19,7 +19,7 @@ class ExportService when %r{statistics/.*} last_export_statistics(type, query, key, extension) else - raise TypeError "unknown export type: #{type}" + raise TypeError.new("unknown export type: #{type}") end end diff --git a/app/services/invoices/payment_details_service.rb b/app/services/invoices/payment_details_service.rb index 872cbd1bb..56181f504 100644 --- a/app/services/invoices/payment_details_service.rb +++ b/app/services/invoices/payment_details_service.rb @@ -27,14 +27,14 @@ class Invoices::PaymentDetailsService **{ DATE: I18n.l(invoice.created_at.to_date), TIME: I18n.l(invoice.created_at, format: :hour_minute) })}" if total.positive? || wallet_amount.nil? - payment_verbose += " #{I18n.t('invoices.for_an_amount_of_AMOUNT', **{ AMOUNT: number_to_currency(total) })}" + payment_verbose += " #{I18n.t('invoices.for_an_amount_of_AMOUNT', **{ AMOUNT: number_to_currency(total, locale: CURRENCY_LOCALE) })}" end if invoice.wallet_amount payment_verbose += if total.positive? " #{I18n.t('invoices.and')} #{I18n.t('invoices.by_wallet')} " \ - "#{I18n.t('invoices.for_an_amount_of_AMOUNT', **{ AMOUNT: number_to_currency(wallet_amount) })}" + "#{I18n.t('invoices.for_an_amount_of_AMOUNT', **{ AMOUNT: number_to_currency(wallet_amount, locale: CURRENCY_LOCALE) })}" else - " #{I18n.t('invoices.for_an_amount_of_AMOUNT', **{ AMOUNT: number_to_currency(wallet_amount) })}" + " #{I18n.t('invoices.for_an_amount_of_AMOUNT', **{ AMOUNT: number_to_currency(wallet_amount, locale: CURRENCY_LOCALE) })}" end end payment_verbose @@ -88,7 +88,7 @@ class Invoices::PaymentDetailsService else Rails.logger.error "specified refunding method (#{details}) is unknown" end - "#{details} #{I18n.t('invoices.for_an_amount_of_AMOUNT', **{ AMOUNT: number_to_currency(total) })}" + "#{details} #{I18n.t('invoices.for_an_amount_of_AMOUNT', **{ AMOUNT: number_to_currency(total, locale: CURRENCY_LOCALE) })}" end end end diff --git a/app/services/invoices_service.rb b/app/services/invoices_service.rb index ac63809e6..0d0f42346 100644 --- a/app/services/invoices_service.rb +++ b/app/services/invoices_service.rb @@ -29,10 +29,9 @@ class InvoicesService ) end unless filters[:date].nil? - invoices = invoices.where( - "date_trunc('day', invoices.created_at) = :search", - search: "%#{Time.iso8601(filters[:date]).in_time_zone.to_date}%" - ) + start_at = Date.parse(filters[:date]).in_time_zone + end_at = start_at.end_of_day + invoices = invoices.where(created_at: (start_at..end_at)) end invoices diff --git a/app/services/open_lab_service.rb b/app/services/open_lab_service.rb index 0aae0d0ec..c05385e76 100644 --- a/app/services/open_lab_service.rb +++ b/app/services/open_lab_service.rb @@ -3,8 +3,6 @@ # Provides methods to sync projects on OpenLab class OpenLabService class << self - include ActionView::Helpers::SanitizeHelper - def to_hash(project) { id: project.id, @@ -20,9 +18,9 @@ class OpenLabService steps_body: steps_body(project), image_path: project.project_image&.attachment&.medium&.url, project_path: "/#!/projects/#{project.slug}", - updated_at: project.updated_at.to_s(:iso8601), - created_at: project.created_at.to_s(:iso8601), - published_at: project.published_at.to_s(:iso8601) + updated_at: project.updated_at.to_fs(:iso8601), + created_at: project.created_at.to_fs(:iso8601), + published_at: project.published_at.to_fs(:iso8601) } end @@ -32,7 +30,7 @@ class OpenLabService .gsub("\r\n", ' ').gsub("\n\r", ' ') .gsub("\n", ' ').gsub("\r", ' ').gsub("\t", ' ') - strip_tags(concatenated_steps).strip + ActionController::Base.helpers.strip_tags(concatenated_steps).strip end end end diff --git a/app/services/orders/order_service.rb b/app/services/orders/order_service.rb index 1d25857c9..926bf0202 100644 --- a/app/services/orders/order_service.rb +++ b/app/services/orders/order_service.rb @@ -127,7 +127,7 @@ class Orders::OrderService def filter_by_period(orders, filters) return orders unless filters[:period_from].present? && filters[:period_to].present? - orders.where(created_at: Time.zone.parse(filters[:period_from])..Time.zone.parse(filters[:period_to]).end_of_day) + orders.where(created_at: Date.parse(filters[:period_from]).in_time_zone..Date.parse(filters[:period_to]).in_time_zone.end_of_day) end def orders_ordering(orders, filters) diff --git a/app/services/payment_schedule_service.rb b/app/services/payment_schedule_service.rb index 7c5a1f47c..ff42945f5 100644 --- a/app/services/payment_schedule_service.rb +++ b/app/services/payment_schedule_service.rb @@ -146,10 +146,9 @@ class PaymentScheduleService ) end unless filters[:date].nil? - ps = ps.where( - "date_trunc('day', payment_schedules.created_at) = :search OR date_trunc('day', payment_schedule_items.due_date) = :search", - search: "%#{Time.zone.iso8601(filters[:date]).to_date}%" - ) + start_at = Date.parse(filters[:date]).in_time_zone + end_at = start_at.end_of_day + ps = ps.where("(payment_schedules.created_at BETWEEN :start_at AND :end_at) OR (payment_schedule_items.due_date BETWEEN :start_at AND :end_at)", start_at: start_at, end_at: end_at).references(:payment_schedule_items) end ps diff --git a/app/services/product_service.rb b/app/services/product_service.rb index 6837ea76e..0e75c0bda 100644 --- a/app/services/product_service.rb +++ b/app/services/product_service.rb @@ -173,7 +173,7 @@ class ProductService order ||= 'desc' if key == 'amount' - products.order("COALESCE(amount, 0) #{order.upcase}") + products.order(Arel.sql("COALESCE(amount, 0) #{order.upcase}")) else products.order(key => order) end diff --git a/app/services/project_service.rb b/app/services/project_service.rb index be85c3cd2..d35a44456 100644 --- a/app/services/project_service.rb +++ b/app/services/project_service.rb @@ -32,8 +32,8 @@ class ProjectService end end - created_from = Time.zone.parse(query_params['from_date']).beginning_of_day if query_params['from_date'].present? - created_to = Time.zone.parse(query_params['to_date']).end_of_day if query_params['to_date'].present? + created_from = Date.parse(query_params['from_date']).in_time_zone.beginning_of_day if query_params['from_date'].present? + created_to = Date.parse(query_params['to_date']).in_time_zone.end_of_day if query_params['to_date'].present? if created_from || created_to records = records.where(created_at: created_from..created_to) end @@ -46,7 +46,8 @@ class ProjectService records = records.includes(:users, :project_image) records = records.page(params[:page]) if paginate + total = paginate ? records.total_count : records.count - { total: records.total_count, projects: records } + { total: total, projects: records } end end diff --git a/app/services/slots_reservations_service.rb b/app/services/slots_reservations_service.rb index 3699083ae..774587514 100644 --- a/app/services/slots_reservations_service.rb +++ b/app/services/slots_reservations_service.rb @@ -5,7 +5,7 @@ class SlotsReservationsService class << self def cancel(slot_reservation) # first we mark ths slot reservation as cancelled in DB, to free a ticket - slot_reservation.update(canceled_at: Time.current) + slot_reservation.update!(canceled_at: Time.current) # then we try to remove this reservation from ElasticSearch, to keep the statistics up-to-date model_name = slot_reservation.reservation.reservable.class.name diff --git a/app/services/statistics/builder_service.rb b/app/services/statistics/builder_service.rb index 9e84eb697..60fcc57d2 100644 --- a/app/services/statistics/builder_service.rb +++ b/app/services/statistics/builder_service.rb @@ -17,7 +17,7 @@ class Statistics::BuilderService private def default_options - yesterday = Time.current + yesterday = 1.day.ago { start_date: yesterday.beginning_of_day, end_date: yesterday.end_of_day diff --git a/app/views/api/auth_providers/show.json.jbuilder b/app/views/api/auth_providers/show.json.jbuilder index 44cebfa0b..2700aeed3 100644 --- a/app/views/api/auth_providers/show.json.jbuilder +++ b/app/views/api/auth_providers/show.json.jbuilder @@ -16,6 +16,6 @@ if @provider.providable_type == OpenIdConnectProvider.name :prompt, :send_scope_to_token_endpoint, :client__identifier, :client__secret, :client__authorization_endpoint, :client__token_endpoint, :client__userinfo_endpoint, :client__jwks_uri, :client__end_session_endpoint, :profile_url json.scope @provider.providable[:scope] - json.extra_authorize_params @provider.providable[:extra_authorize_params] + json.extra_authorize_params @provider.providable[:extra_authorize_params].to_json end end diff --git a/app/views/api/events/_event.json.jbuilder b/app/views/api/events/_event.json.jbuilder index 49a1488e6..c8d1b1436 100644 --- a/app/views/api/events/_event.json.jbuilder +++ b/app/views/api/events/_event.json.jbuilder @@ -7,7 +7,7 @@ if event.event_image json.event_image_attributes do json.id event.event_image.id json.attachment_name event.event_image.attachment_identifier - json.attachment_url "#{event.event_image.attachment_url}?#{event.event_image.updated_at.to_i}" + json.attachment_url "#{event.event_image.attachment.large.url}?#{event.event_image.updated_at.to_i}" end end json.event_files_attributes event.event_files do |f| diff --git a/app/views/api/machines/_machine.json.jbuilder b/app/views/api/machines/_machine.json.jbuilder index 75c9de678..6e2159ed8 100644 --- a/app/views/api/machines/_machine.json.jbuilder +++ b/app/views/api/machines/_machine.json.jbuilder @@ -6,7 +6,7 @@ if machine.machine_image json.machine_image_attributes do json.id machine.machine_image.id json.attachment_name machine.machine_image.attachment_identifier - json.attachment_url machine.machine_image.attachment.url + json.attachment_url machine.machine_image.attachment.large.url end end diff --git a/app/views/api/members/show.json.jbuilder b/app/views/api/members/show.json.jbuilder index 0e7a44135..4313c1e38 100644 --- a/app/views/api/members/show.json.jbuilder +++ b/app/views/api/members/show.json.jbuilder @@ -10,7 +10,8 @@ json.trainings @member.trainings do |t| json.id t.id json.name t.name end -json.training_reservations @member.reservations.where(reservable_type: 'Training').map(&:slots_reservations).flatten do |sr| +reservations = @member.reservations.where(reservable_type: 'Training').preload(slots_reservations: [:slot, reservation: :reservable]) +json.training_reservations reservations.select { |r| r.reservable_type == "Training" }.map(&:slots_reservations).flatten do |sr| json.id sr.id json.start_at sr.slot.start_at json.end_at sr.slot.end_at @@ -19,7 +20,7 @@ json.training_reservations @member.reservations.where(reservable_type: 'Training json.is_valid @member.statistic_profile.training_ids.include?(sr.reservation.reservable_id) json.canceled_at sr.canceled_at end -json.machine_reservations @member.reservations.where(reservable_type: 'Machine').map(&:slots_reservations).flatten do |sr| +json.machine_reservations reservations.select { |r| r.reservable_type == "Machine" }.map(&:slots_reservations).flatten do |sr| json.id sr.id json.start_at sr.slot.start_at json.end_at sr.slot.end_at @@ -27,7 +28,7 @@ json.machine_reservations @member.reservations.where(reservable_type: 'Machine') json.reservable_type 'Machine' json.canceled_at sr.canceled_at end -json.space_reservations @member.reservations.where(reservable_type: 'Space').map(&:slots_reservations).flatten do |sr| +json.space_reservations reservations.select { |r| r.reservable_type == "Space" }.map(&:slots_reservations).flatten do |sr| json.id sr.id json.start_at sr.slot.start_at json.end_at sr.slot.end_at diff --git a/app/views/api/notifications/_notify_admin_refund_created.json.jbuilder b/app/views/api/notifications/_notify_admin_refund_created.json.jbuilder index 596e9441f..79ef767b2 100644 --- a/app/views/api/notifications/_notify_admin_refund_created.json.jbuilder +++ b/app/views/api/notifications/_notify_admin_refund_created.json.jbuilder @@ -1,5 +1,4 @@ json.title notification.notification_type json.description t('.refund_created', - AMOUNT: number_to_currency(notification.attached_object.total / 100.00), + AMOUNT: number_to_currency(notification.attached_object.total / 100.00, locale: CURRENCY_LOCALE), USER: notification.attached_object.invoicing_profile&.full_name) - diff --git a/app/views/api/notifications/_notify_admin_user_wallet_is_credited.json.jbuilder b/app/views/api/notifications/_notify_admin_user_wallet_is_credited.json.jbuilder index 90c8576a4..56b96aa7f 100644 --- a/app/views/api/notifications/_notify_admin_user_wallet_is_credited.json.jbuilder +++ b/app/views/api/notifications/_notify_admin_user_wallet_is_credited.json.jbuilder @@ -3,7 +3,6 @@ json.title notification.notification_type amount = notification.attached_object.amount json.description t('.wallet_is_credited', - AMOUNT: number_to_currency(amount), + AMOUNT: number_to_currency(amount, locale: CURRENCY_LOCALE), USER: notification.attached_object.wallet.user&.profile&.full_name || t('api.notifications.deleted_user'), ADMIN: notification.attached_object.user&.profile&.full_name || t('api.notifications.deleted_user')) - diff --git a/app/views/api/notifications/_notify_member_about_coupon.json.jbuilder b/app/views/api/notifications/_notify_member_about_coupon.json.jbuilder index a683b60d5..6381f7b06 100644 --- a/app/views/api/notifications/_notify_member_about_coupon.json.jbuilder +++ b/app/views/api/notifications/_notify_member_about_coupon.json.jbuilder @@ -5,7 +5,6 @@ if notification.attached_object.type == 'percent_off' CODE: notification.attached_object.code) else json.description t('.enjoy_a_discount_of_AMOUNT_with_code_CODE', - AMOUNT: number_to_currency(notification.attached_object.amount_off / 100.00), + AMOUNT: number_to_currency(notification.attached_object.amount_off / 100.00, locale: CURRENCY_LOCALE), CODE: notification.attached_object.code) end - diff --git a/app/views/api/notifications/_notify_user_wallet_is_credited.json.jbuilder b/app/views/api/notifications/_notify_user_wallet_is_credited.json.jbuilder index 4030bf1cb..1faf797bd 100644 --- a/app/views/api/notifications/_notify_user_wallet_is_credited.json.jbuilder +++ b/app/views/api/notifications/_notify_user_wallet_is_credited.json.jbuilder @@ -1,5 +1,4 @@ json.title notification.notification_type amount = notification.attached_object.amount json.description t('.your_wallet_is_credited', - AMOUNT: number_to_currency(amount)) - + AMOUNT: number_to_currency(amount, locale: CURRENCY_LOCALE)) diff --git a/app/views/api/notifications/_notify_user_when_avoir_ready.json.jbuilder b/app/views/api/notifications/_notify_user_when_avoir_ready.json.jbuilder index 0c7c08e27..36b1b606d 100644 --- a/app/views/api/notifications/_notify_user_when_avoir_ready.json.jbuilder +++ b/app/views/api/notifications/_notify_user_when_avoir_ready.json.jbuilder @@ -2,6 +2,5 @@ json.title notification.notification_type amount = notification.attached_object.total / 100.0 json.description t('.your_avoir_is_ready_html', REFERENCE: notification.attached_object.reference, - AMOUNT: number_to_currency(amount), + AMOUNT: number_to_currency(amount, locale: CURRENCY_LOCALE), INVOICE_ID: notification.attached_object.id) - diff --git a/app/views/api/notifications/_notify_user_when_invoice_ready.json.jbuilder b/app/views/api/notifications/_notify_user_when_invoice_ready.json.jbuilder index 3f24395df..a645067e1 100644 --- a/app/views/api/notifications/_notify_user_when_invoice_ready.json.jbuilder +++ b/app/views/api/notifications/_notify_user_when_invoice_ready.json.jbuilder @@ -2,6 +2,5 @@ json.title notification.notification_type amount = notification.attached_object.total / 100.0 json.description t('.your_invoice_is_ready_html', REFERENCE: notification.attached_object.reference, - AMOUNT: number_to_currency(amount), + AMOUNT: number_to_currency(amount, locale: CURRENCY_LOCALE), INVOICE_ID: notification.attached_object.id) - diff --git a/app/views/api/notifications/_notify_user_when_payment_schedule_ready.json.jbuilder b/app/views/api/notifications/_notify_user_when_payment_schedule_ready.json.jbuilder index c1852f38a..de861a9be 100644 --- a/app/views/api/notifications/_notify_user_when_payment_schedule_ready.json.jbuilder +++ b/app/views/api/notifications/_notify_user_when_payment_schedule_ready.json.jbuilder @@ -4,6 +4,5 @@ json.title notification.notification_type amount = notification.attached_object.total / 100.0 json.description t('.your_schedule_is_ready_html', REFERENCE: notification.attached_object.reference, - AMOUNT: number_to_currency(amount), + AMOUNT: number_to_currency(amount, locale: CURRENCY_LOCALE), SCHEDULE_ID: notification.attached_object.id) - diff --git a/app/views/api/spaces/_space.json.jbuilder b/app/views/api/spaces/_space.json.jbuilder index 82a1a8e9e..931d02d94 100644 --- a/app/views/api/spaces/_space.json.jbuilder +++ b/app/views/api/spaces/_space.json.jbuilder @@ -5,7 +5,7 @@ if space.space_image json.space_image_attributes do json.id space.space_image.id json.attachment_name space.space_image.attachment_identifier - json.attachment_url space.space_image.attachment.url + json.attachment_url space.space_image.attachment.large.url end end diff --git a/app/views/api/trainings/_training.json.jbuilder b/app/views/api/trainings/_training.json.jbuilder index eb4c8b598..e0c555022 100644 --- a/app/views/api/trainings/_training.json.jbuilder +++ b/app/views/api/trainings/_training.json.jbuilder @@ -7,7 +7,7 @@ if training.training_image json.training_image_attributes do json.id training.training_image.id json.attachment_name training.training_image.attachment_identifier - json.attachment_url training.training_image.attachment.url + json.attachment_url training.training_image.attachment.large.url end end diff --git a/app/views/archive/_accounting.json.jbuilder b/app/views/archive/_accounting.json.jbuilder index 124e1ff75..dc5c92cfc 100644 --- a/app/views/archive/_accounting.json.jbuilder +++ b/app/views/archive/_accounting.json.jbuilder @@ -9,7 +9,7 @@ json.invoices do json.type invoice[:invoice].payment_gateway_object.gateway_object_type end end - json.total number_to_currency(invoice[:invoice].total / 100.0) + json.total number_to_currency(invoice[:invoice].total / 100.0, locale: CURRENCY_LOCALE) json.user do json.extract! invoice[:invoice].invoicing_profile, :user_id, :email, :first_name, :last_name json.address invoice[:invoice].invoicing_profile&.address&.address @@ -46,7 +46,7 @@ json.payment_schedules do json.id object.gateway_object_id json.type object.gateway_object_type end - json.total number_to_currency(schedule.total / 100.0) + json.total number_to_currency(schedule.total / 100.0, locale: CURRENCY_LOCALE) json.user do json.extract! schedule.invoicing_profile, :user_id, :email, :first_name, :last_name json.address schedule.invoicing_profile&.address&.address @@ -60,7 +60,7 @@ json.payment_schedules do end json.deadlines schedule.payment_schedule_items do |item| json.extract! item, :id, :due_date, :state, :details, :invoice_id, :footprint, :created_at - json.amount number_to_currency(item.amount / 100.0) + json.amount number_to_currency(item.amount / 100.0, locale: CURRENCY_LOCALE) end json.objects schedule.payment_schedule_objects do |object| json.type object.object_type @@ -71,8 +71,8 @@ json.payment_schedules do end json.totals do - json.period_total number_to_currency(period_total / 100.0) - json.perpetual_total number_to_currency(perpetual_total / 100.0) + json.period_total number_to_currency(period_total / 100.0, locale: CURRENCY_LOCALE) + json.perpetual_total number_to_currency(perpetual_total / 100.0, locale: CURRENCY_LOCALE) end json.software do diff --git a/app/views/archive/_vat.json.jbuilder b/app/views/archive/_vat.json.jbuilder index d95b46f34..64f1c76cd 100644 --- a/app/views/archive/_vat.json.jbuilder +++ b/app/views/archive/_vat.json.jbuilder @@ -1,7 +1,7 @@ # frozen_string_literal: true json.amount do - json.without_tax number_to_currency((price - (price * vat_rate)) / 100.0) - json.all_taxes_included number_to_currency(price / 100.0) + json.without_tax number_to_currency((price - (price * vat_rate)) / 100.0, locale: CURRENCY_LOCALE) + json.all_taxes_included number_to_currency(price / 100.0, locale: CURRENCY_LOCALE) json.vat_rate vat_rate.positive? ? number_to_percentage(vat_rate * 100) : 'none' end diff --git a/app/views/exports/users_subscriptions.xlsx.axlsx b/app/views/exports/users_subscriptions.xlsx.axlsx index 82273e1cb..a6cd21962 100644 --- a/app/views/exports/users_subscriptions.xlsx.axlsx +++ b/app/views/exports/users_subscriptions.xlsx.axlsx @@ -24,7 +24,7 @@ wb.add_worksheet(name: ExcelService.name_safe(t('export_subscriptions.subscripti t("duration.#{sub.plan.interval}", count: sub.plan.interval_count), sub.created_at.to_date, sub.expired_at.to_date, - number_to_currency(sub.plan.amount / 100.00) + number_to_currency(sub.plan.amount / 100.00, locale: CURRENCY_LOCALE) ] styles = [nil, nil, nil, nil, nil, date, date, nil, nil] types = %i[integer string string string string date date string string] diff --git a/app/views/layouts/notifications_mailer.html.erb b/app/views/layouts/notifications_mailer.html.erb index 262c560af..7486928d6 100644 --- a/app/views/layouts/notifications_mailer.html.erb +++ b/app/views/layouts/notifications_mailer.html.erb @@ -26,13 +26,13 @@ <%=fablab_name%> + width="140" /> <% else %> <%=fablab_name%> + width="140" /> <% end %>