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

{{ m.button(m.icon('chevron-left'), url('/faq'), 'secondary', 'sm') }} {{ block('title') }}

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

{{ m.icon('clock') }} {{ faq.updated_at.format(__('general.datetime')) }} {% if faq.updated_at != faq.created_at %}  {{ __('form.updated') }}
{{ m.icon('clock') }} {{ faq.created_at.format(__('general.datetime')) }} {% endif %}

{% endif %}
{{ csrf() }}
{{ f.input('question', __('faq.question'), { 'required': true, 'value': faq ? faq.question : '', }) }}
{{ f.textarea('text', __('faq.message'), { 'required': true, 'rows': 10, 'value': faq ? faq.text : '', }) }} {{ f.submit(__('form.save'), {'icon_left': 'save'}) }} {{ f.submit(m.icon('eye'), {'name': 'preview', 'btn_type': 'info', 'title': __('form.preview')}) }} {% if faq and faq.id %} {{ f.delete(__('form.delete'), {'confirm_title': __('faq.delete.title', [faq.question[:40]|e])})}} {% endif %}
{% if faq %}

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

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