Added a datelock to end votes automatically
This commit is contained in:
+11
@@ -19,6 +19,8 @@ import org.apache.logging.log4j.LogManager;
|
|||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.Month;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
@@ -85,8 +87,17 @@ public class VotingController {
|
|||||||
|
|
||||||
@RequestMapping("/")
|
@RequestMapping("/")
|
||||||
public String WelcomeSite() {
|
public String WelcomeSite() {
|
||||||
|
LocalDate finishDate = LocalDate.of(2021, Month.JANUARY,8);
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
|
||||||
|
if(now.isAfter(finishDate)){
|
||||||
|
LOGGER.warn("passed");
|
||||||
|
return "errors/votingClosed.html";
|
||||||
|
} else {
|
||||||
|
LOGGER.warn("in Bounds");
|
||||||
return "start.html";
|
return "start.html";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void sendSimpleMessage(String to, String subject, String text) {
|
public void sendSimpleMessage(String to, String subject, String text) {
|
||||||
SimpleMailMessage message = new SimpleMailMessage();
|
SimpleMailMessage message = new SimpleMailMessage();
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="de" xmlns:th="https://www.thymeleaf.org/">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
<link th:href="@{/styles/allreadyVoted.css}" rel="stylesheet" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="center-screen">
|
||||||
|
<div class="centered">
|
||||||
|
<h1>Das Voting wurde beendet!</h1>
|
||||||
|
<h2>Informationen zu Votings sind der Adolfinumwebsite zu entnehmen</h2>
|
||||||
|
<button id="backButton" class="submitButton">Zur Adolfinum Seite</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById("backButton").onclick = function() {
|
||||||
|
location.href = "https://adolfinum.de";
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user