From 90ec8d8d437e965a28b8e383f231a54b876f1e61 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Fri, 10 Dec 2021 20:48:17 +0100 Subject: [PATCH] Add links between questions and FAQ and added question form to FAQ page --- resources/lang/de_DE/default.po | 8 +++++++- resources/lang/en_US/default.po | 8 +++++++- resources/views/pages/faq/overview.twig | 20 +++++++++++++++++++ resources/views/pages/questions/overview.twig | 6 ++++++ 4 files changed, 40 insertions(+), 2 deletions(-) diff --git a/resources/lang/de_DE/default.po b/resources/lang/de_DE/default.po index 6e949924..769825bd 100644 --- a/resources/lang/de_DE/default.po +++ b/resources/lang/de_DE/default.po @@ -2970,6 +2970,9 @@ msgstr "Trennen" msgid "faq.faq" msgstr "FAQ" +msgid "faq.questions_link" +msgstr "Wenn deine Frage hier nicht beantwortet wurde, frag den Himmel." + msgid "faq.edit" msgstr "FAQ Eintrag bearbeiten" @@ -2985,8 +2988,11 @@ msgstr "Antwort" msgid "question.questions" msgstr "Fragen" +msgid "question.faq_link" +msgstr "Hast du eine generelle Frage? Vielleicht ist diese schon in den FAQ beantwortet." + msgid "question.add" -msgstr "Fragen" +msgstr "Stelle eine Frage" msgid "question.edit" msgstr "Frage bearbeiten" diff --git a/resources/lang/en_US/default.po b/resources/lang/en_US/default.po index 81f4a4e7..76f21486 100644 --- a/resources/lang/en_US/default.po +++ b/resources/lang/en_US/default.po @@ -240,6 +240,9 @@ msgstr "Disconnect" msgid "faq.faq" msgstr "FAQ" +msgid "faq.questions_link" +msgstr "If you don't find an answer, you can ask the heaven." + msgid "faq.edit" msgstr "Edit FAQ entry" @@ -255,8 +258,11 @@ msgstr "Answer" msgid "question.questions" msgstr "Questions" +msgid "question.faq_link" +msgstr "For general questions, have a look at our FAQ." + msgid "question.add" -msgstr "Ask" +msgstr "Ask a question" msgid "question.edit" msgstr "Edit question" diff --git a/resources/views/pages/faq/overview.twig b/resources/views/pages/faq/overview.twig index e3762c09..ea89d43b 100644 --- a/resources/views/pages/faq/overview.twig +++ b/resources/views/pages/faq/overview.twig @@ -1,5 +1,6 @@ {% extends 'layouts/app.twig' %} {% import 'macros/base.twig' as m %} +{% import 'macros/form.twig' as f %} {% block title %} {{ __('faq.faq') }} @@ -18,6 +19,12 @@ {% include 'layouts/parts/messages.twig' %}
+ {% block questions_text %} + {% if has_permission_to('question.add') %} +

{{ __('faq.questions_link', [url('/questions')]) | raw }}

+ {% endif %} + {% endblock %} + {% block text %} {% if text|default(null) %}
@@ -57,6 +64,19 @@
{% endfor %} {% endblock %} + + {% block ask_question %} + {% if has_permission_to('question.add') %} +
+ {{ csrf() }} +
+

{{ __('question.add') }}

+ {{ f.textarea('text', __('question.question'), {'required': true, 'rows': 5}) }} + {{ f.submit() }} +
+
+ {% endif %} + {% endblock %}
{% endblock %} diff --git a/resources/views/pages/questions/overview.twig b/resources/views/pages/questions/overview.twig index 49ce170e..e9dcdab8 100644 --- a/resources/views/pages/questions/overview.twig +++ b/resources/views/pages/questions/overview.twig @@ -24,6 +24,12 @@ {% block row %}
{% block questions %} + {% block faq_text %} + {% if has_permission_to('faq.view') %} +

{{ __('question.faq_link', [url('/faq')]) | raw }}

+ {% endif %} + {% endblock %} + {% for question in questions %}