1

Merge remote-tracking branch 'origin/edit-User' into edit-User

# Conflicts:
#	src/main/resources/templates/index.html
This commit is contained in:
kasch309
2020-03-18 16:18:14 +01:00
5 changed files with 43 additions and 20 deletions

View File

@ -58,8 +58,10 @@
<div style="display: inline-block; margin: 0">
<h2>Mitglieder</h2>
<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; float: right" >Mitglieder bearbeiten</button>
<form method="get" th:action="@{/gruppen2/details/members/{id}(id=${group.getId()})}">
<button class="btn btn-secondary" style="background: slategrey; float: right" >
Mitglieder bearbeiten
</button>
</form>
</div>
<br>

View File

@ -38,15 +38,24 @@
</tr>
</thead>
<tbody class="table-striped">
<tr th:each="member : ${group.getMembers()}">
<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>
<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 btn-sm">Rolle ändern</button> <!-- th:if -->
<button class="btn btn-danger btn-sm" >Mitglied entfernen</button>
<form method="post" action="/gruppen2/details/members/changeRole">
<input type="hidden" th:name="group_id" th:value="${group.getId()}">
<input type="hidden" th:name="user_id" th:value="${member.getUser_id()}">
<button type="submit" class="btn btn-warning btn-sm">Rolle ändern</button><!-- th:if -->
</form>
<form method="post" action="/gruppen2/details/members/changeRole">
<input type="hidden" th:name="group_id" th:value="${group.getId()}"></input>
<input type="hidden" th:name="user_id" th:value="${member.getUser_id()}"></input>
<button class="btn btn-danger btn-sm">Mitglied entfernen</button>
</form>
</td>
</tr>
</tbody>

View File

@ -40,8 +40,8 @@
<div th:each="gruppe: ${gruppen}">
<div class="shadow-sm p-4" style="border: none; background: aliceblue">
<h3 style="color: black; font-weight: bold;">
<a th:href="@{/gruppen2/details(id=${gruppe.getId()})}" th:text="${gruppe.getTitle()}"></a>
<h3 style="color: dodgerblue; font-weight: bold;">
<a th:href="@{/gruppen2/details/{id}(id=${gruppe.getId()})}" th:text="${gruppe.getTitle()}"></a>
</h3>
<div class="shadow-sm p-4" style="background: white">
<p style="overflow-wrap: break-word" th:text="${#strings.abbreviate(gruppe.getDescription(),300)}"></p>