Implement Git revision in superuser template
This commit is contained in:
parent
32bde8ee00
commit
b76b3acd49
2 changed files with 4 additions and 2 deletions
|
@ -9,7 +9,8 @@ def getCommit():
|
|||
repo = Repo(settings.BASE_DIR)
|
||||
return "%s (%s)" % (str(repo.head.commit)[:7], str(repo.head.commit.committed_datetime))
|
||||
|
||||
@register.simple_tag
|
||||
def isLatestCommit():
|
||||
repo = Repo(settings.BASE_DIR)
|
||||
origin = repo.remotes[0].refs[0]
|
||||
return origin.commit.committed_datetime <= repo.head.commit.committed_datetime
|
||||
return "" if origin.commit.committed_datetime <= repo.head.commit.committed_datetime else " – Update available!"
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
<title>VPN360 Device Administration</title>
|
||||
|
||||
{% load static %}
|
||||
{% load repo %}
|
||||
|
||||
{% block header %}
|
||||
{% endblock %}
|
||||
|
@ -69,7 +70,7 @@
|
|||
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<span class="text-muted">© <a style="color: rgb(108, 117, 125);" href="https://kumi.systems/">Kumi Systems e.U.</a></span>
|
||||
<span class="text-muted">© <a style="color: rgb(108, 117, 125);" href="https://kumi.systems/">Kumi Systems e.U.</a>{% if user.is_superuser %}<br/>Git Revision: {% getCommit %}{% isLatestCommit %}{% endif %}</span>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
|
|
Loading…
Reference in a new issue