diff --git a/app/frontend/src/javascript/models/setting.ts b/app/frontend/src/javascript/models/setting.ts index 27f84db14..5090487cb 100644 --- a/app/frontend/src/javascript/models/setting.ts +++ b/app/frontend/src/javascript/models/setting.ts @@ -178,7 +178,8 @@ export const accountSettings = [ 'external_id', 'user_change_group', 'user_validation_required', - 'user_validation_required_list' + 'user_validation_required_list', + 'family_account' ] as const; export const analyticsSettings = [ diff --git a/app/frontend/templates/admin/settings/compte.html b/app/frontend/templates/admin/settings/compte.html index 0ed115706..3935b9c98 100644 --- a/app/frontend/templates/admin/settings/compte.html +++ b/app/frontend/templates/admin/settings/compte.html @@ -51,6 +51,17 @@ +
+

{{ 'app.admin.settings.family_account' }}

+

+
+ +
+

{{ 'app.admin.settings.captcha' }}

diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb index 1520bd44d..4029db1fa 100644 --- a/app/helpers/settings_helper.rb +++ b/app/helpers/settings_helper.rb @@ -167,6 +167,7 @@ module SettingsHelper user_validation_required user_validation_required_list show_username_in_admin_list + family_account store_module store_withdrawal_instructions store_hidden diff --git a/app/policies/setting_policy.rb b/app/policies/setting_policy.rb index 1593beb55..8c83827fa 100644 --- a/app/policies/setting_policy.rb +++ b/app/policies/setting_policy.rb @@ -46,7 +46,7 @@ class SettingPolicy < ApplicationPolicy external_id machines_banner_active machines_banner_text machines_banner_cta_active machines_banner_cta_label machines_banner_cta_url trainings_banner_active trainings_banner_text trainings_banner_cta_active trainings_banner_cta_label trainings_banner_cta_url events_banner_active events_banner_text events_banner_cta_active events_banner_cta_label - events_banner_cta_url] + events_banner_cta_url family_account] end ## diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml index 8714ac56d..b4ac6a9d9 100644 --- a/config/locales/app.admin.en.yml +++ b/config/locales/app.admin.en.yml @@ -1773,6 +1773,9 @@ en: extended_prices_in_same_day: "Extended prices in the same day" public_registrations: "Public registrations" show_username_in_admin_list: "Show the username in the list" + family_account: "family account" + family_account_info_html: "By activating this option, you offer your members the possibility to add their child(ren) to their own account. You can also request proof if you wish to validate them." + enable_family_account: "Enable the Family Account option" overlapping_options: training_reservations: "Trainings" machine_reservations: "Machines" diff --git a/config/locales/app.admin.fr.yml b/config/locales/app.admin.fr.yml index e7082ef58..f89ade8b7 100644 --- a/config/locales/app.admin.fr.yml +++ b/config/locales/app.admin.fr.yml @@ -1773,6 +1773,9 @@ fr: extended_prices_in_same_day: "Prix étendus le même jour" public_registrations: "Inscriptions publiques" show_username_in_admin_list: "Afficher le nom d'utilisateur dans la liste" + family_account: "Compte famille" + family_account_info_html: "En activant cette option, vous offrez à vos membres la possibilité d'ajouter sur leur propre compte leur(s) enfants. Vous pouvez aussi demander un justificatif si vous souhaitez les valider." + enable_family_account: "Activer l'option Compte Famille" overlapping_options: training_reservations: "Formations" machine_reservations: "Machines" diff --git a/config/locales/en.yml b/config/locales/en.yml index 3bd7aae37..ef51539d0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -697,6 +697,7 @@ en: trainings_authorization_validity_duration: "Trainings validity period duration" trainings_invalidation_rule: "Trainings automatic invalidation" trainings_invalidation_rule_period: "Grace period before invalidating a training" + family_account: "Family account" #statuses of projects statuses: new: "New" diff --git a/db/seeds/settings.rb b/db/seeds/settings.rb index 4df47c23c..bd701eba0 100644 --- a/db/seeds/settings.rb +++ b/db/seeds/settings.rb @@ -728,3 +728,5 @@ Setting.set('accounting_Error_code', 'ERROR') unless Setting.find_by(name: 'acco Setting.set('accounting_Error_label', 'Erroneous invoices to refund') unless Setting.find_by(name: 'accounting_Error_label').try(:value) Setting.set('external_id', false) unless Setting.find_by(name: 'external_id').try(:value) + +Setting.set('family_account', false) unless Setting.find_by(name: 'family_account').try(:value) diff --git a/test/fixtures/history_values.yml b/test/fixtures/history_values.yml index 4ce437af6..42f684753 100644 --- a/test/fixtures/history_values.yml +++ b/test/fixtures/history_values.yml @@ -852,3 +852,11 @@ history_value_100: updated_at: 2023-04-05 09:16:08.000511500 Z invoicing_profile_id: 1 +history_value_101: + id: 101 + setting_id: 100 + value: 'false' + created_at: '2023-03-31 14:38:40.000421' + updated_at: '2023-03-31 14:38:40.000421' + footprint: + invoicing_profile_id: 1 diff --git a/test/fixtures/settings.yml b/test/fixtures/settings.yml index eb21fa7f8..c6a05e176 100644 --- a/test/fixtures/settings.yml +++ b/test/fixtures/settings.yml @@ -586,3 +586,9 @@ setting_99: name: home_css created_at: 2023-04-05 09:16:08.000511500 Z updated_at: 2023-04-05 09:16:08.000511500 Z + +setting_100: + id: 100 + name: family_account + created_at: 2023-03-31 14:38:40.000421500 Z + updated_at: 2023-03-31 14:38:40.000421500 Z diff --git a/test/frontend/__fixtures__/settings.ts b/test/frontend/__fixtures__/settings.ts index 03dd134be..578fc6dbb 100644 --- a/test/frontend/__fixtures__/settings.ts +++ b/test/frontend/__fixtures__/settings.ts @@ -825,6 +825,12 @@ export const settings: Array = [ value: 'https://www.sleede.com/', last_update: '2022-12-23T14:39:12+0100', localized: 'Url' + }, + { + name: 'family_account', + value: 'false', + last_update: '2023-03-31T14:39:12+0100', + localized: 'Family account' } ];