1

Merge remote-tracking branch 'origin/master' into showInviteLink

# Conflicts:
#	src/main/java/mops/gruppen2/controller/Gruppen2Controller.java
#	src/main/java/mops/gruppen2/service/GroupService.java
This commit is contained in:
[Mahgs]
2020-03-24 14:51:33 +01:00
21 changed files with 306 additions and 158 deletions

View File

@ -39,7 +39,7 @@
<div class="col-10">
<h1>Gruppenerstellung</h1>
<form method="post" action="/gruppen2/createOrga" enctype="multipart/form-data">
<div class="shadow p-2"
<div class="shadow-sm p-2"
style=" border: 10px solid aliceblue; background: aliceblue">
<div class="form-group">
<label for="titel">Titel</label>
@ -51,9 +51,14 @@
<textarea class="form-control" id="description" required
rows="3" th:name="description"></textarea>
</div>
<div class="form-group mt-3">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" id="maxInfiniteUsers" th:name="maxInfiniteUsers"
type="checkbox">
<label class="custom-control-label" for="maxInfiniteUsers">Anzahl unbegrenzt</label>
</div>
<div class="form-group mt-3" id="userMaximum">
<label for="userMaximum">Teilnehmeranzahl</label>
<input class="form-control" id="userMaximum" required th:name="userMaximum"
<input class="form-control" th:name="userMaximum"
type="number" min="1" max="10000">
</div>
<div class="custom-control custom-checkbox">
@ -111,6 +116,12 @@
$('#lectureParent').fadeToggle();
});
});
$(document).ready(function () {
$('#maxInfiniteUsers').change(function () {
$('#userMaximum').fadeToggle();
});
});
</script>
</main>
</body>

View File

@ -6,7 +6,11 @@
<meta charset="utf-8">
<title>Gruppenerstellung</title>
<th:block th:fragment="headcontent">
<!-- Links, Skripts, Styles hier einfügen! -->
<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>
</th:block>
</head>
<body>
@ -34,7 +38,7 @@
<div class="col-10">
<h1>Gruppenerstellung</h1>
<form method="post" action="/gruppen2/createStudent">
<div class="shadow p-2" style=" border: 10px solid aliceblue; border-radius: 5px; background: aliceblue">
<div class="shadow-sm p-2" style=" border: 10px solid aliceblue; border-radius: 5px; background: aliceblue">
<div class="form-group">
<label for="titel">Titel</label>
@ -46,10 +50,15 @@
<textarea class="form-control" id="description" required
rows="3" th:name="description"></textarea>
</div>
<div class="form-group mt-3">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" id="maxInfiniteUsers" th:name="maxInfiniteUsers"
type="checkbox">
<label class="custom-control-label" for="maxInfiniteUsers">Anzahl unbegrenzt</label>
</div>
<div class="form-group mt-3" id="userMaximum">
<label for="userMaximum">Teilnehmeranzahl</label>
<input class="form-control" id="userMaximum" required th:name="userMaximum"
type="number" min="1">
<input class="form-control" th:name="userMaximum"
type="number" min="1" max="10000">
</div>
<div class="custom-control custom-checkbox">
<input class="custom-control-input" id="visibility" th:name="visibility"
@ -76,6 +85,13 @@
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('#maxInfiniteUsers').change(function () {
$('#userMaximum').fadeToggle();
});
});
</script>
</main>
</body>
</html>

View File

