diff --git a/src/main/java/com/github/cato447/AbizeitungVotingSystem/controller/VotingController.java b/src/main/java/com/github/cato447/AbizeitungVotingSystem/controller/VotingController.java index 096ac62..17b1be8 100644 --- a/src/main/java/com/github/cato447/AbizeitungVotingSystem/controller/VotingController.java +++ b/src/main/java/com/github/cato447/AbizeitungVotingSystem/controller/VotingController.java @@ -19,6 +19,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import javax.annotation.PostConstruct; +import java.time.LocalDate; +import java.time.Month; import java.util.*; import java.util.concurrent.ExecutionException; @@ -85,7 +87,16 @@ public class VotingController { @RequestMapping("/") public String WelcomeSite() { - return "start.html"; + 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"; + } } public void sendSimpleMessage(String to, String subject, String text) { diff --git a/src/main/resources/templates/errors/votingClosed.html b/src/main/resources/templates/errors/votingClosed.html new file mode 100644 index 0000000..5c5e830 --- /dev/null +++ b/src/main/resources/templates/errors/votingClosed.html @@ -0,0 +1,24 @@ + + + +
+ +