Add links between questions and FAQ and added question form to FAQ page

This commit is contained in:
Igor Scheller 2021-12-10 20:48:17 +01:00 committed by msquare
parent 26ab0619f5
commit 90ec8d8d43
4 changed files with 40 additions and 2 deletions

View File

@ -2970,6 +2970,9 @@ msgstr "Trennen"
msgid "faq.faq" msgid "faq.faq"
msgstr "FAQ" msgstr "FAQ"
msgid "faq.questions_link"
msgstr "Wenn deine Frage hier nicht beantwortet wurde, <a href=\"%s\">frag den Himmel</a>."
msgid "faq.edit" msgid "faq.edit"
msgstr "FAQ Eintrag bearbeiten" msgstr "FAQ Eintrag bearbeiten"
@ -2985,8 +2988,11 @@ msgstr "Antwort"
msgid "question.questions" msgid "question.questions"
msgstr "Fragen" msgstr "Fragen"
msgid "question.faq_link"
msgstr "Hast du eine generelle Frage? Vielleicht ist diese schon in den <a href=\"%s\">FAQ</a> beantwortet."
msgid "question.add" msgid "question.add"
msgstr "Fragen" msgstr "Stelle eine Frage"
msgid "question.edit" msgid "question.edit"
msgstr "Frage bearbeiten" msgstr "Frage bearbeiten"

View File

@ -240,6 +240,9 @@ msgstr "Disconnect"
msgid "faq.faq" msgid "faq.faq"
msgstr "FAQ" msgstr "FAQ"
msgid "faq.questions_link"
msgstr "If you don't find an answer, you can <a href=\"%s\">ask the heaven</a>."
msgid "faq.edit" msgid "faq.edit"
msgstr "Edit FAQ entry" msgstr "Edit FAQ entry"
@ -255,8 +258,11 @@ msgstr "Answer"
msgid "question.questions" msgid "question.questions"
msgstr "Questions" msgstr "Questions"
msgid "question.faq_link"
msgstr "For general questions, have a look at our <a href=\"%s\">FAQ</a>."
msgid "question.add" msgid "question.add"
msgstr "Ask" msgstr "Ask a question"
msgid "question.edit" msgid "question.edit"
msgstr "Edit question" msgstr "Edit question"

View File

@ -1,5 +1,6 @@
{% extends 'layouts/app.twig' %} {% extends 'layouts/app.twig' %}
{% import 'macros/base.twig' as m %} {% import 'macros/base.twig' as m %}
{% import 'macros/form.twig' as f %}
{% block title %} {% block title %}
{{ __('faq.faq') }} {{ __('faq.faq') }}
@ -18,6 +19,12 @@
{% include 'layouts/parts/messages.twig' %} {% include 'layouts/parts/messages.twig' %}
<div class="row"> <div class="row">
{% block questions_text %}
{% if has_permission_to('question.add') %}
<p>{{ __('faq.questions_link', [url('/questions')]) | raw }}</p>
{% endif %}
{% endblock %}
{% block text %} {% block text %}
{% if text|default(null) %} {% if text|default(null) %}
<div class="col-md-12"> <div class="col-md-12">
@ -57,6 +64,19 @@
</div> </div>
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}
{% block ask_question %}
{% if has_permission_to('question.add') %}
<form action="{{ url('/questions/new') }}" enctype="multipart/form-data" method="post">
{{ csrf() }}
<div class="col-md-12">
<h4>{{ __('question.add') }}</h4>
{{ f.textarea('text', __('question.question'), {'required': true, 'rows': 5}) }}
{{ f.submit() }}
</div>
</form>
{% endif %}
{% endblock %}
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -24,6 +24,12 @@
{% block row %} {% block row %}
<div class="col-md-12"> <div class="col-md-12">
{% block questions %} {% block questions %}
{% block faq_text %}
{% if has_permission_to('faq.view') %}
<p>{{ __('question.faq_link', [url('/faq')]) | raw }}</p>
{% endif %}
{% endblock %}
{% for question in questions %} {% for question in questions %}
<div class="row mb-4"> <div class="row mb-4">
<div class="col-md-12"> <div class="col-md-12">