<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <style>
        .navbar{
            background: darkkhaki;
        }
        span{
            color: #b2d7ff;
            text-decoration: none;
            background: transparent;
        }
        ul{
            text-align: justify;
            margin-left: 50px;
            margin-right: 50px;

        }
        body{
            background-color: wheat;
        }
        .navbar-brand {
            color: #343a40;
            font-weight: bold;
        }

        .nav-link {
            color: #343a40;
            font-weight: bold;

        }
        footer{
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: #111;
            height: auto;
            width: 100vw;
            padding-top: 40px;
            color: #fff;
        }
        .footer-content{
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            text-align: center;
            height: 80px;
        }
        .footer-content h3{
            font-size: 2.1rem;
            font-weight: 500;
            text-transform: capitalize;
            line-height: 3rem;
            margin-top: 20px;
        }
        .footer-content p{
            max-width: 500px;
            margin: 10px auto;
            line-height: 28px;
            font-size: 14px;
            color: #cacdd2;
        }
        .socials{
            list-style: none;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 1rem 0 3rem 0;
        }
        .socials li{
            margin: 0 10px;
        }
        .socials a{
            text-decoration: none;
            color: #fff;
            border: 1.1px solid white;
            padding: 5px;
            border-radius: 50%;
        }
        .socials a i{
            font-size: 1.1rem;
            width: 20px;
            transition: color .4s ease;
        }
        .socials a:hover i{
            color: aqua;
        }
        .footer-bottom p{
            float: left;
            font-size: 14px;
            word-spacing: 2px;
            text-transform: capitalize;
        }
        .footer-bottom p a{
            color:#44bae8;
            font-size: 16px;
            text-decoration: none;
        }
        .footer-bottom span{
            text-transform: uppercase;
            opacity: .4;
            font-weight: 200;
        }
        .footer-menu ul{
            display: flex;
        }
        .footer-menu ul li{
            padding-right: 10px;
            display: block;
        }
        .footer-menu ul li a{
            color: #cfd2d6;
            text-decoration: none;
        }
        .footer-menu ul li a:hover{
            color: #27bcda;
        }
        @media (max-width:500px) {
            .footer-menu ul{
                display: flex;
                margin-top: 10px;
                margin-bottom: 20px;
            }
        }
        .kopce{
            background-color: mediumslateblue;
            border: none;
            color: white;
            padding: 15px 32px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
            font-size: 16px;
            margin-left: 20px;
        }
        /*#logo{*/
        /*    width:160px;*/
        /*    height: 60px*/
        /*}*/
        h1{
            color: black;
            font-size: 60px;
            font-weight: 700;
            letter-spacing: 8px;
            margin-bottom: 20px;
            margin-left:auto;
            margin-right:auto;
            margin-top:50px;
            position: relative;
            animation: text 3s 1;
        }
        @keyframes text {
            0%{
                color: black;
                margin-bottom: -40px;
            }
            30%{
                letter-spacing: 25px;
                margin-bottom: -40px;
            }
            85%{
                letter-spacing: 8px;
                margin-bottom: -40px;
            }
        }
        footer{
            width: 100%;
            padding: 20px;
            box-sizing: border-box;
        }
    </style>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="UTF-8">
    <title>My events</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</head>
