From 40bd61fd32c387658ef5c147614b9c8e3ac56f89 Mon Sep 17 00:00:00 2001 From: Xu Date: Mon, 20 May 2024 20:40:31 +0200 Subject: [PATCH] Angeltype view: Add requires info for not members --- includes/view/AngelTypes_view.php | 13 +++++++++++++ resources/lang/de_DE/default.po | 6 ++++++ resources/lang/en_US/default.po | 6 ++++++ 3 files changed, 25 insertions(+) diff --git a/includes/view/AngelTypes_view.php b/includes/view/AngelTypes_view.php index 8fe3b86a..8ab9a358 100644 --- a/includes/view/AngelTypes_view.php +++ b/includes/view/AngelTypes_view.php @@ -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, diff --git a/resources/lang/de_DE/default.po b/resources/lang/de_DE/default.po index 4ea239dc..081ccd0f 100644 --- a/resources/lang/de_DE/default.po +++ b/resources/lang/de_DE/default.po @@ -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!" diff --git a/resources/lang/en_US/default.po b/resources/lang/en_US/default.po index a98c0b1b..52313284 100644 --- a/resources/lang/en_US/default.po +++ b/resources/lang/en_US/default.po @@ -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"