fix visibility in controller
This commit is contained in:
@ -87,7 +87,11 @@ public class Gruppen2Controller {
|
|||||||
@RequestParam(value = "visibility", required = false) Boolean visibility) {
|
@RequestParam(value = "visibility", required = false) Boolean visibility) {
|
||||||
|
|
||||||
Account account = keyCloakService.createAccountFromPrincipal(token);
|
Account account = keyCloakService.createAccountFromPrincipal(token);
|
||||||
if (visibility == null) visibility=false;
|
if (visibility == null) {
|
||||||
|
visibility = true;
|
||||||
|
}else{
|
||||||
|
visibility = false;
|
||||||
|
}
|
||||||
controllerService.createGroup(account, title, beschreibung, visibility);
|
controllerService.createGroup(account, title, beschreibung, visibility);
|
||||||
|
|
||||||
return "redirect:/gruppen2/";
|
return "redirect:/gruppen2/";
|
||||||
|
|||||||
@ -77,7 +77,7 @@ public class GroupService {
|
|||||||
* @throws EventException
|
* @throws EventException
|
||||||
*/
|
*/
|
||||||
public List<Group> getAllGroupWithVisibilityPublic() throws EventException {
|
public List<Group> getAllGroupWithVisibilityPublic() throws EventException {
|
||||||
return projectEventList(eventService.translateEventDTOs(eventRepository.findEventDTOByVisibility(Boolean.FALSE)));
|
return projectEventList(eventService.translateEventDTOs(eventRepository.findEventDTOByVisibility(Boolean.TRUE)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -31,8 +31,8 @@
|
|||||||
<form action="/" method="get">
|
<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().PUBLIC }">Private Gruppe</span>
|
<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-primary" th:if="${group.getVisibility() == group.getVisibility().PRIVATE}">Öffentliche Gruppe</span>
|
<span class="badge badge-pill badge-primary" th:if="${group.getVisibility() == group.getVisibility().PUBLIC}">Öffentliche Gruppe</span>
|
||||||
<span class="badge badge-pill badge-success" style="background: lightseagreen" th:if="${group.getType() == group.getType().LECTURE}"> Veranstaltung</span>
|
<span class="badge badge-pill badge-success" style="background: lightseagreen" th:if="${group.getType() == group.getType().LECTURE}"> Veranstaltung</span>
|
||||||
</p>
|
</p>
|
||||||
<p th:text="${group.getDescription()}"></p>
|
<p th:text="${group.getDescription()}"></p>
|
||||||
|
|||||||
Reference in New Issue
Block a user