1
Files
lecture-professional-softwa…/src/main/resources/templates/fragments/gruppen.html
2020-04-11 20:19:40 +02:00

118 lines
4.9 KiB
HTML

<!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"
th:if='${group.getType() == private}'>Privat</span>
<span class="badge badge-pill public"
th:if="${group.getType() == public}">Öffentlich</span>
<span class="badge badge-pill lecture"
th:if='${group.getType() == lecture}'>Veranstaltung</span>
<span class="badge badge-pill parent"
th:unless="${parent == null || parent.getTitle() == null|| parent.getTitle() == ''}"
th:text="${parent.getTitle()}">Parent</span>
<!--Needs completly projected (cached) groups-->
<!--<span class="badge badge-success float-right"
th:if='${group.getRoles().get(user.getId()) == admin}'>Admin</span>-->
</th:block>
<!--CSV-->
<div th:fragment="csvimport" class="input-group" th:if="${account.getRoles().contains('orga')}">
<div class="input-group-prepend">
<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">
<label class="custom-file-label" for="file">Datei auswählen</label>
</div>
<script>
$(".custom-file-input").on("change", function () {
const fileName = $(this).val().split("\\").pop();
$(this).siblings(".custom-file-label").addClass("selected").html(fileName);
});
</script>
</div>
<!--Gruppentyp-->
<th:block th:fragment="grouptype">
<label for="grouptype">Gruppentyp:</label>
<div class="btn-toolbar row mb-2 mx-0" id="grouptype">
<div class="btn-group btn-group-toggle col-sm-4 px-0" data-toggle="buttons">
<label class="btn btn-secondary active" onclick="enable('#parentselect')">
<input type="radio" name="type" value="PRIVATE" checked> Privat
</label>
<label class="btn btn-secondary" onclick="enable('#parentselect')">
<input type="radio" name="type" value="PUBLIC"> Öffentlich
</label>
<label class="btn btn-secondary" onclick="disable('#parentselect')"
th:if="${account.getRoles().contains('orga')}">
<input type="radio" name="type" value="LECTURE"> Veranstaltung
</label>
</div>
<div class="input-group col-sm-8 pr-0">
<div class="input-group-prepend">
<span class="input-group-text text-monospace">Gehört zu:</span>
</div>
<select class="custom-select" id="parentselect" name="parent">
<option value="" selected>Keiner</option>
<option th:each="lecture : ${lectures}" th:value="${lecture.getId()}"
th:text="${lecture.getTitle()}"></option>
</select>
</div>
</div>
</th:block>
<!--Userlimit-->
<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="9223372036854775807">
<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" checked>
Unbegrenzt
</label>
<label class="btn btn-secondary" onclick="enable('#limitselect'); disable('#limit')">
<input type="radio"> Begrenzt
</label>
</div>
<div class="input-group col-sm-8 pr-0">
<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} ? ${#numbers.formatInteger(group.getUserLimit(), 5)} : '1'"
min="1" max="100000" id="limitselect" required disabled>
<div class="input-group-append">
<span class="input-group-text text-monospace">Teilnehmer</span>
</div>
</div>
</div>
</th:block>
<th:block th:fragment="meta">
<!--Gruppentitel-->
<div class="input-group mb-2">
<div class="input-group-prepend">
<span class="input-group-text text-monospace">Gruppentitel:</span>
</div>
<input type="text" class="form-control" th:name="title" th:value="${group?.getTitle()}"
required>
</div>
<!--Gruppenbeschreibung-->
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text text-monospace">Beschreibung:</span>
</div>
<textarea class="form-control" th:name="description" th:text="${group?.getDescription()}"
required></textarea>
</div>
</th:block>