mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-14 05:16:12 +01:00
tea/Resources/Private/Templates/FrontEndEditor/Index.html
Oliver Klee cda38af84b
[FEATURE] Add a delete functionality for the Tea FE editor (#876)
The delete action is triggered using a form with a submit button,
causing a POST request to be sent instead of a GET request.
This is because GET requests should not modify (or delete) data,
but only read it and be idempotent. Also, the request then
is guaranteed to not get cached.

From a usability perspective, a button instead of a link also
is semantically more correct: A link is expected to bring you
to some place, whereas a button is expected to trigger some
action.

Closes #871
2023-06-23 11:55:19 +02:00

60 lines
2.4 KiB
HTML

<!DOCTYPE html>
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="FrontEndEditor"/>
<f:section name="main">
<h2>
<f:translate key="plugin.frontEndEditor.index.heading"/>
</h2>
<p class="btn btn-link">
<f:link.action action="new">
<f:translate key="plugin.frontEndEditor.action.new"/>
</f:link.action>
</p>
<f:if condition="{teas}">
<f:then>
<table class="table table-striped table-hover">
<tr>
<th scope="col">
<f:translate key="plugin.frontEndEditor.property.uid"/>
</th>
<th scope="col">
<f:translate key="plugin.frontEndEditor.property.title"/>
</th>
<th scope="col" colspan="2">
<f:translate key="plugin.frontEndEditor.action.actions"/>
</th>
</tr>
<f:for each="{teas}" as="tea">
<tr>
<td>
{tea.uid}
</td>
<td>
{tea.title}
</td>
<td>
<f:link.action action="edit" arguments="{tea: tea}">
<f:translate key="plugin.frontEndEditor.action.edit"/>
</f:link.action>
</td>
<td>
<f:form action="delete" name="tea" object="{tea}">
<f:form.submit value="{f:translate(key: 'plugin.frontEndEditor.action.delete')}"
class="btn btn-danger"/>
</f:form>
</td>
</tr>
</f:for>
</table>
</f:then>
<f:else>
<p class="alert alert-info" role="alert">
<f:translate key="plugin.frontEndEditor.message.noTeas"/>
</p>
</f:else>
</f:if>
</f:section>
</html>