<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" layout:decorate="~{template}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<body>
	<th:block layout:fragment="content">
		<div class="tablebox" sec:authorize="hasRole('admin')">
			<table id="docs" class="table table-striped" style="width: 100% !important">
				<thead>
					<tr>
						<td>Name</td>
						<td>URL</td>
						<td>Wegbeschreibung</td>
					</tr>
				</thead>
				<tbody>
					<tr th:each="l : ${locations}">
						<td><a th:href="@{/admin/location/edit/{id}(id=${l.pk})}"><i class="fas fa-pen beforetext"></i><span th:text="${l.name}"></span></a></td>
						<td><a th:href="${l.url}" target="_blank"><i class="fas fa-external-link-alt beforetext"></i><span th:text="${l.url}"></span></a></td>
						<td><a th:href="@{/document/{id}(id=${l.fkDocument})}"><i class="fas fa-download beforetext"></i>anzeigen</a></td>
					</tr>
				</tbody>
				<tfoot>
					<tr>
						<td colspan="3" style="text-align: center"><a th:href="@{/admin/location/add}" class="btn btn-outline-primary">neues Freizeitheim anlegen</a></td>
					</tr>
				</tfoot>
			</table>
			<script>
				$(document).ready(function() {
					$("#docs").DataTable({
						language : locale_de
					});
				});
			</script>
		</div>
	</th:block>
</body>
</html>