84 lines
3.4 KiB
Twig
84 lines
3.4 KiB
Twig
{% extends 'administrative/layout.html.twig' %}
|
|
|
|
{% block title %}News{% endblock %}
|
|
|
|
{% block content %}
|
|
<h1 class="text-2xl font-bold pb-8">
|
|
News
|
|
</h1>
|
|
<div class="data-table-wrapper">
|
|
<div class="data-table-wrapper__inner">
|
|
<table class="data-table">
|
|
<thead>
|
|
<tr>
|
|
<th>
|
|
{{ icon('eye', 'w-4 h-4') }}
|
|
</th>
|
|
<th class="w-1/2">
|
|
Nachricht
|
|
</th>
|
|
<th>
|
|
Status
|
|
</th>
|
|
<th>
|
|
erstellt
|
|
</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for item in news %}
|
|
<tr>
|
|
<td>
|
|
{% if item == activeNews %}
|
|
<svg viewBox="0 0 5 5" class="{{ html_classes('h-4 w-4 fill-current', { 'text-blue-600': item.status == 1, 'text-red-600': item.status == 2 }) }}">
|
|
<circle cx="3" cy="3" r="2" />
|
|
</svg>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
{{ item.message | u.truncate(48, '...') }}
|
|
</td>
|
|
<td>
|
|
{{ ('label.news.status.' ~ item.status) | trans }}
|
|
</td>
|
|
<td>
|
|
{{ item.createdAt | date('d.m.Y') }}
|
|
</td>
|
|
<td>
|
|
<div class="flex items-center space-x-2 justify-end">
|
|
<button type="button"
|
|
hx-get="{{ path('app_administrative_system_news_edit', { 'id': item.id }) }}"
|
|
hx-target="body"
|
|
hx-swap="beforeend">
|
|
{{ icon('edit') }}
|
|
</button>
|
|
<button type="button"
|
|
class="text-red-500"
|
|
hx-get="{{ path('app_administrative_system_news_delete', { 'id': item.id }) }}"
|
|
hx-target="body"
|
|
hx-swap="beforeend">
|
|
{{ icon('delete') }}
|
|
</button>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr>
|
|
<td colspan="3">
|
|
Keine Daten...
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<button type="button"
|
|
class="btn"
|
|
hx-get="{{ path('app_administrative_system_news_create') }}"
|
|
hx-target="body"
|
|
hx-swap="beforeend">
|
|
Neu
|
|
</button>
|
|
{% endblock %} |