@ -116,6 +116,15 @@ public class Gruppen2Controller {
|
|||||||
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Group not found");
|
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Group not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator)"})
|
||||||
|
@PostMapping("/detailsBeitreten")
|
||||||
|
public String joinGroup(KeycloakAuthenticationToken token, Model model, @RequestParam(value = "id") Long id) throws EventException {
|
||||||
|
model.addAttribute("account", keyCloakService.createAccountFromPrincipal(token));
|
||||||
|
Account account = keyCloakService.createAccountFromPrincipal (token);
|
||||||
|
controllerService.addUser(account,id);
|
||||||
|
return "redirect:/gruppen2/";
|
||||||
|
}
|
||||||
|
|
||||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator)"})
|
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator)"})
|
||||||
@GetMapping("/detailsSearch")
|
@GetMapping("/detailsSearch")
|
||||||
public String showGroupDetailsNoMember (KeycloakAuthenticationToken token, Model model, @RequestParam (value="id") Long id) throws EventException {
|
public String showGroupDetailsNoMember (KeycloakAuthenticationToken token, Model model, @RequestParam (value="id") Long id) throws EventException {
|
||||||
|
|||||||
@ -29,7 +29,6 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-9">
|
<div class="col-9">
|
||||||
<div class="shadow-sm p-4" style="border: 10px solid aliceblue; background: aliceblue">
|
<div class="shadow-sm p-4" style="border: 10px solid aliceblue; background: aliceblue">
|
||||||
<form action="/" method="get">
|
|
||||||
<h1 style="color: dodgerblue; font-weight: bold" th:text="${group.getTitle()}"></h1>
|
<h1 style="color: dodgerblue; font-weight: bold" th:text="${group.getTitle()}"></h1>
|
||||||
<p style="font-weight: bold">
|
<p style="font-weight: bold">
|
||||||
<span class="badge badge-pill badge-dark" style="background: darkslategray" th:if="${group.getVisibility() == group.getVisibility().PRIVATE }">Private Gruppe</span>
|
<span class="badge badge-pill badge-dark" style="background: darkslategray" th:if="${group.getVisibility() == group.getVisibility().PRIVATE }">Private Gruppe</span>
|
||||||
@ -39,10 +38,11 @@
|
|||||||
<p th:text="${group.getDescription()}"></p>
|
<p th:text="${group.getDescription()}"></p>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
<button class="btn btn-primary" style="border-style: none;">Gruppe beitreten</button>
|
<form method="post" action="/gruppen2/detailsBeitreten">
|
||||||
|
<button type="submit" th:href="@{/gruppen2/detailsBeitreten(id=${group.getId()})}" th:name="id" th:value="${group.id}" class="btn btn-primary" style="border-style: none;">Gruppe beitreten</button>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user