All fallbacks added to the login site. Edited voting.html

.gitignore:
    - added the /logs folder to the gitignore

VotingController.java:
    - added log message logging false entry format

Candidate.java:
    - return type changed from 'String' to 'Candidate'

wrongEmail.html:
    - added html file to avoid error

voting.html:
    - changed the way of output
This commit is contained in:
2020-11-14 01:11:17 +01:00
parent ad944b9616
commit d7185572fc
5 changed files with 10 additions and 8 deletions

1
.gitignore vendored
View File

@@ -31,3 +31,4 @@ build/
### VS Code ###
.vscode/
*.log

View File

@@ -85,6 +85,7 @@ public class VotingController {
return "errors/notRegistered.html";
}
}
LOGGER.error("Wrong input format detected: " + name);
return "errors/wrongEmail.html";
}

View File

@@ -40,5 +40,5 @@ public class Candidate {
return votes;
}
public String getCategory() {return category.getName();}
public Category getCategory() {return category;}
}

View File

@@ -10,13 +10,13 @@
<body>
<h1>Wähle deine Kandidaten:</h1>
<div th:each="candidate: ${candidates}">
<p th:text="${candidate.id}"></p>
<p th:text="${candidate.name}"></p>
<p th:text="${candidate.votes}"></p>
<p th:text="${candidate.category}"></p>
<!-- <input type="checkbox" id="${candidate.id}" name="${candidate.name}" unchecked>
<label for="${candidate.id}" th:text="${candidate.name}"></label> -->
<div th:each="candidate : ${candidates}" class="candidates">
<h2 th:text="${candidate.category.name}"></h2>
<ul>
<li th:text="${candidate.name}"></li>
<li th:text="${candidate.votes}"></li>
<li th:text="${candidate.category.id}"></li>
</ul>
</div>
</body>