add other contact options to questions page

This commit is contained in:
Xu 2024-02-18 21:06:46 +01:00 committed by Igor Scheller
parent ef3f58e999
commit 9a07a7afb3
8 changed files with 55 additions and 11 deletions

View File

@ -53,6 +53,13 @@ return [
'Contact' => env('CONTACT_EMAIL', 'mailto:ticket@c3heaven.de'), 'Contact' => env('CONTACT_EMAIL', 'mailto:ticket@c3heaven.de'),
], ],
// Other ways to ask the heaven
// Multiple contact options / links are possible, analogue to footer_items
'contact_options' => [
// E-mail address
'general.email' => env('CONTACT_EMAIL', 'mailto:ticket@c3heaven.de'),
],
// Text displayed on the FAQ page, rendered as markdown // Text displayed on the FAQ page, rendered as markdown
'faq_text' => env('FAQ_TEXT', null), 'faq_text' => env('FAQ_TEXT', null),

View File

@ -1875,6 +1875,9 @@ msgstr "Antwort"
msgid "question.delete.title" msgid "question.delete.title"
msgstr "Frage \"%s\" löschen" msgstr "Frage \"%s\" löschen"
msgid "question.contact_options"
msgstr "Weitere Kontaktmöglichkeiten: "
msgid "user.edit.shirt" msgid "user.edit.shirt"
msgstr "T-Shirt bearbeiten" msgstr "T-Shirt bearbeiten"
@ -1957,9 +1960,6 @@ msgstr "Dieser Engeltyp benötigt eine Einweisung bei einem Einführungstreffen.
msgid "angeltypes.can-change-later" msgid "angeltypes.can-change-later"
msgstr "Du kannst Deine Auswahl später in den Einstellungen ändern." msgstr "Du kannst Deine Auswahl später in den Einstellungen ändern."
msgid "angeltypes.email"
msgstr "E-Mail"
msgid "angeltypes.hide_on_shift_view" msgid "angeltypes.hide_on_shift_view"
msgstr "Auf Schicht-Ansicht ausblenden" msgstr "Auf Schicht-Ansicht ausblenden"

View File

@ -576,6 +576,9 @@ msgstr "Answer"
msgid "question.delete.title" msgid "question.delete.title"
msgstr "Delete question \"%s\"" msgstr "Delete question \"%s\""
msgid "question.contact_options"
msgstr "Other contact options: "
msgid "user.edit.shirt" msgid "user.edit.shirt"
msgstr "Edit T-shirt" msgstr "Edit T-shirt"
@ -665,9 +668,6 @@ msgstr "This angeltype requires the attendance at an introduction meeting. "
msgid "angeltypes.can-change-later" msgid "angeltypes.can-change-later"
msgstr "You can change your selection later in the settings." msgstr "You can change your selection later in the settings."
msgid "angeltypes.email"
msgstr "E-mail"
msgid "angeltypes.shift.self_signup.info" msgid "angeltypes.shift.self_signup.info"
msgstr "Angel types which have shift self signup enabled allow angels to self sign up for there shifts, " msgstr "Angel types which have shift self signup enabled allow angels to self sign up for there shifts, "
"if shift self signup is disabled only supporters and admins can sign angels into shifts of these angel types." "if shift self signup is disabled only supporters and admins can sign angels into shifts of these angel types."

View File

@ -40,7 +40,15 @@
{% set url = opt is iterable ? opt[0] : opt %} {% set url = opt is iterable ? opt[0] : opt %}
{% set permission = opt is iterable ? opt[1] : null %} {% set permission = opt is iterable ? opt[1] : null %}
{% if not permission or has_permission_to(permission) %} {% if not permission or has_permission_to(permission) %}
<a href="{% if url starts with '/' %}{{ url(url) }}{% else %}{{ url }}{% endif %}"> <a href="
{%- if url starts with '/' %}
{{ url(url) }}
{%- else -%}
{{ url }}
{%- endif %}"
{%- if not (url starts with '/') %}
target="_blank" rel="noopener"
{%- endif %}>
{% if '@' in url %}{{ m.icon('envelope') }}{% endif %} {% if '@' in url %}{{ m.icon('envelope') }}{% endif %}
{{ __(name) }} {{ __(name) }}
</a> · </a> ·

