2020-12-06 00:16:15 +01:00
|
|
|
{% extends 'layouts/app.twig' %}
|
|
|
|
{% import 'macros/base.twig' as m %}
|
|
|
|
{% import 'macros/form.twig' as f %}
|
|
|
|
|
|
|
|
{% block title %}{{ faq and faq.id ? __('faq.edit') : __('faq.add') }}{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="container">
|
2023-10-25 17:38:23 +02:00
|
|
|
<h1>
|
|
|
|
{{ m.button(m.icon('chevron-left'), url('/faq'), 'secondary', 'sm') }}
|
|
|
|
{{ block('title') }}
|
|
|
|
</h1>
|
2020-12-06 00:16:15 +01:00
|
|
|
|
|
|
|
{% include 'layouts/parts/messages.twig' %}
|
|
|
|
|
|
|
|
{% if faq and faq.id %}
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6">
|
|
|
|
<p>
|
2021-07-22 21:22:21 +02:00
|
|
|
{{ m.icon('clock') }} {{ faq.updated_at.format(__('Y-m-d H:i')) }}
|
2020-12-06 00:16:15 +01:00
|
|
|
|
|
|
|
{% if faq.updated_at != faq.created_at %}
|
|
|
|
 {{ __('form.updated') }}
|
|
|
|
<br>
|
2021-07-22 21:22:21 +02:00
|
|
|
{{ m.icon('clock') }} {{ faq.created_at.format(__('Y-m-d H:i')) }}
|
2020-12-06 00:16:15 +01:00
|
|
|
{% endif %}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<form action="" enctype="multipart/form-data" method="post">
|
|
|
|
{{ csrf() }}
|
|
|
|
|
2021-07-24 12:38:23 +02:00
|
|
|
<div class="row mb-4">
|
2020-12-06 00:16:15 +01:00
|
|
|
<div class="col-md-12">
|
2023-04-19 22:34:08 +02:00
|
|
|
{{ f.input('question', __('faq.question'), {
|
|
|
|
'required': true,
|
|
|
|
'value': faq ? faq.question : '',
|
|
|
|
}) }}
|
2020-12-06 00:16:15 +01:00
|
|
|
</div>
|
|
|
|
<div class="col-md-12">
|
2023-04-19 22:34:08 +02:00
|
|
|
{{ f.textarea('text', __('faq.message'), {
|
|
|
|
'required': true,
|
|
|
|
'rows': 10,
|
|
|
|
'value': faq ? faq.text : '',
|
|
|
|
}) }}
|
2020-12-06 00:16:15 +01:00
|
|
|
|
2023-11-05 16:29:07 +01:00
|
|
|
{{ f.submit(__('form.save'), {'icon_left': 'save'}) }}
|
2020-12-06 00:16:15 +01:00
|
|
|
|
2021-07-24 12:38:23 +02:00
|
|
|
{{ f.submit(m.icon('eye'), {'name': 'preview', 'btn_type': 'info', 'title': __('form.preview')}) }}
|
2020-12-06 00:16:15 +01:00
|
|
|
|
|
|
|
{% if faq and faq.id %}
|
2023-11-05 16:29:07 +01:00
|
|
|
{{ f.delete(__('form.delete'), {'confirm_title': faq.question[:40]|e})}}
|
2020-12-06 00:16:15 +01:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% if faq %}
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12">
|
|
|
|
<h2>{{ __('form.preview') }}</h2>
|
|
|
|
|
2021-08-05 01:00:12 +02:00
|
|
|
<div class="card {% if theme.type =='light' %}bg-light{% else %}bg-dark{% endif %}">
|
2021-07-24 12:38:23 +02:00
|
|
|
<div class="card-header">
|
2020-12-06 00:16:15 +01:00
|
|
|
{{ faq.question }}
|
|
|
|
</div>
|
2021-08-05 01:00:12 +02:00
|
|
|
<div class="card-body bg-body">
|
2020-12-06 00:16:15 +01:00
|
|
|
{{ faq.text|markdown }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|