{% 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 %}

{{ block('title') }}

{% include 'layouts/parts/messages.twig' %} {% if faq and faq.id %}

{{ m.icon('clock') }} {{ faq.updated_at.format(__('Y-m-d H:i')) }} {% if faq.updated_at != faq.created_at %}  {{ __('form.updated') }}
{{ m.icon('clock') }} {{ faq.created_at.format(__('Y-m-d H:i')) }} {% endif %}

{% endif %}
{{ csrf() }}
{{ f.input('question', __('faq.question'), null, {'required': true, 'value': faq ? faq.question : ''}) }}
{{ f.textarea('text', __('faq.message'), {'required': true, 'rows': 10, 'value': faq ? faq.text : ''}) }} {{ f.submit() }} {{ f.submit(m.icon('eye'), {'name': 'preview', 'btn_type': 'info', 'title': __('form.preview')}) }} {% if faq and faq.id %} {{ f.submit(m.icon('trash'), {'name': 'delete', 'btn_type': 'danger', 'title': __('form.delete')}) }} {% endif %}
{% if faq %}

{{ __('form.preview') }}

{{ faq.question }}
{{ faq.text|markdown }}
{% endif %}
{% endblock %}