<!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">
<head>
<title>Camp Organizer Business</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
	<th:block layout:fragment="content">
		<div class="mainpage">
			<div class="container" style="max-width: 100%" sec:authorize="hasRole('business_outlay')">
				<table id="table" class="table table-striped">
					<thead>
						<tr>
							<th>Händler / Shop</th>
							<th>Freizeit</th>
							<th>Betrag</th>
							<th>Tag / Uhrzeit</th>
						</tr>
					</thead>
					<tbody>
						<tr th:each="o : ${list}">
							<td><a th:href="@{/business/outlay/edit/{id}(id=${o.id})}" th:text="${o.trader}"></a></td>
							<td><a th:href="@{/business/outlay/edit/{id}(id=${o.id})}"  th:text="${o.campname}"></a></td>
							<td><a th:href="@{/business/outlay/edit/{id}(id=${o.id})}"  th:text="${#numbers.formatDecimal(o.cash, 1, 2, 'COMMA')} + ' €'"></a></td>
							<td><a th:href="@{/business/outlay/edit/{id}(id=${o.id})}"  th:text="${#temporals.format(o.buydate, 'dd.MM.yyyy, HH:mm.ss')}"></a></td>
						</tr>
					</tbody>
					<tfoot>
						<tr>
							<td colspan="4"><a th:href="@{/business/outlay/add}" class="btn btn-outline-primary form-control">neue Rechnung eintragen</a></td>
						</tr>
					</tfoot>
				</table>
				<div class="row">
				  <div class="col" th:each="c : ${camps}">
				    <a th:href="@{/business/outlay/summary/{id}(id=${c.id})}" class="btn btn-outline-primary" th:text="${c.campname}"></a>
				  </div>
				</div>
				<script>
					$(document).ready(function() {
						$("#table").DataTable({
							language : locale_de
						});
					});
				</script>
			</div>
		</div>
	</th:block>
</body>
</html>