add 'enable_email_goody' config and fix wording

This commit is contained in:
Xu 2024-03-27 21:05:44 +01:00 committed by Igor Scheller
parent d7d99900f8
commit 9bf9bd2823
8 changed files with 21 additions and 6 deletions

View File

@ -85,9 +85,12 @@ return [
'sendmail' => env('MAIL_SENDMAIL', '/usr/sbin/sendmail -bs'),
],
# Your privacy@ contact address
// Your privacy@ contact address
'privacy_email' => env('PRIVACY_EMAIL', null),
// Show opt in to save some personal data after the event on user profile and registration pages
'enable_email_goody' => (bool) env('ENABLE_EMAIL_GOODY', true),
// Initial admin password
'setup_admin_password' => env('SETUP_ADMIN_PASSWORD', null),

View File

@ -1637,6 +1637,10 @@ msgstr "Erlaube Himmel-Engeln mich per E-Mail zu kontaktieren."
msgid "settings.profile.email_goody"
msgstr "Um gegebenenfalls Voucher für das nächste gleichartige Event zu erhalten stimme ich zu, "
"dass mein Nick, E-Mail-Adresse und geleistete Arbeit solange gespeichert werden."
msgid "settings.profile.email_tshirt"
msgstr "Um gegebenenfalls Voucher für das nächste gleichartige Event zu erhalten stimme ich zu, "
"dass mein Nick, E-Mail-Adresse, geleistete Arbeit und T-Shirt-Größe solange gespeichert werden."
msgid "settings.profile.privacy"

View File

@ -339,6 +339,10 @@ msgstr "Allow heaven angels to contact me by e-mail."
msgid "settings.profile.email_goody"
msgstr "To possibly receive vouchers for the next similar event, I consent "
"that my nick, e-mail address and worked hours will be stored until then."
msgid "settings.profile.email_tshirt"
msgstr "To possibly receive vouchers for the next similar event, I consent "
"that my nick, e-mail address, worked hours and T-shirt size will be stored until then."
msgid "settings.profile.privacy"

View File

@ -196,7 +196,8 @@
{% if isGoodieEnabled %}
<div class="col-md-6">
{% set privacy_email = config('privacy_email') %}
{% set email_goody_label = __('settings.profile.email_goody') ~
{% set email_goody_label =
(isGoodieTShirt ? __('settings.profile.email_tshirt') : __('settings.profile.email_goody')) ~
(privacy_email ? ' ' ~ __('settings.profile.privacy', [privacy_email]) : '')
%}
{{ f.checkbox(

View File

@ -135,7 +135,8 @@
}) }}
{% if goodie_enabled %}
{% set privacy_email = config('privacy_email') %}
{% set email_goody_label = __('settings.profile.email_goody') ~
{% set email_goody_label =
(goodie_tshirt ? __('settings.profile.email_tshirt') : __('settings.profile.email_goody')) ~
(privacy_email ? ' ' ~ __('settings.profile.privacy', [privacy_email]) : '')
%}
{{ f.checkbox('email_goody', email_goody_label, {

View File

@ -99,7 +99,7 @@ class RegistrationController extends BaseController
'isPasswordEnabled' => $this->userFactory->determineIsPasswordEnabled(),
'isDECTEnabled' => $this->config->get('enable_dect'),
'isShowMobileEnabled' => $this->config->get('enable_mobile_show'),
'isGoodieEnabled' => $goodieType !== GoodieType::None,
'isGoodieEnabled' => $goodieType !== GoodieType::None && config('enable_email_goody'),
'isGoodieTShirt' => $goodieType === GoodieType::Tshirt,
'isPronounEnabled' => $this->config->get('enable_pronoun'),
'isFullNameEnabled' => $this->config->get('enable_user_name'),

View File

@ -46,7 +46,8 @@ class SettingsController extends BaseController
[
'settings_menu' => $this->settingsMenu(),
'userdata' => $user,
'goodie_enabled' => $this->config->get('goodie_type') !== GoodieType::None->value,
'goodie_enabled' => $this->config->get('goodie_type') !== GoodieType::None->value
&& config('enable_email_goody'),
'goodie_tshirt' => $this->config->get('goodie_type') === GoodieType::Tshirt->value,
'tShirtLink' => $this->config->get('tshirt_link'),
'isPronounRequired' => $requiredFields['pronoun'],
@ -105,7 +106,7 @@ class SettingsController extends BaseController
$user->settings->email_human = $data['email_human'] ?: false;
$user->settings->email_messages = $data['email_messages'] ?: false;
if ($goodie_enabled) {
if ($goodie_enabled && config('enable_email_goody')) {
$user->settings->email_goody = $data['email_goody'] ?: false;
}

View File

@ -74,6 +74,7 @@ class SettingsControllerTest extends ControllerTest
'enable_planned_arrival' => true,
'enable_dect' => true,
'enable_mobile_show' => true,
'enable_email_goody' => true,
'goodie_type' => GoodieType::Tshirt->value,
]);