@ -30,13 +30,13 @@
</header>
<main th:fragment="bodycontent">
<div class="container-fluid">
<div class="row">
<div class="col-9 shadow-sm p-4" style="border: 10px solid aliceblue; border-radius: 5px; background: aliceblue">
<h1 style="color: black; font-weight: bold" th:text="${group.getTitle()}"></h1>
<div>
<div class="shadow-sm p-4 col-8" style="border: 10px solid aliceblue; display: inline-block; border-radius: 5px; background: aliceblue">
<h1 style="color: black; font-weight: bold; font-optical-sizing: auto; overflow-wrap: break-word" th:text="${group.getTitle()}"></h1>
<h3>
<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"
<span class="badge badge-pill badge-primary" style="background: #52a1eb"
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>
@ -57,12 +57,12 @@
</h3>
<br>
<div class="shadow-sm p-4" style="background: white">
<p style="overflow-wrap: break-word" th:text="${group.getDescription()}"></p>
<p style="overflow-wrap: break-word; font-optical-sizing: auto" th:text="${group.getDescription()}"></p>
</div>
<br>
<div class="text-right btn-toolbar" role="toolbar" style="float: right">
<button class="btn btn-primary"
style="background: dodgerblue; border: none; margin: 5px">
style="background: #52a1eb; border: none; margin: 5px">
<a style="color: white" th:href="@{/gruppen2}">Zurück</a>
</button>
<form action="/gruppen2/leaveGroup" method="post">
@ -79,27 +79,27 @@
</form>
</div>
</div>
<div class="col-3" style="white-space: nowrap">
<div style="display: inline-block; margin: 0">
<h2>Mitglieder</h2>
<div>
<h4>
<a th:text="${group.getMembers().size()}"></a>
<a>von maximal</a>
<a th:text="${group.getUserMaximum()}"></a>
<a>Benutzern.</a>
</h4>
</div>
<div th:if="${group.getRoles().get(user.getId()) == admin}">
<form method="get"
th:action="@{/gruppen2/details/members/{id}(id=${group.getId()})}">
<button class="btn btn-secondary" style="background: slategrey; float: left">Mitglieder bearbeiten</button>
</form>
</div>
<div class="col-4" style="white-space: nowrap; float: right; background: white; display: inline-block; margin-bottom: 100px; margin-top: -8px">
<h2>Mitglieder</h2>
<div th:switch="${group.getUserMaximum() != 100000}">
<h4 th:case="${true}">
<a th:text="${group.getMembers().size()}"></a>
<a>von maximal</a>
<a th:text="${group.getUserMaximum()}"></a>
<a>Benutzern.</a>
</h4>
<h4 th:case="${false}"> unbegrenzte Teilnehmeranzahl</h4>
</div>
<div th:if="${group.getRoles().get(user.getId()) == admin}">
<form method="get"
th:action="@{/gruppen2/details/members/{id}(id=${group.getId()})}">
<button class="btn btn-secondary" style="background: slategrey; float: left">Mitglieder bearbeiten</button>
</form>
<br>
<br>
</div>
<div>
<div style="overflow-y: scroll;
height:60vh">
<ul class="list-group-flush" style="background: slategrey"
th:each="member : ${group.getMembers()}">
<li class="list-group-item" style="background: aliceblue">

View File

@ -31,12 +31,12 @@
<div class="container-fluid">
<div class="row">
<div class="col-9">
<div class="shadow-sm p-4" style="border: 10px solid aliceblue; border-radius: 5px; background: aliceblue">
<h1 style="color: black; font-weight: bold" th:text="${group.getTitle()}"></h1>
<div class="shadow-sm p-4" style="border: 1px solid aliceblue; border-radius: 5px; background: aliceblue">
<h1 style="color: black; font-weight: bold; font-optical-sizing: auto; overflow-wrap: break-word" th:text="${group.getTitle()}"></h1>
<h3>
<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"
<span class="badge badge-pill badge-primary" style="background: #52a1eb"
th:if="${group.getVisibility() == group.getVisibility().PUBLIC}">Öffentliche Gruppe</span>
<span class="badge badge-pill badge-success"
style="background: lightseagreen"
@ -45,14 +45,14 @@
th:text="${parent.getTitle()}">Parent</span>
</h3>
<div class="shadow-sm p-4" style="background: white">
<p style="overflow-wrap: break-word"
<p style="overflow-wrap: break-word; font-optical-sizing: auto"
th:text="${group.getDescription()}"></p>
</div>
<div class="form-group">
<div class="form-group mt-2">
<div class="text-right">
<form method="post" action="/gruppen2/detailsBeitreten">
<button class="btn btn-primary"
style="border-style: none;"
style="background: #52a1eb; border-style: none;"
th:href="@{/gruppen2/detailsBeitreten(id=${group.getId()})}"
th:name="id" th:value="${group.id}"
type="submit">Gruppe beitreten
@ -62,6 +62,20 @@
</div>
</div>
</div>
<div class="col-3" style="white-space: nowrap">
<div style="display: inline-block; margin: 0">
<h2>Mitglieder</h2>
<div th:switch="${group.getUserMaximum() != 100000}">
<h4 th:case="${true}">
<a th:text="${group.getMembers().size()}"></a>
<a>von maximal</a>
<a th:text="${group.getUserMaximum()}"></a>
<a>Benutzern.</a>
</h4>
<h4 th:case="false">unbegrenzte Teilnehmeranzahl</h4>
</div>
</div>
</div>
</div>
</div>
</main>

View File

