1

Merge remote-tracking branch 'origin/edit-User' into import-csv-in-overview

# Conflicts:
#	src/main/java/mops/gruppen2/controller/Gruppen2Controller.java
#	src/main/java/mops/gruppen2/service/ControllerService.java
This commit is contained in:
XXNitram
2020-03-18 15:15:06 +01:00
9 changed files with 133 additions and 28 deletions

View File

@ -35,11 +35,11 @@
<div class="shadow-sm p-4" style="border: 10px solid aliceblue; background: aliceblue">
<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().PRIVATE }">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().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 th:text="${group.getDescription()}"></p>
<p style="overflow-wrap: break-word" th:text="${group.getDescription()}"></p>
<div class="form-group">
<div class="text-right">
<form method="post" action="/gruppen2/leaveGroup">
@ -52,14 +52,18 @@
<div class="col-3" style="white-space: nowrap">
<div>
<h2 style="display: inline-block; margin: 0">Mitglieder</h2>
<button class="btn btn-secondary" type="warning" style="background: slategrey; float: right" >Mitglieder bearbeiten</button>
<div th:if='${group.getRoles().get(user.getUser_id()) == admin}'>
<form method="get" action="/gruppen2/details/members">
<button th:name="group_id" th:value="${group.getId()}" class="btn btn-secondary" type="submit" style="background: slategrey; margin-top: 200px; float: right" >Mitglieder bearbeiten</button>
</form>
</div>
<p></p>
</div>
<div>
<ul th:each="member : ${group.getMembers()}" class="list-group-flush" style="background: slategrey">
<li class="list-group-item" style="background: aliceblue">
<span th:text="${member.getUser_id()}"></span>
<span th:if="${role == role.ADMIN}" class="badge badge-success">admin</span>
<span th:if='${group.getRoles().get(member.getUser_id()) == admin}' class="badge badge-success">admin</span>
</li>
</ul>
</div>

View File

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
th:replace="~{mopslayout :: html(name='Gruppenbildung', headcontent=~{:: headcontent}, navigation=~{:: navigation}, bodycontent=~{:: bodycontent})}">
<head>
<meta charset="utf-8">
<title>Gruppendetails</title>
<th:block th:fragment="headcontent">
<!-- Links, Skripts, Styles hier einfügen! -->
</th:block>
</head>
<body>
<header>
<nav class="navigation navigation-secondary" is="mops-navigation" th:fragment="navigation">
<ul>
<li class="active">
<a th:href="@{/gruppen2}" href="/">Gruppen</a>
</li>
<li>
<a th:href="@{/gruppen2/createGroup}" href="/createGroup">Erstellen</a>
</li>
<li>
<a th:href="@{/gruppen2/findGroup}" href="/findGroup">Suche</a>
</li>
</ul>
</nav>
</header>
<main th:fragment="bodycontent">
<div class="container-fluid">
<div class="row">
<div class="col-9">
<div class="shadow-sm p-4" style="border: 10px solid aliceblue; background: aliceblue">
<table class="table">
<thead>
<tr>
<th scope="col">Mitglied</th>
<th scope="col">Rolle</th>
<th scope="col" style="width: 320px">Optionen</th>
</tr>
</thead>
<tbody class="table-striped">
<tr th:each="member : ${group.getMembers()}">
<th th:text="${member.getUser_id()}"></th>
<td>
<span th:if='${group.getRoles().get(member.getUser_id()) == admin}'>Mitglied</span>
<span th:if='${group.getRoles().get(member.getUser_id()) != admin}'>Admin</span>
</td>
<td>
<button class="btn btn-warning">Rolle ändern</button> <!-- th:if -->
<button class="btn btn-danger">Mitglied entfernen</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>

View File

@ -16,7 +16,7 @@
<br>
<div>
<button type="button" class="btn btn-primary" style="margin: auto">
<a style="color: white" href="#" onclick="javascript:window.history.back(-1);return false;">Zurück zur letzten Seite</a>
<a style="color: white" href="index.html">Zurück zur Hauptseite</a>
</button>
</div>
<br>

View File

@ -39,7 +39,7 @@
<h3 style="color: dodgerblue; font-weight: bold;">
<a th:href="@{/gruppen2/details(id=${gruppe.getId()})}" th:text="${gruppe.getTitle()}"></a>
</h3>
<p th:text="${gruppe.getDescription()}"></p>
<p style="overflow-wrap: break-word" th:text="${#strings.abbreviate(gruppe.getDescription(),300)}"></p>
</div>
<br>
</div>

View File

@ -48,7 +48,6 @@
<tr>
<th scope="col">Gruppenname</th>
<th scope="col">Beschreibung</th>
<th scope="col">Öffentlich/Privat</th>
<th scope="col">Mitgliederanzahl</th>
</tr>
</thead>
@ -57,8 +56,7 @@
<th scope="row">
<a th:href="@{/gruppen2/detailsSearch(id=${gruppe.getId()})}" th:text="${gruppe.title}">Gruppenname</a>
</th>
<td th:text="${gruppe.getDescription()}">Beschreibung</td>
<td th:text="${gruppe.getVisibility()}">Öffentlich</td>
<td style="" th:text="${#strings.abbreviate(gruppe.getDescription(), 50)}">Beschreibung</td>
<td th:text="${gruppe.getMembers().size()}">Mitgliederanzahl</td>
</tr>
</tbody>