Refactor admin newses + add csrf

This commit is contained in:
slawkens
2023-11-11 07:22:43 +01:00
parent 5578dbaa83
commit f27172691c
7 changed files with 121 additions and 179 deletions

View File

@@ -20,16 +20,7 @@
<b>
<p>{{ article.title|raw }}
{% if canEdit %}
<a href="{{ constant('ADMIN_URL') }}?p=news&action=edit&id={{ article.id }}" title="Edit">
<img src="images/edit.png"/>Edit
</a>
<a id="delete" href="{{ constant('ADMIN_URL') }}?p=news&action=delete&id={{ article.id }}" onclick="return confirm('Are you sure?');" title="Delete">
<img src="images/del.png"/>Delete
</a>
<a href="{{ constant('ADMIN_URL') }}?p=news&action=hide&id={{ article.id }}" title="{% if article.hidden != 1 %}Hide{% else %}Show{% endif %}">
<img src="images/{% if article.hidden != 1 %}success{% else %}error{% endif %}.png"/>
{% if article.hidden != 1 %}Hide{% else %}Show{% endif %}
</a>
{{ include('admin.links.html.twig', {page: 'news', id: article.id, hidden: article.hidden }) }}
{% endif %}
</p>
</b>