1

Merge branch 'master' into ui

This commit is contained in:
kasch309
2020-03-19 14:32:01 +01:00
committed by GitHub
64 changed files with 852 additions and 748 deletions

View File

@ -6,7 +6,8 @@
<title>Gruppendetails</title>
<th:block th:fragment="headcontent">
<!-- Links, Skripts, Styles hier einfügen! -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
@ -38,16 +39,25 @@
<div class="shadow p-2" style="border: 10px solid aliceblue; border-radius: 5px; background: aliceblue">
<!-- absichern im controller nicht vergessen -->
<div class="form-group pt-4" th:if="${account.getRoles().contains('orga')}">
<form method="post" action="/gruppen2/details/members/addUsersFromCsv" enctype="multipart/form-data">
<form action="/gruppen2/details/members/addUsersFromCsv"
enctype="multipart/form-data"
method="post">
<div class="row">
<div class="col-9">
<div class="custom-file">
<input type="file" class="custom-file-input" id="file" th:name="file">
<label class="custom-file-label" for="file">CSV Datei von Mitgliedern hochladen</label>
<input class="custom-file-input" id="file" th:name="file"
type="file">
<label class="custom-file-label" for="file">CSV Datei von
Mitgliedern hochladen</label>
</div>
</div>
<div class="col-3">
<button th:name="group_id" th:value="${group.getId()}" class="btn btn-primary" type="submit" style="background: #52a1eb; border-style: none; float: right" >Mitglieder hinzufügen</button>
<button class="btn btn-primary"
style="background: #52a1eb; border-style: none"
th:name="group_id" th:value="${group.getId()}"
type="submit">
Mitglieder hinzufügen
</button>
</div>
</div>
</form>
@ -61,32 +71,37 @@
</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>
<div class="text-right btn-toolbar" style="float: right" role="toolbar">
<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" style="margin: 5px">Rolle ändern</button><!-- th:if -->
</form>
<form method="post" action="/gruppen2/details/members/deleteUser">
<input type="hidden" th:name="group_id" th:value="${group.getId()}">
<input type="hidden" th:name="user_id" th:value="${member.getUser_id()}">
<button class="btn btn-danger btn-sm" style="margin: 5px">Mitglied entfernen</button>
</form>
</div>
</td>
</tr>
<tr th:each="member : ${group.getMembers()}">
<th th:text="${member.getId()}"></th>
<td>
<span th:if='${group.getRoles().get(member.getId()) != admin}'>Mitglied</span>
<span th:if='${group.getRoles().get(member.getId()) == admin}'>Admin</span>
</td>
<td>
<form action="/gruppen2/details/members/changeRole" method="post">
<input th:name="group_id" th:value="${group.getId()}"
type="hidden">
<input th:name="user_id" th:value="${member.getId()}"
type="hidden">
<button class="btn btn-warning btn-sm" type="submit">Rolle
ändern
</button><!-- th:if -->
</form>
<form action="/gruppen2/details/members/deleteUser" method="post">
<input th:name="group_id" th:value="${group.getId()}"
type="hidden">
<input th:name="user_id" th:value="${member.getId()}"
type="hidden">
<button th:if='${member.getId() != account.getName()}' class="btn btn-danger btn-sm">Mitglied entfernen
</button>
</form>
</td>
</tr>
</tbody>
</table>
<button type="button" class="btn btn-primary" style="background: #52a1eb; float: right; border-style: none">
<a th:href="@{/gruppen2/details(id=${group.getId()})}" style="color: white; margin: 5px">Fertig</a>
<button class="btn btn-primary" style="background: #52a1eb; border-style: none"
type="button">
<a th:href="@{/gruppen2/details(id=${group.getId()})}" style="color: white">Fertig</a>
</button>
<br>
<br>
@ -96,7 +111,7 @@
</div>
<script>
// Add the following code if you want the name of the file appear on select
$(".custom-file-input").on("change", function() {
$(".custom-file-input").on("change", function () {
var fileName = $(this).val().split("\\").pop();
$(this).siblings(".custom-file-label").addClass("selected").html(fileName);
});