@ -37,37 +37,51 @@
<div class="row">
<div class="col-10">
<h1>Mitglieder bearbeiten</h1>
<div>
<h5>
<div th:switch="${group.getUserMaximum() != 100000}">
<h5 th:case="${true}">
<a th:text="${group.getMembers().size()}"></a>
<a>von maximal</a>
<a th:text="${group.getUserMaximum()}"></a>
<a>Benutzern.</a>
</h5>
<h5 th:case="${false}"> unbegrenzte Teilnehmeranzahl</h5>
</div>
<div class="shadow p-2" style="border: 10px solid aliceblue; background: aliceblue">
<div class="form-group pt-4" th:if="${account.getRoles().contains('orga')}">
<form action="/gruppen2/details/members/addUsersFromCsv"
enctype="multipart/form-data"
method="post">
<div class="row">
<div class="col-10">
<div class="custom-file">
<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 class="input-group mb-3">
<div class="custom-file">
<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 class="col-2">
<button class="btn btn-primary"
style="background: #52a1eb; border-style: none; float: right"
<div class="input-group-append">
<button class="btn btn-outline-secondary" style="background: #52a1eb; border-style: none"
th:name="group_id" th:value="${group.getId()}"
type="submit">
Mitglieder hinzufügen
<a style="color: white">Hinzufügen</a>
</button>
</div>
</div>
</form>
</div>
<div class="form-group pt-4">
<form action="/gruppen2/details/members/changeMaximum" method="post">
<div class="input-group mb-3" id="userMaximum">
<input class="form-control" placeholder="Maximale Teilnehmerzahl ändern..." th:name="maximum"
type="number" th:min="${group.getMembers().size()}" max="10000">
<div class="input-group-append">
<button class="btn btn-outline-secondary" style="background: #52a1eb; border-style: none"
th:name="group_id" th:value="${group.getId()}"
type="submit">
<a style="color: white">Speichern</a>
</button>
</div>
</div>
</form>
</div>
<table class="table" style="table-layout: fixed">
<thead>
<tr>
@ -92,7 +106,7 @@
type="hidden">
<button class="btn btn-warning btn-sm" type="submit" style="margin: 5px">Rolle
ändern
</button><!-- th:if -->
</button>
</form>
<form action="/gruppen2/details/members/deleteUser" method="post">
<input th:name="group_id" th:value="${group.getId()}"

View File

@ -10,7 +10,7 @@
<title>Seite nicht gefunden</title>
</head>
<body>
<div class="mx-auto" style="vertical-align: border-radius: 5px; center; horiz-align: center; top: 50%; left: 50%;">
<div class="mx-auto" style="vertical-align: center; border-radius: 5px; horiz-align: center; top: 50%; left: 50%;">
<div class="jumbotron" style="background: aliceblue">
<div class="container">
<h1 class="display-3">UPSI</h1>
@ -26,8 +26,10 @@
<p th:text="${message}"></p>
</div>
</div>
<p><a class="btn btn-primary btn-lg" href="#" onclick="window.history.back(-1);return false;" role="button">Zurück</a>
</p>
<button style="color: #52a1eb">
<a style="color: white" class="btn btn-primary btn-lg" href="#" onclick="window.history.back(-1);return false;" role="button">Zurück</a>
</button>
</div>
</div>
</body>

View File

@ -33,7 +33,7 @@
<div class="col-10">
<h1>Meine Gruppen</h1>
<form action="/" method="get">
<h3 style="color: dodgerblue; font-weight: bold;">
<h3 style="color: dodgerblue; font-weight: bold; font-optical-sizing: auto">
<small style="font-weight: normal; color: black">Mitglied in </small>
<small style="font-weight: bold; color: black"
th:text="${gruppen.size()}"></small>
@ -45,12 +45,12 @@
<br>
<div th:each="gruppe: ${gruppen}">
<div class="shadow-sm p-4" style="border: none; border-radius: 5px; background: aliceblue">
<h3 style="color: dodgerblue; font-weight: bold;">
<h3 style="color: dodgerblue; font-weight: bold; font-optical-sizing: auto; overflow-wrap: break-word">
<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"
<p style="overflow-wrap: break-word; font-optical-sizing: auto"
th:text="${#strings.abbreviate(gruppe.getDescription(),300)}"></p>
</div>
</div>

View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<link crossorigin="anonymous" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" rel="stylesheet">
<meta charset="UTF-8">
<title>Seite nicht gefunden</title>
</head>
<body>
<div class="mx-auto" style="vertical-align: border-radius: 5px; center; horiz-align: center; top: 50%; left: 50%;">
<div class="jumbotron" style="background: aliceblue">
<div class="container">
<h1 class="display-3">Kein Zugriff auf die Gruppe</h1>
<p class="lead">Sorry, du hast keine Berechtigung auf diese Funktionen der Gruppe zuzugreifen</p><br>
</div>
</div>
<div class="container">
<p><a class="btn btn-primary btn-lg" href="#" onclick="window.history.back(-1);return false;" role="button">Zurück</a>
</p>
</div>
</div>
</body>
</html>

View File

@ -33,7 +33,7 @@
<div class="col-10">
<h1>Gruppensuche</h1>
<form action="/gruppen2/findGroup" method="get">
<div class="shadow" style="border: 10px solid aliceblue; border-radius: 5px; background: aliceblue">
<div class="shadow-sm p-2" style="border: 10px solid aliceblue; border-radius: 5px; background: aliceblue">
<div class="form-group">
<label for="suchleiste">Suchbegriff:</label>
<input class="form-control" id="suchleiste"