Removed the dashboard because of the existence of phpmyadmin

This commit is contained in:
2020-12-12 00:02:47 +01:00
parent b32cc63e76
commit 03e5e1b455
5 changed files with 0 additions and 118 deletions

View File

@@ -248,22 +248,4 @@ public class VotingController {
}
}
@RequestMapping("/dashboard")
public String AccessDashboard(@RequestParam String password, Model model) {
try {
if (password.equals("admin")) {
List<Voter> voters = voterRepository.findAll();
List<Category> categories = categoryRepository.findAll();
model.addAttribute("voters", voters);
model.addAttribute("categories", categories);
return "dashboard.html";
} else {
LOGGER.error("Wrong Password");
}
} catch (Exception e) {
LOGGER.fatal("voters table is not existing!");
}
return "redirect:/";
}
}

View File

@@ -1,17 +0,0 @@
td.voted {
background-color: #f05048;
}
td.submitted {
background-color: #dbc95e;
}
td.notVoted {
background-color: #76ed6b;
}
li {
padding-left: 15px;
display: inline;
float: left;
}

View File

@@ -14,14 +14,6 @@ div.userLogin {
transform: translate(-50%, -50%);
}
div.adminLogin {
position: absolute;
right: 10%;
bottom: 10%;
-webkit-transform: translate(-10%, -10%);
transform: translate(-10%, -10%);
}
input.email_input {
background-color: transparent;
border: transparent;

View File

@@ -1,68 +0,0 @@
<!DOCTYPE html>
<html lang="de" xmlns:th="https://www.thymeleaf.org/">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link th:href="@{/styles/dashboard.css}" rel="stylesheet" />
</head>
<body>
<ul>
<li>
<h1>Wähler Liste</h1>
<div class="voterTable">
<table class="tableVoters" border="5">
<tr>
<th>Id</th>
<th>E-Mail</th>
</tr>
<tr th:each="voter : ${voters}">
<!-- If voter has voted -->
<div th:if="${voter.vote_status}">
<td class="voted" th:text="${voter.id}"></td>
<td class="voted" th:text="${voter.email}"></td>
</div>
<!-- ELSE -->
<div th:unless="${voter.vote_status}">
<div th:if="${voter.candidatesubmit_status}">
<td class="submitted" th:text="${voter.id}"></td>
<td class="submitted" th:text="${voter.email}"></td>
</div>
<div th:unless="${voter.candidatesubmit_status}">
<td class="notVoted" th:text="${voter.id}"></td>
<td class="notVoted" th:text="${voter.email}"></td>
</div>
</div>
</tr>
</table>
</div>
</li>
<li>
<h1>Kandidaten Liste</h1>
<div th:each="category : ${categories}" th:id="${category.id}">
<h2 th:text="${category.name}"></h2>
<table class="tableCandidates" border="5">
<tr>
<th>Id</th>
<th>Name</th>
<th>Votes</th>
</tr>
<tr th:each="candidate: ${category.candidateList}" th:id="${category.id} + '_' + ${candidate.id}">
<td th:text="${candidate.id}"></td>
<td th:text="${candidate.name}"></td>
<td th:text="${candidate.votes}"></td>
</tr>
</table>
</div>
</li>
</ul>
</body>
</html>

View File

@@ -35,13 +35,6 @@
<button type="submit" id="signup_button">Abstimmen</button>
</form>
</div>
<div class="adminLogin">
<form action="#" th:action="@{/dashboard}" method="post">
<input class="password_input" id="password_input" type="password" placeholder="••••••" name="password" required autofocus />
<p></p>
<button type="submit" id="login_button">Login</button>
</form>
</div>
</body>
</html>