Added basic forms for parties

This commit is contained in:
2023-07-09 18:29:20 +02:00
parent 52e1a72330
commit 9a95cbcbc3
10 changed files with 265 additions and 67 deletions
@@ -0,0 +1,50 @@
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" lang="de">
<head th:fragment="head">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title th:text="${party}"></title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM"
crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row">
<div class="col">
<form action="#" th:action="@{/wahlrecht/v1/party}"
th:object="${party}" method="post">
<div>
<label for="electionName" class="form-label">Wahlname</label>
<select name="electionName" id="electionName" class="form-select"
th:field="*{electionName}">
<option th:each="election : ${elections}" th:text="${election.name()}"
th:value="${election.name()}"></option>
</select>
</div>
<div>
<label for="partyAbbreviation" class="form-label">Parteiabkürzung</label>
<input type="text" name="abbreviation" id="partyAbbreviation" class="form-control"
th:field="*{abbreviation}">
</div>
<div>
<label for="partyName" class="form-label">Parteiname</label>
<input type="text" name="name" id="partyName" class="form-control"
th:field="*{name}">
</div>
<div class="mt-3">
<button type="submit" class="btn btn-primary"
th:text="${party.name} != null ? 'Aktualisieren' : 'Erstellen'">
Erstellen
</button>
</div>
</form>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"
integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz"
crossorigin="anonymous"></script>
</body>
</html>
@@ -0,0 +1,50 @@
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" lang="de">
<head th:fragment="head">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title th:text="${party}"></title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM"
crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row">
<div class="col">
<form action="#" th:action="@{/wahlrecht/v1/party/{electionName}/{abbreviation}(electionName=${party.electionName}, abbreviation=${party.abbreviation})}"
th:object="${party}" method="post">
<div>
<label for="electionName" class="form-label">Wahlname</label>
<select name="electionName" id="electionName" class="form-select"
th:field="*{electionName}">
<option th:each="election : ${elections}" th:text="${election.name()}"
th:value="${election.name()}"></option>
</select>
</div>
<div>
<label for="partyAbbreviation" class="form-label">Parteiabkürzung</label>
<input type="text" name="abbreviation" id="partyAbbreviation" class="form-control"
th:field="*{abbreviation}">
</div>
<div>
<label for="partyName" class="form-label">Parteiname</label>
<input type="text" name="name" id="partyName" class="form-control"
th:field="*{name}">
</div>
<div class="mt-3">
<button type="submit" class="btn btn-primary"
th:text="${party.name} != null ? 'Aktualisieren' : 'Erstellen'">
Erstellen
</button>
</div>
</form>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"
integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz"
crossorigin="anonymous"></script>
</body>
</html>
@@ -1,7 +1,7 @@
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" lang="en">
<head th:fragment="head">
<title><th:block th:text="${version}"/></title>
<title th:text="${version}"></title>
<style>
@media (prefers-color-scheme: dark) {
html{background:#000000;color:#ffffff;font:15px/22px arial,sans-serif}