View File

@ -76,7 +76,7 @@
{% for type, info in { {% for type, info in {
'contact_name': {'name': __('general.name')}, 'contact_name': {'name': __('general.name')},
'contact_dect': {'name': __('general.dect'), 'url': 'tel'}, 'contact_dect': {'name': __('general.dect'), 'url': 'tel'},
'contact_email': {'name': __('angeltypes.email'), 'url': 'mailto'}, 'contact_email': {'name': __('general.email'), 'url': 'mailto'},
} %} } %}
{% if angeltype[type] and (type != 'contact_dect' or config('enable_dect')) %} {% if angeltype[type] and (type != 'contact_dect' or config('enable_dect')) %}

View File

@ -10,6 +10,26 @@
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% block contact_options %}
{% for name,opt in config('contact_options') %}
{% set url = opt is iterable ? opt[0] : opt %}
{% set permission = opt is iterable ? opt[1] : null %}
{% if not permission or has_permission_to(permission) %}
<a href="
{%- if url starts with '/' %}
{{ url(url) }}
{%- else -%}
{{ url }}
{%- endif %}"
{%- if not (url starts with '/') %}
target="_blank" rel="noopener"
{%- endif %}>
{{ __(name) }}
</a>{% if not loop.last %},{% endif %}
{% endif %}
{% endfor %}
{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="container">
<div class="page-header"> <div class="page-header">
@ -32,10 +52,19 @@
{% block faq_text %} {% block faq_text %}
{% if has_permission_to('faq.view') %} {% if has_permission_to('faq.view') %}
{% if not is_admin | default(false) %} {% if not is_admin | default(false) %}
<p>{{ __('question.faq_link', [url('/faq')]) | raw }}</p> <p>
{{ __('question.faq_link', [url('/faq')]) | raw }}
</p>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{%- block info_text %}
{% if config('contact_options') and not is_admin|default(false) %}
<p>
{{ m.info(__('question.contact_options') ~ block('contact_options'), true) }}
</p>
{% endif %}
{% endblock %}
{% for question in questions %} {% for question in questions %}
<div class="row mb-4"> <div class="row mb-4">

View File

@ -16,7 +16,7 @@ class ConfigServiceProvider extends ServiceProvider
# remember to update ConfigServiceProviderTest, config.default.php, and README.md # remember to update ConfigServiceProviderTest, config.default.php, and README.md
protected array $configVarsToPruneNulls protected array $configVarsToPruneNulls
= ['themes', 'tshirt_sizes', 'headers', 'header_items', 'footer_items', 'locales']; = ['themes', 'tshirt_sizes', 'headers', 'header_items', 'footer_items', 'locales', 'contact_options'];
public function __construct(Application $app, protected ?EventConfig $eventConfig = null) public function __construct(Application $app, protected ?EventConfig $eventConfig = null)
{ {

View File

@ -20,7 +20,7 @@ class ConfigServiceProviderTest extends ServiceProviderTest
use ArraySubsetAsserts; use ArraySubsetAsserts;
private array $configVarsWhereNullIsPruned = private array $configVarsWhereNullIsPruned =
['themes', 'tshirt_sizes', 'headers', 'header_items', 'footer_items', 'locales']; ['themes', 'tshirt_sizes', 'headers', 'header_items', 'footer_items', 'locales', 'contact_options'];
/** /**
* @covers \Engelsystem\Config\ConfigServiceProvider::getConfigPath * @covers \Engelsystem\Config\ConfigServiceProvider::getConfigPath