2020-12-06 00:16:15 +01:00
|
|
|
{% extends 'layouts/app.twig' %}
|
|
|
|
{% import 'macros/base.twig' as m %}
|
2021-12-10 20:48:17 +01:00
|
|
|
{% import 'macros/form.twig' as f %}
|
2020-12-06 00:16:15 +01:00
|
|
|
|
2023-12-07 15:11:05 +01:00
|
|
|
{% block title %}{{ __('faq.faq') }}{% endblock %}
|
2020-12-06 00:16:15 +01:00
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="container">
|
|
|
|
<h1>
|
|
|
|
{{ block('title') }}
|
|
|
|
|
2024-04-18 14:29:56 +02:00
|
|
|
{%- if can('faq.edit') -%}
|
2024-05-21 19:05:33 +02:00
|
|
|
{{ m.button(m.icon('plus-lg'), url('/admin/faq')) }}
|
2020-12-06 00:16:15 +01:00
|
|
|
{%- endif %}
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
{% include 'layouts/parts/messages.twig' %}
|
|
|
|
|
|
|
|
<div class="row">
|
2021-12-10 20:48:17 +01:00
|
|
|
{% block questions_text %}
|
2024-04-18 14:29:56 +02:00
|
|
|
{% if can('question.add') %}
|
2021-12-10 20:48:17 +01:00
|
|
|
<p>{{ __('faq.questions_link', [url('/questions')]) | raw }}</p>
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|
|
|
|
|
2020-12-06 00:16:15 +01:00
|
|
|
{% block text %}
|
|
|
|
{% if text|default(null) %}
|
|
|
|
<div class="col-md-12">
|
|
|
|
{{ text|markdown }}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block row %}
|
|
|
|
{% for item in items %}
|
2020-12-27 17:55:41 +01:00
|
|
|
<div class="col-md-12 faq">
|
|
|
|
<span id="faq-{{ item.id }}" class="ref-id"></span>
|
2023-12-06 21:15:54 +01:00
|
|
|
<div class="card {{ m.type_bg_class() }} mb-4">
|
2021-07-25 21:41:57 +02:00
|
|
|
<h4 class="card-header">
|
2021-07-24 12:38:23 +02:00
|
|
|
{{ item.question }}
|
|
|
|
<small class="text-muted">
|
|
|
|
<a class="ref-link" href="#faq-{{ item.id }}">{{ m.icon('link') }}</a>
|
|
|
|
</small>
|
2021-07-25 21:41:57 +02:00
|
|
|
</h4>
|
2020-12-06 00:16:15 +01:00
|
|
|
|
2021-08-05 01:00:12 +02:00
|
|
|
<div class="card-body bg-body">
|
2020-12-06 00:16:15 +01:00
|
|
|
{{ item.text|markdown }}
|
|
|
|
</div>
|
|
|
|
|
2023-12-06 21:15:54 +01:00
|
|
|
<div class="card-footer {{ m.type_bg_class() }} d-flex align-items-center">
|
2021-07-24 12:38:23 +02:00
|
|
|
<div class="me-3">
|
2023-11-23 14:30:46 +01:00
|
|
|
{{ m.icon('clock') }} {{ item.updated_at.format(__('general.datetime')) }}
|
2021-07-24 12:38:23 +02:00
|
|
|
</div>
|
2020-12-06 00:16:15 +01:00
|
|
|
|
2024-04-18 14:29:56 +02:00
|
|
|
{% if can('faq.edit') %}
|
2021-07-24 12:38:23 +02:00
|
|
|
<span class="ms-auto">
|
2024-05-21 19:05:33 +02:00
|
|
|
{{ m.button(m.icon('pencil'), url('/admin/faq/' ~ item.id), {'size': 'sm', 'title': __('form.edit')}) }}
|
2020-12-06 00:16:15 +01:00
|
|
|
</span>
|
2023-11-05 16:29:07 +01:00
|
|
|
|
|
|
|
<form class="ps-1"
|
|
|
|
action="{{ url('/admin/faq/' ~ item.id) }}"
|
|
|
|
enctype="multipart/form-data"
|
|
|
|
method="post">
|
|
|
|
{{ csrf() }}
|
|
|
|
{{ f.delete(null, {
|
|
|
|
'size': 'sm',
|
2023-11-10 16:20:01 +01:00
|
|
|
'confirm_title': __('faq.delete.title', [item.question[:40]|e]),
|
|
|
|
'confirm_button_text': __('form.delete'),
|
2023-11-05 16:29:07 +01:00
|
|
|
}) }}
|
|
|
|
</form>
|
2020-12-06 00:16:15 +01:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
{% endblock %}
|
2021-12-10 20:48:17 +01:00
|
|
|
|
|
|
|
{% block ask_question %}
|
2024-04-18 14:29:56 +02:00
|
|
|
{% if can('question.add') %}
|
2021-12-10 20:48:17 +01:00
|
|
|
<form action="{{ url('/questions/new') }}" enctype="multipart/form-data" method="post">
|
|
|
|
{{ csrf() }}
|
|
|
|
<div class="col-md-12">
|
|
|
|
<h4>{{ __('question.add') }}</h4>
|
2023-04-19 22:34:08 +02:00
|
|
|
{{ f.textarea('text', __('question.question'), {
|
|
|
|
'required': true,
|
|
|
|
'rows': 5,
|
|
|
|
}) }}
|
2021-12-10 20:48:17 +01:00
|
|
|
{{ f.submit() }}
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|
2020-12-06 00:16:15 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|