Skip to content

Commit

Permalink
add possibility of setting a footer message
Browse files Browse the repository at this point in the history
  • Loading branch information
palves-ulht committed Sep 9, 2024
1 parent 66fabad commit 16a1e20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class GlobalControllerAdvice {
@Value("\${dropProject.admin.email}")
val adminEmailProperty: String = ""

@Value("\${dropProject.footer.message:}")
val footerMessage: String = ""

@Autowired
lateinit var buildProperties: BuildProperties

Expand Down Expand Up @@ -75,6 +78,11 @@ class GlobalControllerAdvice {
return dataSource!!.driverClassName == "org.h2.Driver"
}

@ModelAttribute("footerMessage")
fun footerMessage() : String {
return footerMessage
}

@ModelAttribute("demoMode")
fun isDemoMode() : Boolean {
if (userDetailsManager != null && userDetailsManager is InMemoryUserDetailsManager) {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/templates/layout/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
<div class="container">
<p class="navbar-text pull-left">Feedback: <a th:href="'mailto:' + ${adminEmail}" th:text="${adminEmail}">pedro.alves@ulusofona.pt</a></p>
<p class="navbar-text" th:if="${embeddedDB}" style="color:red"><strong>WARNING: Using in-memory database. All data will be lost on restart!!!</strong></p>
<p class="navbar-text" th:if="${!#strings.isEmpty(footerMessage)}" style="color:red" th:text="${footerMessage}">Footer message</p>
<p class="navbar-text pull-right">
Powered by Drop Project
(<small th:text="${buildInfo.version}"></small>)
Expand Down

0 comments on commit 16a1e20

Please sign in to comment.