added notes
This commit is contained in:
		| @@ -20,9 +20,8 @@ | ||||
| 	<!-- Navigation --> | ||||
| 	<nav class="navbar navbar-expand-lg navbar-light bg-light static-top"> | ||||
| 		<div class="container-fluid" style="width: 98%"> | ||||
| 			<a class="navbar-brand" th:href="@{/}"> <i class="fa fa-calendar-alt"></i> Timetrack | ||||
| 				<div class="version" th:text="${@manifestBean.getVersion()}"></div> | ||||
| 			</a> | ||||
| 			<i class="fa fa-calendar-alt"></i> <a class="navbar-brand" style="margin-left: 8px; z-index: 1" th:href="@{/}">Timetrack</a><br /> | ||||
| 			<div class="version" th:text="${@manifestBean.getVersion()}"></div> | ||||
| 			<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarResponsive" | ||||
| 				aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation"> | ||||
| 				<span class="navbar-toggler-icon"></span> | ||||
| @@ -33,6 +32,7 @@ | ||||
| 						data-bs-toggle="dropdown" aria-expanded="false"> Module </a> | ||||
| 						<ul class="dropdown-menu dropdown-menu-light" aria-labelledby="navbarScrollingDropdown"> | ||||
| 							<li><a class="dropdown-item" th:href="@{/contact/list}">Kontakte</a></li> | ||||
| 							<li><a class="dropdown-item" th:href="@{/note/list}">Notizen</a></li> | ||||
| 							<li><hr /></li> | ||||
| 							<li><a class="dropdown-item" th:href="@{/logout}">[[${currentUser}]] abmelden</a></li> | ||||
| 						</ul></li> | ||||
|   | ||||
							
								
								
									
										64
									
								
								src/main/resources/templates/note/item.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								src/main/resources/templates/note/item.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,64 @@ | ||||
| <!DOCTYPE html> | ||||
| <html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" | ||||
| 	xmlns:sec="http://www.thymeleaf.org/extras/spring-security" layout:decorate="~{layout/main.html}"> | ||||
| <head> | ||||
| <title>Notiz aktualisieren</title> | ||||
| </head> | ||||
| <body> | ||||
| 	<ul layout:fragment="menu"> | ||||
| 	</ul> | ||||
| 	<main layout:fragment="content"> | ||||
| 		<div class="container formpane"> | ||||
| 			<form th:action="@{/note/upsert}" th:object="${noteBean}" method="post"> | ||||
| 				<div class="row mb-3"> | ||||
| 					<label for="inputPk" class="col-sm-2 col-form-label">Inhalt von Eintrag</label> | ||||
| 					<div class="col-sm-10"> | ||||
| 						<input id="inputPk" type="text" th:field="*{pk}" class="form-control" readonly="readonly" /> | ||||
| 					</div> | ||||
| 				</div> | ||||
| 				<div class="row mb-3"> | ||||
| 					<label for="inputTitle" class="col-sm-2 col-form-label">Titel</label> | ||||
| 					<div class="col-sm-10"> | ||||
| 						<input id="inputTitle" type="text" th:field="*{title}" class="form-control" /> | ||||
| 					</div> | ||||
| 				</div> | ||||
| 				<div class="row mb-3"> | ||||
| 					<label for="inputCategory" class="col-sm-2 col-form-label">Kategorie</label> | ||||
| 					<div class="col-sm-10"> | ||||
| 						<select id="inputCategory" class="form-control select2-single" th:field="*{category}"> | ||||
| 							<option th:each="i : ${categories}" th:value="${i}" th:text="${i.literal}"></option> | ||||
| 						</select> | ||||
| 					</div> | ||||
| 				</div> | ||||
| 				<div class="row mb-3"> | ||||
| 					<label for="inputContent" class="col-sm-2 col-form-label">Inhalt</label> | ||||
| 					<div class="col-sm-10"> | ||||
| 						<input id="inputContent" type="text" th:field="*{content}" class="form-control" /> | ||||
| 					</div> | ||||
| 				</div> | ||||
| 				<div class="row mb-3"> | ||||
| 					<label for="inputType" class="col-sm-2 col-form-label">Typ</label> | ||||
| 					<div class="col-sm-10"> | ||||
| 						<select id="inputType" class="form-control select2-single" th:field="*{type}"> | ||||
| 							<option th:each="i : ${types}" th:value="${i}" th:text="${i.literal}"></option> | ||||
| 						</select> | ||||
| 					</div> | ||||
| 				</div> | ||||
| 				<div class="row mb-3"> | ||||
| 					<div class="col-sm-2">Änderung</div> | ||||
| 					<div class="col-sm-10"> | ||||
| 						<button type="submit" class="btn btn-success">speichern</button> | ||||
| 						<button type="submit" class="btn btn-secondary" th:formaction="@{/note/list}">abbrechen</button> | ||||
| 						<div class="dropdown float-right" th:if="${noteBean.pk != null}" sec:authorize="hasRole('timetrack_user')"> | ||||
| 							<button class="btn btn-danger dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">Eintrag löschen</button> | ||||
| 							<ul class="dropdown-menu"> | ||||
| 								<li><a class="dropdown-item" th:href="@{/note/delete/{id}(id=${noteBean.pk})}">endgültig löschen</a></li> | ||||
| 							</ul> | ||||
| 						</div> | ||||
| 					</div> | ||||
| 				</div> | ||||
| 			</form> | ||||
| 		</div> | ||||
| 	</main> | ||||
| </body> | ||||
| </html> | ||||
							
								
								
									
										76
									
								
								src/main/resources/templates/note/list.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								src/main/resources/templates/note/list.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,76 @@ | ||||
