aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/templates/client/about.html2
-rw-r--r--client/views.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/client/templates/client/about.html b/client/templates/client/about.html
index ea32787..8de95a9 100644
--- a/client/templates/client/about.html
+++ b/client/templates/client/about.html
@@ -13,7 +13,7 @@
<div class="card">
<div class="card-content">
<p>
- Versione software {{version}}
+ Versione software {{version}}<br>Commit ID: <a href="https://git.thearcway.org/mafaldo/scout-subs/commit/?id={{commitid}}">{{commitid}}</a>
</p>
<h5>Licenza</h5>
<blockquote>
diff --git a/client/views.py b/client/views.py
index 11ff367..01909d7 100644
--- a/client/views.py
+++ b/client/views.py
@@ -11,6 +11,7 @@ from django.template.loader import get_template
from io import BytesIO
import pdfkit
import base64
+from subprocess import check_output
def index(request):
@@ -298,5 +299,7 @@ def about(request):
version = f.read()
if version.startswith("0"):
version = "Beta " + version
- context = {"version": version}
+ commitid = check_output(["git", "rev-parse", "HEAD"]).decode()
+ version = version[:version.find(" $Id: ")]
+ context = {"version": version, "commitid": commitid}
return render(request, 'client/about.html', context)