1

fix visibility in controller

This commit is contained in:
killerber4t
2020-03-16 12:37:45 +01:00
parent 051b3c3724
commit e2978e10d0
3 changed files with 8 additions and 4 deletions

View File

@ -87,7 +87,11 @@ public class Gruppen2Controller {
@RequestParam(value = "visibility", required = false) Boolean visibility) {
Account account = keyCloakService.createAccountFromPrincipal(token);
if (visibility == null) visibility=false;
if (visibility == null) {
visibility = true;
}else{
visibility = false;
}
controllerService.createGroup(account, title, beschreibung, visibility);
return "redirect:/gruppen2/";

View File

@ -77,7 +77,7 @@ public class GroupService {
* @throws EventException
*/
public List<Group> getAllGroupWithVisibilityPublic() throws EventException {
return projectEventList(eventService.translateEventDTOs(eventRepository.findEventDTOByVisibility(Boolean.FALSE)));
return projectEventList(eventService.translateEventDTOs(eventRepository.findEventDTOByVisibility(Boolean.TRUE)));
}

View File

@ -31,8 +31,8 @@
<form action="/" method="get">
<h1 style="color: dodgerblue; font-weight: bold" th:text="${group.getTitle()}"></h1>
<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-primary" th:if="${group.getVisibility() == group.getVisibility().PRIVATE}">Öffentliche 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().PUBLIC}">Öffentliche Gruppe</span>
<span class="badge badge-pill badge-success" style="background: lightseagreen" th:if="${group.getType() == group.getType().LECTURE}"> Veranstaltung</span>
</p>
<p th:text="${group.getDescription()}"></p>