PossibleCandidates get saved to their own database now

CHANGED VotingController:
    - changed 'candidateSaving' possibleCandidates get Located by name and category and get saved now

CHANGED PossibleCandidateRepository:
    - removed 'findByNameAndCategoryID'
    - added 'findByNameAndCategory'

ADDED addingCandidates.css:
    - added basic styling

CHANGED voting.css:
    - bug that div gets cut off resolved

CHANGED addingCandidates.html:
    - changed display method from table to div

CHANGED: voting.html:
    - added div to style the site (bugfix)
This commit is contained in:
2020-11-30 22:58:14 +01:00
parent 361433bf22
commit 525074af15
7 changed files with 1204 additions and 197 deletions

View File

@@ -4,29 +4,20 @@
<head>
<meta charset="UTF-8">
<title>Title</title>
<link th:href="@{/styles/addingCandidates.css}" rel="stylesheet" />
</head>
<body>
<h1>Schlage für jede Kategorie eine/n Kandiadt/en vor:</h1>
<form action="#" th:action="@{/saveCandidates}" th:object="${form}" method="post">
<fieldset>
<table>
<thead>
<tr>
<th> Kategorie</th>
<th> Kandidat/in</th>
</tr>
</thead>
<tbody>
<tr th:each="category, itemStat : ${categories}">
<td th:text="${category.name}"></td>
<td><input th:field="*{possibleCandidates[__${itemStat.index}__].name}" /></td>
</tr>
</tbody>
</table>
<body class="center-screen">
<div class="centered">
<h1>Schlage für jede Kategorie eine/n Kandiadt/en vor:</h1>
<form action="#" th:action="@{/saveCandidates}" th:object="${form}" method="post">
<div th:each="category, itemStat : ${categories}">
<h2 class="categoryHeader" th:text="${category.name}"></h2>
<input th:field="*{possibleCandidates[__${itemStat.index}__].name}" />
</div>
<input type="submit" id="submitButton" th:value="Confirm"></button>
</fieldset>
</form>
</form>
</div>
</body>
</html>