{% embed '@ui2022/modal__content.html.twig' with {
title: 'Template Library',
} %}
{% block body %}
<div class="table__filter">
<div class="row align-items-center">
<div class="col-12 col-sm-auto">
{% form_theme form '@ui2022/forms/themes/filtering.html.twig' %}
{{ form_start(form, {
action: path(
app.request.attributes.get('_route'),
app.request.attributes.get('_route_params')
),
attr: {
target: '_modal',
},
}) }}
{{ form_rest(form) }}
{{ form_end(form) }}
</div>
{% if type and default is not empty and default.sendable %}
<div class="col-12 col-sm-auto ml-sm-auto">
<a
class="modal__skip-link text-medium"
href="{{- path('app.notifications.dashboard.messages.create', {
template: default.id,
}) -}}"
>
Skip and start from scratch
</a>
</div>
{% endif %}
</div>
</div>
<div id="{{ form.vars.id }}__results">
{% set headers = [
{
title: 'Name',
sort: 'name',
},
{
title: 'Type',
spacing: 10,
sort: 'type',
},
{
title: 'Last Modified',
spacing: 15,
sort: 'timestamp',
},
] %}
{% embed '@ui2022/table--search.html.twig' with {
form: form,
headers: headers,
} %}
{% block items %}
{% if templates is empty %}
{% include '@ui2022/table__empty.html.twig' with {
title: 'No templates found',
} %}
{% else %}
{% for template in templates %}
<tr>
{% include '@ui2022/table__item__cell--status.html.twig' with {
title: template.name,
link: path('app.notifications.dashboard.messages.create', {
template: template.id,
}),
} %}
<td>
{{- 'app.notifications.templates.types.%s'|format((template.urgent) ? 'urgent' : 'general')|trans -}}
</td>
<td>
{{- template.timestampedAt|ui_relativeDate -}}
</td>
</tr>
{% endfor %}
{% endif %}
{% endblock %}
{% endembed %}
</div>
{% endblock %}
{% endembed %}