diff --git a/config/settings.py b/config/settings.py
index 737836c688..80534cac0b 100644
--- a/config/settings.py
+++ b/config/settings.py
@@ -78,6 +78,7 @@ TEMPLATES = [
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
+ "ultron.core.context_processors.git_describe"
],
},
},
diff --git a/templates/ultron/dashboard/dashboard.html b/templates/ultron/dashboard/dashboard.html
index e4bacfede7..57f5853a33 100644
--- a/templates/ultron/dashboard/dashboard.html
+++ b/templates/ultron/dashboard/dashboard.html
@@ -11,7 +11,7 @@
- Welcome to Ultron v0.42
(last update : 9-1-2022)
+ Welcome to Ultron {{ git_describe }}
(last update : {{ git_date }})
This application is there to help us manage the gymnasts (evolution, evaluation, routine, scores, ...). It is not perfect so feel free to make improvement proposals, bug reports, … by sending me an
email.
Gelukkig nieuwjaar 2022 en mijn beste wensen!
diff --git a/ultron/core/context_processors.py b/ultron/core/context_processors.py
new file mode 100644
index 0000000000..355654d6a1
--- /dev/null
+++ b/ultron/core/context_processors.py
@@ -0,0 +1,12 @@
+import subprocess
+
+
+def git_describe(request) -> str:
+ return {
+ "git_describe": subprocess.check_output(
+ ["git", "describe", "--always"]
+ ).decode(),
+ "git_date": subprocess.check_output(
+ ["git", "show", "-s", r"--format=%cd", r"--date=format:%d-%m-%Y"]
+ ).decode(),
+ }