prepared file upload
This commit is contained in:
92
src/main/resources/templates/admin/document_edit.html
Normal file
92
src/main/resources/templates/admin/document_edit.html
Normal file
@ -0,0 +1,92 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org" layout:decorate="~{template}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
|
||||
<body>
|
||||
<th:block layout:fragment="header">
|
||||
<ul class="navbar-nav mb-2 mb-lg-0" sec:authorize="hasRole('admin')">
|
||||
<li class="nav-item"><a th:href="@{/rss/admin}" class="btn btn-seconary btn-icon-silent"><i class="fas fa-rss"></i></a></li>
|
||||
</ul>
|
||||
<ul class="navbar-nav mb-2 mb-lg-0">
|
||||
<li class="nav-item"><a th:href="@{/dashboard}" class="btn btn-secondary btn-icon-silent">Hauptseite</a></li>
|
||||
</ul>
|
||||
<ul class="navbar-nav mb-2 mb-lg-0" sec:authorize="hasRole('admin')">
|
||||
<li class="nav-item"><a th:href="@{/admin}" class="btn btn-secondary btn-icon-silent">Administration</a></li>
|
||||
</ul>
|
||||
<ul class="navbar-nav mb-2 mb-lg-0" sec:authorize="hasRole('admin')">
|
||||
<li class="nav-item"><a th:href="@{/admin/document}" class="btn btn-secondary btn-icon-silent">Dokumente</a></li>
|
||||
</ul>
|
||||
</th:block>
|
||||
<th:block layout:fragment="content">
|
||||
<div sec:authorize="hasRole('admin')">
|
||||
<form th:action="@{/admin/document/update}" th:object="${bean}" method="post" enctype="multipart/form-data">
|
||||
<div class="tablebox">
|
||||
<div class="container">
|
||||
<input type="hidden" th:field="*{pk}" />
|
||||
<div class="row mb-2">
|
||||
<label for="inputName" class="col-sm-2 col-form-label">Name</label>
|
||||
<div class="col-sm-10">
|
||||
<span class="error" th:each="error : ${#fields.errors('name')}">[[${error}]]<br /></span> <input id="inputName" type="text" th:field="*{name}"
|
||||
th:class="${'form-control ' + (#fields.hasErrors('name') ? 'inputerror' : '')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<label for="inputDoctype" class="col-sm-2 col-form-label">Dokumententyp</label>
|
||||
<div class="col-sm-10">
|
||||
<span class="error" th:each="error : ${#fields.errors('doctype')}">[[${error}]]<br /></span> <select id="inputDoctype" th:field="*{doctype}"
|
||||
th:class="${'form-select ' + (#fields.hasErrors('doctype') ? 'inputerror' : '')}">
|
||||
<option value="">--- bitte wählen ---</option>
|
||||
<option value="location">Wegbeschreibung</option>
|
||||
<option value="camp">Bestätigung</option>
|
||||
<option value="camppass">Freizeitpass</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<label for="inputRole" class="col-sm-2 col-form-label">Zielgruppe</label>
|
||||
<div class="col-sm-10">
|
||||
<span class="error" th:each="error : ${#fields.errors('roles')}">[[${error}]]<br /></span> <select id="inputRole" th:field="*{roles}"
|
||||
th:class="${'form-control ' + (#fields.hasErrors('roles') ? 'inputerror' : '')}" multiple>
|
||||
<option value="student">Teilnehmer</option>
|
||||
<option value="teacher">Mitarbeiter</option>
|
||||
<option value="director">Leiter</option>
|
||||
<option value="feeder">Küche</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<label for="inputFile" class="col-sm-2 col-form-label">Dokument</label>
|
||||
<div class="col-sm-10">
|
||||
<span class="error" th:each="error : ${#fields.errors('uploadfile')}">[[${error}]]<br /></span>
|
||||
<input type="file" id="inputFile" th:field="*{uploadfile}" th:class="${'form-control ' + (#fields.hasErrors('uploadfile') ? 'inputerror' : '')}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<label for="inputFiletype" class="col-sm-2 col-form-label">Dateityp</label>
|
||||
<div class="col-sm-10">
|
||||
<span class="error" th:each="error : ${#fields.errors('filetype')}">[[${error}]]<br /></span> <select id="inputFiletype" th:field="*{filetype}"
|
||||
th:class="${'form-select ' + (#fields.hasErrors('filetype') ? 'inputerror' : '')}">
|
||||
<option value="">--- bitte wählen ---</option>
|
||||
<option value="pdf">PDF</option>
|
||||
<option value="png">PNG</option>
|
||||
<option value="jpg">JPG</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-sm-2"></div>
|
||||
<div class="col-sm-10">
|
||||
<input type="submit" class="btn btn-success" value="Ok" />
|
||||
<a th:href="@{/admin/document}" class="btn btn-outline-secondary">Abbrechen</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- TODO:
|
||||
|
||||
delete from db th:if="${bean.pk}"
|
||||
-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</th:block>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user