refactor, templates need fixing
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
logging.application.name = gruppen2
|
||||
logging.pattern.console = [${logging.application.name}], %magenta(%-5level), %d{dd-MM-yyyy HH:mm:ss.SSS},\t%blue(%msg)\t%thread,%logger.%M%n
|
||||
spring.output.ansi.enabled = always
|
||||
logging.level.mops.gruppen2 = info
|
||||
logging.level.mops.gruppen2 = trace
|
||||
logging.level.org.springframework.jdbc.core = info
|
||||
|
||||
# Database
|
||||
|
||||
@ -2,18 +2,11 @@ DROP TABLE IF EXISTS event;
|
||||
|
||||
CREATE TABLE event
|
||||
(
|
||||
event_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
group_id VARCHAR(36) NOT NULL,
|
||||
user_id VARCHAR(50),
|
||||
event_type VARCHAR(32),
|
||||
event_payload VARCHAR(2500)
|
||||
);
|
||||
|
||||
DROP TABLE IF EXISTS invite;
|
||||
|
||||
CREATE TABLE invite
|
||||
(
|
||||
invite_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
group_id VARCHAR(36) NOT NULL,
|
||||
invite_link VARCHAR(36) NOT NULL
|
||||
event_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
group_id VARCHAR(36) NOT NULL,
|
||||
group_version INT NOT NULL,
|
||||
exec_user_id VARCHAR(50) NOT NULL,
|
||||
target_user_id VARCHAR(50),
|
||||
event_type VARCHAR(32) NOT NULL,
|
||||
event_payload VARCHAR(2500) NOT NULL
|
||||
);
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
<!--Spacer-->
|
||||
<span class="col"></span>
|
||||
|
||||
<form method="post" th:action="@{/gruppen2/details/{id}/leave(id=${group.getGroupid()})}">
|
||||
<form method="post" th:action="@{/gruppen2/details/{id}/leave(id=${group.getId()})}">
|
||||
<button class="btn btn-danger btn-bar" type="submit">Gruppe verlassen
|
||||
</button>
|
||||
</form>
|
||||
@ -40,13 +40,13 @@
|
||||
<!--Anzahl Text-->
|
||||
<div class="mb-2">
|
||||
<span>Teilnehmer: </span>
|
||||
<span th:text="${group.getMembers().size() + ' von ' + group.getLimit().getUserLimit()}"></span>
|
||||
<span th:text="${group.size() + ' von ' + group.getLimit()}"></span>
|
||||
</div>
|
||||
|
||||
<!--Bearbeiten-Button-->
|
||||
<div class="mb-2" th:if="${group.getRoles().get(user.getUserid()) == admin}">
|
||||
<div class="mb-2" th:if="${group.isAdmin(user.getId())}">
|
||||
<form method="get"
|
||||
th:action="@{/gruppen2/details/{id}/edit(id=${group.getGroupid()})}">
|
||||
th:action="@{/gruppen2/details/{id}/edit(id=${group.getId()})}">
|
||||
<button class="btn btn-secondary btn-block">Gruppe verwalten</button>
|
||||
</form>
|
||||
</div>
|
||||
@ -55,8 +55,8 @@
|
||||
<div class="members">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item d-flex justify-content-between"
|
||||
th:each="member : ${group.getMembers().values()}">
|
||||
<span th:text="${member.getGivenname() + ' ' + member.getFamilyname().charAt(0) + '.'}"></span>
|
||||
th:each="member : ${group.getMembers()}">
|
||||
<span th:text="${member}"></span>
|
||||
<span th:replace="~{fragments/groups :: userbadges}"></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@ -15,14 +15,14 @@
|
||||
<!--Fertig oder löschen-->
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
<form method="get" th:action="@{/gruppen2/details/{id}(id=${group.getGroupid()})}">
|
||||
<form method="get" th:action="@{/gruppen2/details/{id}(id=${group.getId()})}">
|
||||
<button class="btn btn-primary">Fertig</button>
|
||||
</form>
|
||||
|
||||
<!--Spacer-->
|
||||
<span class="col"></span>
|
||||
|
||||
<form method="post" th:action="@{/gruppen2/details/{id}/edit/destroy(id=${group.getGroupid()})}">
|
||||
<form method="post" th:action="@{/gruppen2/details/{id}/edit/destroy(id=${group.getId()})}">
|
||||
<button class="btn btn-danger btn-bar" type="submit">Gruppe löschen
|
||||
</button>
|
||||
</form>
|
||||
@ -50,7 +50,7 @@
|
||||
|
||||
<!--Beschreibung + Titel-->
|
||||
<div class="content-text">
|
||||
<form th:action="@{/gruppen2/details/{id}/edit/meta(id=${group.getGroupid()})}"
|
||||
<form th:action="@{/gruppen2/details/{id}/edit/meta(id=${group.getId()})}"
|
||||
method="post">
|
||||
|
||||
<div th:replace="~{fragments/forms :: meta}"></div>
|
||||
@ -63,7 +63,7 @@
|
||||
|
||||
<!--Userlimit-->
|
||||
<div class="content-text-in">
|
||||
<form th:action="@{/gruppen2/details/{id}/edit/userlimit(id=${group.getGroupid()})}"
|
||||
<form th:action="@{/gruppen2/details/{id}/edit/userlimit(id=${group.getId()})}"
|
||||
method="post">
|
||||
|
||||
<div th:replace="~{fragments/forms :: userlimit}"></div>
|
||||
@ -76,7 +76,7 @@
|
||||
|
||||
<!--CSV Import-->
|
||||
<div class="content-text mb-0">
|
||||
<form th:action="@{/gruppen2/details/{id}/edit/csv(id=${group.getGroupid()})}"
|
||||
<form th:action="@{/gruppen2/details/{id}/edit/csv(id=${group.getId()})}"
|
||||
th:if="${account.getRoles().contains('orga')}"
|
||||
enctype="multipart/form-data" method="post">
|
||||
|
||||
@ -96,20 +96,20 @@
|
||||
</div>
|
||||
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item d-flex justify-content-between" th:each="member : ${group.getMembers().values()}">
|
||||
<li class="list-group-item d-flex justify-content-between" th:each="member : ${group.getMembers()}">
|
||||
<div>
|
||||
<span th:text="${member.getGivenname() + ' ' + member.getFamilyname().charAt(0) + '.'}"></span>
|
||||
<span th:replace="~{fragments/groups :: userbadges}"></span>
|
||||
</div>
|
||||
|
||||
<div class="d-flex">
|
||||
<form th:action="@{/gruppen2/details/{id}/edit/delete/{userid}(id=${group.getGroupid()}, userid=${member.getUserid()})}"
|
||||
th:unless="${member.getUserid() == account.getName()}"
|
||||
<form th:action="@{/gruppen2/details/{id}/edit/delete/{userid}(id=${group.getId()}, userid=${member.getId()})}"
|
||||
th:unless="${member.getId() == account.getName()}"
|
||||
method="post">
|
||||
<button type="submit" class="btn btn-danger mr-2">Entfernen</button>
|
||||
</form>
|
||||
|
||||
<form th:action="@{/gruppen2/details/{id}/edit/role/{userid}(id=${group.getGroupid()}, userid=${member.getUserid()})}"
|
||||
<form th:action="@{/gruppen2/details/{id}/edit/role/{userid}(id=${group.getId()}, userid=${member.getId()})}"
|
||||
method="post">
|
||||
<button type="submit" class="btn btn-warning">Rolle ändern</button>
|
||||
</form>
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text text-monospace">Gruppentitel:</span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="groupTitle" minlength="4" maxlength="128"
|
||||
<input type="text" class="form-control" name="title" minlength="4" maxlength="128"
|
||||
th:value="${group?.getTitle()}" required>
|
||||
</div>
|
||||
|
||||
@ -20,8 +20,8 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text text-monospace">Beschreibung:</span>
|
||||
</div>
|
||||
<textarea class="form-control" name="groupDescription" minlength="4" maxlength="512"
|
||||
th:text="${group?.getDescription()?.getGroupDescription()}" required></textarea>
|
||||
<textarea class="form-control" name="description" minlength="4" maxlength="512"
|
||||
th:text="${group?.getDescription()}" required></textarea>
|
||||
</div>
|
||||
</th:block>
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
<input type="hidden" id="parentdummy" name="parent" value="00000000-0000-0000-0000-000000000000" disabled>
|
||||
<select class="custom-select" id="parentselect" name="parent">
|
||||
<option value="00000000-0000-0000-0000-000000000000" selected>Keiner</option>
|
||||
<option th:each="lecture : ${lectures}" th:value="${lecture.getGroupid()}"
|
||||
<option th:each="lecture : ${lectures}" th:value="${lecture.getId()}"
|
||||
th:text="${lecture.getTitle()}"></option>
|
||||
</select>
|
||||
</div>
|
||||
@ -61,17 +61,17 @@
|
||||
<th:block th:fragment="userlimit">
|
||||
<label for="userlimit">Teilnehmeranzahl:</label>
|
||||
<div class="btn-toolbar row mx-0" id="userlimit">
|
||||
<input type="hidden" name="userLimit" id="limit" value="999999"
|
||||
th:disabled="${group != null && group.getLimit().getUserLimit() < 999999} ? 'disabled' : 'false'">
|
||||
<input type="hidden" name="limit" id="limit" value="999999"
|
||||
th:disabled="${group != null && group.getLimit() < 999999} ? 'disabled' : 'false'">
|
||||
<div class="btn-group btn-group-toggle col-sm-4 px-0" data-toggle="buttons">
|
||||
<label class="btn btn-secondary active" onclick="disable('#limitselect'); enable('#limit')">
|
||||
<input type="radio"
|
||||
th:checked="${group != null && group.getLimit().getUserLimit() < 999999} ? 'false' : 'checked'">
|
||||
th:checked="${group != null && group.getLimit() < 999999} ? 'false' : 'checked'">
|
||||
Unbegrenzt
|
||||
</label>
|
||||
<label class="btn btn-secondary" onclick="enable('#limitselect'); disable('#limit')">
|
||||
<input type="radio"
|
||||
th:checked="${group != null && group.getLimit().getUserLimit() < 999999} ? 'checked' : 'false'">
|
||||
th:checked="${group != null && group.getLimit() < 999999} ? 'checked' : 'false'">
|
||||
Begrenzt
|
||||
</label>
|
||||
</div>
|
||||
@ -81,10 +81,10 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text text-monospace">Limit:</span>
|
||||
</div>
|
||||
<input type="number" class="form-control" name="userLimit"
|
||||
th:value="${group != null} ? ${group.getLimit().getUserLimit()} : '999999'"
|
||||
<input type="number" class="form-control" name="limit"
|
||||
th:value="${group != null} ? ${group.getLimit()} : '999999'"
|
||||
min="1" max="999999" id="limitselect" required
|
||||
th:disabled="${group != null && group.getLimit().getUserLimit() < 999999} ? 'false' : 'disabled'">
|
||||
th:disabled="${group != null && group.getLimit() < 999999} ? 'false' : 'disabled'">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text text-monospace">Teilnehmer</span>
|
||||
</div>
|
||||
@ -99,7 +99,7 @@
|
||||
<span class="input-group-text text-monospace">CSV:</span>
|
||||
</div>
|
||||
<div class="custom-file">
|
||||
<input type="file" class="custom-file-input" id="file" th:name="file">
|
||||
<input type="file" class="custom-file-input" id="file" name="file">
|
||||
<label class="custom-file-label" for="file">Datei auswählen</label>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
@ -1,21 +1,20 @@
|
||||
<!DOCTYPE HTML>
|
||||
<!--suppress ALL -->
|
||||
<html lang="de" xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<!--Grouptype Badges-->
|
||||
<th:block th:fragment="badges">
|
||||
<span class="badge badge-pill private"
|
||||
title="Kann nicht über die Suche gefunden werden, beitritt ist per Einladungslink möglich."
|
||||
th:if='${group.getType() == private}'>Privat</span>
|
||||
th:if='${group.isPrivate()}'>Privat</span>
|
||||
<span class="badge badge-pill public"
|
||||
title="Kann über die Suche gefunden werden, jeder kann beitreten."
|
||||
th:if="${group.getType() == public}">Öffentlich</span>
|
||||
th:if="${group.isPublic()}">Öffentlich</span>
|
||||
<span class="badge badge-pill lecture"
|
||||
title="Offizielle Veranstaltung"
|
||||
th:if='${group.getType() == lecture}'>Veranstaltung</span>
|
||||
th:if='${group.isLecture()}'>Veranstaltung</span>
|
||||
|
||||
<span class="badge badge-pill parent"
|
||||
th:unless="${parent == null || parent?.getTitle() == null|| parent?.getTitle() == ''}"
|
||||
th:if="${parent != null && parent?.getTitle() != null && parent?.getTitle() != ''}"
|
||||
th:title="${'Die Gruppe gehört zur Veranstaltung ' + parent.getTitle() + '.'}"
|
||||
th:text="${parent.getTitle()}">Parent</span>
|
||||
|
||||
@ -28,7 +27,7 @@
|
||||
<!--User Badges-->
|
||||
<th:block th:fragment="userbadges">
|
||||
<span class="badge badge-success align-self-start ml-2"
|
||||
th:if="${group.getRoles().get(member.getUserid()) == admin}">Admin</span>
|
||||
th:if="${group.isAdmin(member.getUserid())}">Admin</span>
|
||||
</th:block>
|
||||
|
||||
<th:block th:fragment="groupcontent">
|
||||
@ -39,30 +38,30 @@
|
||||
|
||||
<!--Description-->
|
||||
<div class="content-text-in">
|
||||
<span th:text="${group.getDescription().getGroupDescription()}"></span>
|
||||
<span th:text="${group.getDescription()}"></span>
|
||||
</div>
|
||||
|
||||
<!--<div class="content-text-in" th:if="${group.getMembers().contains(user.getId())}"></div>-->
|
||||
<!--<div class="body-text-in" th:if="${group.getMembers().contains(user.getId())}"></div>-->
|
||||
</th:block>
|
||||
|
||||
<!--Buttonbar zum Gruppe beitreten-->
|
||||
<th:block th:fragment="joingroup">
|
||||
<div class="content-heading">
|
||||
<span th:if="${group.getMembers().size() < group.getLimit().getUserLimit()}">
|
||||
<span th:unless="${group.isFull()}">
|
||||
Möchtest du dieser Gruppe beitreten?
|
||||
</span>
|
||||
<span th:unless="${group.getMembers().size() < group.getLimit().getUserLimit()}">
|
||||
<span th:if="${group.isFull()}">
|
||||
Diese Gruppe hat ihre maximale Teilnehmeranzahl erreicht.
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<form method="post" th:action="@{/gruppen2/details/{id}/join(id = ${group.getGroupId()})}"
|
||||
th:if="${group.getMembers().size() < group.getLimit().getUserLimit()}">
|
||||
th:unless="${group.isFull()}">
|
||||
<button class="btn btn-success" type="submit">Gruppe beitreten.</button>
|
||||
</form>
|
||||
|
||||
<div class="col" th:if="${group.getMembers().size() < group.getLimit().getUserLimit()}"></div>
|
||||
<div class="col" th:unless="${group.isFull()}"></div>
|
||||
|
||||
<a class="btn btn-primary" href="/gruppen2"
|
||||
type="submit">Startseite.</a>
|
||||
|
||||
@ -16,13 +16,13 @@
|
||||
<!--Gruppenliste belegte Gruppen-->
|
||||
<div class="content" th:each="group: ${groups}">
|
||||
<div class="content-heading row">
|
||||
<a class="link col" th:href="@{/gruppen2/details/{id}(id=${group.getGroupid()})}"
|
||||
<a class="link col" th:href="@{/gruppen2/details/{id}(id=${group.getId()})}"
|
||||
th:text="${group.getTitle()}"></a>
|
||||
|
||||
<span th:replace="~{fragments/groups :: badges}"></span>
|
||||
</div>
|
||||
<div class="content-text-in">
|
||||
<span th:text="${group.getDescription().getGroupDescription()}"></span>
|
||||
<span th:text="${group.getDescription()}"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -14,10 +14,10 @@
|
||||
|
||||
<div class="content" th:insert="~{fragments/groups :: groupcontent}"></div>
|
||||
|
||||
<div class="content" th:unless="${group.getType() == private}"
|
||||
<div class="content" th:unless="${group.isPrivate()}"
|
||||
th:insert="~{fragments/groups :: joingroup}"></div>
|
||||
|
||||
<div class="content row" th:if="${group.getType() == private}">
|
||||
<div class="content row" th:if="${group.isPrivate()}">
|
||||
<span class="col"></span>
|
||||
|
||||
<a class="btn btn-primary" href="/gruppen2">Startseite.</a>
|
||||
|
||||
@ -31,11 +31,11 @@
|
||||
<div class="content-heading row">
|
||||
<span th:replace="~{fragments/groups :: badges}"></span>
|
||||
|
||||
<a class="link col" th:href="@{/gruppen2/details/{id}(id=${group.getGroupid()})}"
|
||||
<a class="link col" th:href="@{/gruppen2/details/{id}(id=${group.getId()})}"
|
||||
th:text="${group.getTitle()}"></a>
|
||||
</div>
|
||||
<div class="content-text-in">
|
||||
<span th:text="${group.getDescription().getGroupDescription()}"></span>
|
||||
<span th:text="${group.getDescription()}"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user