Angeltype view: Add requires info for not members

This commit is contained in:
Xu 2024-05-20 20:40:31 +02:00 committed by Igor Scheller
parent 300786e5d0
commit 40bd61fd32
3 changed files with 25 additions and 0 deletions

View File

@ -569,6 +569,13 @@ function AngelType_view_info(
$admin_angeltypes,
$supporter
) {
$required_info_show = !auth()->user()
->userAngelTypes()
->where('angel_types.id', $angeltype->id)
->count()
&& !$admin_angeltypes
&& !$admin_user_angeltypes
&& !$supporter;
$info = [];
if ($angeltype->hasContactInfo()) {
$info[] = AngelTypes_render_contact_info($angeltype);
@ -579,6 +586,12 @@ function AngelType_view_info(
if ($angeltype->description != '') {
$info[] = $parsedown->parse(htmlspecialchars($angeltype->description));
}
if ($angeltype->requires_ifsg_certificate && $required_info_show) {
$info[] = info(__('angeltype.ifsg.required.info.preview'), true);
}
if ($angeltype->requires_driver_license && $required_info_show) {
$info[] = info(__('angeltype.driving_license.required.info.preview'), true);
}
list($supporters, $members_confirmed, $members_unconfirmed) = AngelType_view_members(
$angeltype,

View File

@ -906,6 +906,12 @@ msgstr "Ansprechpartner für Fragen."
msgid "My driving license"
msgstr "Meine Führerschein-Infos"
msgid "angeltype.ifsg.required.info.preview"
msgstr "Dieser Engeltyp benötigt eine Gesundheitsbelehrung."
msgid "angeltype.driving_license.required.info.preview"
msgstr "Dieser Engeltyp benötigt Führerschein-Infos."
msgid ""
"This angeltype requires a driver license. Please enter your driver license "
"information!"

View File

@ -484,6 +484,9 @@ msgstr "Health instruction on site"
msgid "angeltype.ifsg.own"
msgstr "My health instruction"
msgid "angeltype.ifsg.required.info.preview"
msgstr "This angeltype requires a health instruction."
msgid "angeltype.ifsg.required.info"
msgstr "This angeltype requires a health instruction. Please enter your health instruction information!"
@ -496,6 +499,9 @@ msgstr ""
"You joined an angeltype which requires a driving license. "
"Please edit your driving license information here: %s."
msgid "angeltype.driving_license.required.info.preview"
msgstr "This angeltype requires a driver's license."
msgid "ifsg.info"
msgstr "Health instruction information"