| <!DOCTYPE html> | ||||
| <html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" | ||||
| 	xmlns:sec="http://www.thymeleaf.org/extras/spring-security" layout:decorate="~{layout/main.html}"> | ||||
| <head> | ||||
| <title>Notizen</title> | ||||
| </head> | ||||
| <body> | ||||
| 	<ul layout:fragment="menu"> | ||||
| 		<li class="nav-item" sec:authorize="hasRole('timetrack_user')"><a class="nav-link" th:href="@{/note/add}">Neue Notiz | ||||
| 				anlegen</a></li> | ||||
| 	</ul> | ||||
| 	<main layout:fragment="content"> | ||||
| 		<div class="accordion" id="acdiv"> | ||||
| 			<div class="accordion-item noty"> | ||||
| 				<h2 class="accordion-header" id="headingDashboard"> | ||||
| 					<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#dashboard" aria-expanded="true" | ||||
| 						aria-controls="dashboard">Dashboard</button> | ||||
| 				</h2> | ||||
| 				<div id="dashboard" class="accordion-collapse collapse show" aria-labelledby="headingDashboard" data-bs-parent="#acdiv"> | ||||
| 					<div class="accordion-body"> | ||||
| 						<div class="row row-cols-12 ro-cols-lg-3 ro-cols-md-2 ro-cols-sd-1 g-4" style="margin: 8px"> | ||||
| 							<div class="col" th:each="note : ${noteList}"> | ||||
| 								<div class="card text-dark bg-light shadow" style="width: 100%"> | ||||
| 									<div class="card-header text-center"> | ||||
| 										<font th:text="${note.category}" style="font-size: larger">:</font> <font th:text="${note.title}" | ||||
| 											style="font-size: larger; font-weight: bolder"></font> | ||||
| 									</div> | ||||
| 									<div class="card-body"> | ||||
| 										<div class="d-flex justify-content-center align-items-center"> | ||||
| 											<pre th:text="${note.content}"></pre> | ||||
| 											<a th:href="@{/note/edit/{id}(id=${note.pk})}" sec:authorize="hasRole('timetrack_user')" style="margin-left: 8px;"> | ||||
| 												<i class="fa fa-edit"></i> | ||||
| 											</a> | ||||
| 										</div> | ||||
| 									</div> | ||||
| 									<div class="card-footer"> | ||||
| 										<span th:text="${note.type}"></span> | ||||
| 									</div> | ||||
| 								</div> | ||||
| 							</div> | ||||
| 						</div> | ||||
| 					</div> | ||||
| 				</div> | ||||
| 				<div class="accordion-item glassy"> | ||||
| 					<h2 class="accordion-header" id="headingTable"> | ||||
| 						<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#list" | ||||
| 							aria-expanded="false" aria-controls="list">Liste</button> | ||||
| 					</h2> | ||||
| 					<div id="list" class="accordion-collapse collapse" aria-labelledby="headingTable" data-bs-parent="#acdiv"> | ||||
| 						<div class="accordion-body" style="background-color: white"> | ||||
| 							<table class="table table-striped table-condensed"> | ||||
| 								<thead> | ||||
| 									<tr> | ||||
| 										<th>Titel</th> | ||||
| 										<th>Kategorie</th> | ||||
| 										<th>Inhalt</th> | ||||
| 										<th>Typ</th> | ||||
| 									</tr> | ||||
| 								</thead> | ||||
| 								<tbody> | ||||
| 									<tr th:each="note : ${noteList}"> | ||||
| 										<td><a th:href="@{/note/edit/{id}(id=${note.pk})}"><span th:text="${note.title}"></span></a></td> | ||||
| 										<td><a th:href="@{/note/edit/{id}(id=${note.pk})}"><span th:text="${note.category}"></span></a></td> | ||||
| 										<td><a th:href="@{/note/edit/{id}(id=${note.pk})}"><span th:text="${note.content}"></span></a></td> | ||||
| 										<td><a th:href="@{/note/edit/{id}(id=${note.pk})}"><span th:text="${note.type}"></span></a></td> | ||||
| 									</tr> | ||||
| 								</tbody> | ||||
| 							</table> | ||||
| 						</div> | ||||
| 					</div> | ||||
| 				</div> | ||||
| 			</div> | ||||
| 		</div> | ||||
| 	</main> | ||||
| </body> | ||||
| </html> | ||||
		Reference in New Issue
	
	Block a user