<body>
    <div>
        <nav class="navbar navbar-expand-md ">
            <div  class="container">
                <!--                    <img class="u-image u-image-default u-image-1" src="../static/logoeventra.png" alt="" data-image-width="648" data-image-height="292">-->
                <!--                <a class="navbar-brand" href="/home"></a>-->
                <a class="navbar-brand"> Eventrra</a>
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault"
                        aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>

                <div class="collapse navbar-collapse justify-content-end" id="navbarsExampleDefault">
                    <ul class="navbar-nav m-auto">

                        <li th:if="${session.user!=null}" class="nav-item m-auto">
                            <a  class="nav-link active" href="/">Home</a>
                        </li>

                        <li th:if="${session.user!=null and session.role == 'ROLE_CLIENT'}"
                            class="nav-item m-auto">
                            <a class="kopce" href="/host_event">Host an event</a>
                        </li>
                        <li th:if="${session.user!=null}" class="nav-item m-auto">
                            <a class="nav-link active" href="/my_events">Scheduled events</a>
                        </li>
                    </ul>
                </div>
            </div>
        </nav>
    </div>

    <div class="container mb-4">
        <div class="row">
            <div class="col-12">
                <div class="table-responsive">
                    <table class="table table-striped">
                        <thead class="thead-dark">
                        <tr>
                            <th scope="col">Time</th>
                            <th scope="col">Date</th>
                            <th scope="col">Status</th>
                            <th scope="col"></th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="event : ${events}" class="event">
                            <td th:text="${event.getTime()}"></td>
                            <td th:text="${event.getDate()}"></td>
                            <td th:text="${event.getStatus()}">
                            <td>
                                <form method="get" th:action="@{'/event/{id}' (id=${event.getId()}) }">
                                    <button class="btn btn-primary btn-block btn-lg" type="submit">Details</button>
                                </form>
                            </td>
    <!--                        <td class="text-right">-->
    <!--                            <th:block sec:authorize="hasRole('ROLE_ADMIN')">-->
    <!--                                <form th:action="@{'/products/delete/{id}' (id=${product.getId()})}"-->
    <!--                                      th:method="DELETE">-->
    <!--                                    <button type="submit"-->
    <!--                                            class="btn btn-sm btn-danger delete-product">-->
    <!--                                        <i class="fa fa-trash">Delete</i>-->
    <!--                                    </button>-->
    <!--                                </form>-->
    <!--                            </th:block>-->
    <!--                            <th:block sec:authorize="hasRole('ROLE_ADMIN')">-->
    <!--                                <a th:href="@{'/products/edit-form/{id}' (id=${product.getId()})}"-->
    <!--                                   class="btn btn-sm btn-info edit-product">-->
    <!--                                    <i class="fa fa-trash">Edit</i>-->
    <!--                                </a>-->
    <!--                            </th:block>-->
    <!--                            <form th:action="@{'/shopping-cart/add-product/{id}' (id=${product.getId()})}"-->
    <!--                                  th:method="POST"-->
    <!--                                  sec:authorize="isAuthenticated()">-->
    <!--                                <button type="submit"-->
    <!--                                        class="btn btn-sm btn-primary cart-product">-->
    <!--                                    <i class="fa fa-trash">Add product to cart</i>-->
    <!--                                </button>-->
    <!--                            </form>-->
    <!--                        </td>-->
                        </tr>
                        </tbody>
                    </table>
                    <br>
                    <br>
                    <br>
                    <br>
                </div>
            </div>
    <!--        <div class="col mb-3">-->
    <!--            <div class="row">-->
    <!--                <div class="col-sm-12 col-md-12" sec:authorize="hasRole('ROLE_ADMIN')">-->
    <!--                    <a href="/products/add-form" class="btn btn-block btn-dark add-product-btn">-->
    <!--                        Add new product-->
    <!--                    </a>-->
    <!--                </div>-->
    <!--            </div>-->
    <!--        </div>-->
        </div>
    </div>

    <footer>
        <div class="footer-content">
            <br>
            <h3>Contact us</h3>

            <ul class="socials">
                <li><a href="#"><i class="fa fa-facebook"></i></a></li>
                <li><a href="#"><i class="fa fa-twitter"></i></a></li>
                <li><a href="#"><i class="fa fa-google-plus"></i></a></li>
                <li><a href="#"><i class="fa fa-youtube"></i></a></li>
                <li><a href="#"><i class="fa fa-linkedin-square"></i></a></li>
            </ul>
        </div>
    </footer>
<!--<div>-->
<!--    <h1 class="mt-3 mb-3">My events</h1>-->
<!--    <table class="table table-bordered">-->
<!--        <thead class="thead-dark">-->
<!--        <tr>-->
<!--            <th>Time</th>-->
<!--            <th>Date</th>-->
<!--            <th>Location</th>-->
<!--            <th>Type</th>-->
<!--            <th>Description</th>-->
<!--            <th>Status</th>-->
<!--        </tr>-->
<!--        </thead>-->
<!--        <tbody>-->
<!--        <tr th:each="event : ${events}">-->
<!--            <td th:text="${event.getTime()}"></td>-->
<!--            <td th:text="${event.getDate()}"></td>-->
<!--            <td th:text="${event.location}"></td>-->
<!--            <td th:text="${event.getType()}"></td>-->
<!--            <td th:text="${event.getDescription()}"></td>-->
<!--            <td th:text="${event.getStatus()}"></td>-->
<!--        </tr>-->
<!--        </tbody>-->
<!--    </table>-->
<!--</div>-->
</body>
</html>