<!DOCTYPE html>
<html lang="en"
      th:replace="~{mopslayout :: html(name='Gruppenbildung', headcontent=~{:: headcontent}, navigation=~{:: navigation}, bodycontent=~{:: bodycontent})}"
      xmlns="http://www.w3.org/1999/html"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>Gruppenerstellung</title>
    <th:block th:fragment="headcontent">
        <!-- Links, Skripts, Styles hier einfügen! -->
        <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
              rel="stylesheet">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
    </th:block>
</head>
<body>
<header>
    <nav class="navigation navigation-secondary" is="mops-navigation" th:fragment="navigation">
        <ul>
            <li class="active">
                <a th:href="@{/gruppen2}">Gruppen</a>
            </li>
            <li>
                <a th:href="@{/gruppen2/create}">Erstellen</a>
            </li>
            <li>
                <a th:href="@{/gruppen2/search}">Suche</a>
            </li>
        </ul>
    </nav>
</header>
<main th:fragment="bodycontent">
    <div class="container-fluid">
        <div class="row">
            <div class="col-10">
                <h1>Metadaten ändern</h1>
                <form method="post" th:action="@{/gruppen2/details/{id}/meta/update(id=${group.getId()})}">
                    <div class="shadow-sm p-2"
                         style=" border: 10px solid aliceblue; background: aliceblue;">
                        <div class="form-group">
                            <label for="title">Titel</label>
                            <input class="form-control" id="title" required
                                   th:name="title" th:value="${group.getTitle()}" type="text">
                        </div>
                        <div class="form-group">
                            <label for="description">Beschreibung</label>
                            <textarea class="form-control" id="description" required rows="3"
                                      th:name="description"
                                      th:text="${group.getDescription()}"></textarea>
                        </div>
                        <div class="form-group pt-4">
                            <button class="btn btn-primary"
                                    style="background: #52a1eb; border-style: none;"
                                    th:if="${group.getRoles().get(user.getId()) == admin}"
                                    type="submit">Speichern
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</main>
</body>
</html>
