1

Formatting

Co-authored-by: Christoph <tobi@urpost.de>
This commit is contained in:
Christoph
2020-03-18 20:18:03 +01:00
parent 01c0cac2a2
commit 2ba913f2c8
40 changed files with 354 additions and 245 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; 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">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>
@ -62,28 +72,36 @@
</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>
<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/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">Mitglied entfernen</button>
</form>
</td>
</tr>
<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>
<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.getUser_id()}"
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.getUser_id()}"
type="hidden">
<button class="btn btn-danger btn-sm">Mitglied entfernen
</button>
</form>
</td>
</tr>
</tbody>
</table>
<button type="button" class="btn btn-primary" style="background: #52a1eb; border-style: none">
<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>
</div>
@ -92,7 +110,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);
});