1

add Mapping for search.html and create.html in Controller

This commit is contained in:
AndiBuls
2020-03-09 15:06:14 +01:00
parent a1ec6b28d4
commit 05d599ad0f
4 changed files with 47 additions and 32 deletions

View File

@ -31,4 +31,20 @@ public class Gruppen2Controller {
model.addAttribute("account", keyCloakService.createAccountFromPrincipal(token));
return "index";
}
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator)"})
@GetMapping("/createGroup")
public String createGroup(KeycloakAuthenticationToken token, Model model) {
model.addAttribute("account", keyCloakService.createAccountFromPrincipal(token));
return "create";
}
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator)"})
@GetMapping("/findGroup")
public String findGroup(KeycloakAuthenticationToken token, Model model) {
model.addAttribute("account", keyCloakService.createAccountFromPrincipal(token));
return "search";
}
}

View File

@ -13,19 +13,38 @@
<nav class="navigation navigation-secondary" is="mops-navigation" th:fragment="navigation">
<ul>
<li>
<a th:href="@{/}" href="/">Gruppen</a>
<a th:href="@{/gruppen2}" href="/">Gruppen</a>
</li>
<li class="active">
<a th:href="@{/createGroup}" href="/createGroup">Erstellen</a>
<a th:href="@{/gruppen2/createGroup}" href="/createGroup">Erstellen</a>
</li>
<li>
<a th:href="@{/findGroup}" href="/findGroup">Suche</a>
<a th:href="@{/gruppen2/findGroup}" href="/findGroup">Suche</a>
</li>
</ul>
</nav>
</header>
<main th:fragment="bodycontent">
<h1>Gruppenerstellung</h1>
<div class="container-fluid">
<form method="post" action="/">
<div style="border: 10px solid aliceblue; background: aliceblue">
<div class="form-group">
<label for="titel">Name der Gruppe</label>
<input type="text" class="form-control" id="titel" th:value="${titel}">
</div>
<div class="form-group">
<label for="beschreibung">Beschreibung der Gruppe</label>
<textarea type="text" class="form-control" id="beschreibung" th:value="${beschreibung}">
</textarea>
</div>
<div class="form-group">
</div>
</div>
</form>
</div>
</main>
</body>
</html>

View File

@ -13,13 +13,13 @@
<nav class="navigation navigation-secondary" is="mops-navigation" th:fragment="navigation">
<ul>
<li class="active">
<a th:href="@{/}" href="/">Gruppen</a>
<a th:href="@{/gruppen2}" href="/">Gruppen</a>
</li>
<li>
<a th:href="@{/createGroup}" href="/createGroup">Erstellen</a>
<a th:href="@{/gruppen2/createGroup}" href="/createGroup">Erstellen</a>
</li>
<li>
<a th:href="@{/findGroup}" href="/findGroup">Suche</a>
<a th:href="@{/gruppen2/findGroup}" href="/findGroup">Suche</a>
</li>
</ul>
</nav>
@ -28,10 +28,9 @@
<h1>Meine Gruppen</h1>
<div class="container-fluid">
<form action="/" method="get">
<div style="border: 10px solid ghostwhite; background: ghostwhite">
<h4 style="color: royalblue; font-weight: bold">Titel der Gruppe</h4>
<div style="border: 10px solid aliceblue; background: aliceblue">
<h4 style="color: dodgerblue; font-weight: bold">Titel der Gruppe</h4>
<p>Beschreibung der Gruppe ...</p>
</div>
</form>
</div>

View File

@ -13,38 +13,19 @@
<nav class="navigation navigation-secondary" is="mops-navigation" th:fragment="navigation">
<ul>
<li>
<a th:href="@{/}" href="/">Gruppen</a>
<a th:href="@{/gruppen2}" href="/">Gruppen</a>
</li>
<li>
<a th:href="@{/createGroup}" href="/createGroup">Erstellen</a>
<a th:href="@{/gruppen2/createGroup}" href="/createGroup">Erstellen</a>
</li>
<li class="active">
<a th:href="@{/findGroup}" href="/findGroup">Suche</a>
<a th:href="@{/gruppen2/findGroup}" href="/findGroup">Suche</a>
</li>
</ul>
</nav>
</header>
<main th:fragment="bodycontent">
<div class="container">
<div class="row justify-content-center">
<div class="col-sm-8 ">
<h1>Gruppenerstellung</h1>
<form method="post" action="/">
<div class="form-group">
<label>Titel der Gruppe</label>
<input class="form-control" type="text" th:value="${titel}" name="titel" placeholder="Titel der Gruppe">
</div>
<div class="form-group">
<label>Beschreibung der Gruppe</label>
<input class="form-control" type="text" th:value="${beschreibung}" name="beschreibung" placeholder="Beschreibung der Gruppe">
</div>
<div class="form-group">
<button type="submit" class="btn btn-outline-dark">weiter</button>
</div>
</form>
</div>
</div>
</div>
</main>
</body>
</html>