Skip to content
Snippets Groups Projects
Commit 29823b47 authored by Cédric Willekens's avatar Cédric Willekens
Browse files

Make version available to the home page

parent d070e46a
No related branches found
No related tags found
1 merge request!252Resolve "Display the deployed version number somewhere"
......@@ -134,6 +134,10 @@ tasks.register<Copy>("copyLogo") {
}
}
springBoot {
buildInfo()
}
sass {
download {
version = "1.26.3"
......
......@@ -22,8 +22,10 @@ package nl.tudelft.ewi.walkytalky.controller;
import nl.tudelft.ewi.walkytalky.services.AuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.info.BuildProperties;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
/**
* Controller for home/informational pages.
......@@ -34,6 +36,9 @@ public class StaticController {
@Autowired
private AuthService authService;
@Autowired(required = false)
private BuildProperties buildProperties;
@GetMapping("/")
public String index() {
return authService.pageForUserRole("home/index");
......@@ -63,4 +68,12 @@ public class StaticController {
public String contribute() {
return "contribute/index";
}
@ModelAttribute("version")
public String version() {
if (buildProperties == null) {
return "development";
}
return buildProperties.getVersion();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment