<!DOCTYPE html>
<html lang="en" xmlns:tr="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Orders</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"
          integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB"
          crossorigin="anonymous">
    <link href="../static/App.css" rel="stylesheet" media="screen" th:href="@{/App.css}" />
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
    <div th:replace="/base/baseapp :: header" class="App-header">...</div>
    <div th:replace="/base/baseapp :: nav" class="nav-">...</div>
    <div class="container">
        <a class="btn button-go4me" th:href="@{/}">Back!</a>
        <div style="margin-right: auto">
            <h1 class="text-center">Orders</h1>
            <table
                    class="table table-sm table-striped table-hover table-bordered">
                <thead>
                <tr>
                    <th>Id</th>
                    <th>Description</th>
                    <th>Cost</th>
                    <th>Hour</th>
                    <th>Day</th>
                    <th>Month</th>
                    <th>PublishedBy</th>
                    <th></th>
                </tr>
                </thead>
                <tbody>
                    <tr th:each="order : ${OrderRequest}">
                        <td th:text="${order.getID()}"></td>
                        <td th:text="${order.getDescription()}"></td>
                        <td th:text="${order.getMaxCost()}"></td>
                        <td th:text="${order.getHour()}"></td>
                        <td th:text="${order.getDay()}"></td>
                        <td th:text="${order.getMonth()}"></td>
                        <td>
                            <a th:text="${order.getPublishedBy().userName}" href="/profile/jesuspa98"></a>
                        </td>
                        <td><a class="btn button-go4me btn-sm" th:href="@{'/order/' + ${order.getID()}}">View Order</a></td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</body>
