Skip to content
Snippets Groups Projects
Verified Commit 73994192 authored by nd's avatar nd
Browse files

show version in footer, closes #13

parent c1ce5425
No related branches found
No related tags found
No related merge requests found
.footer {
position: absolute;
position: fixed;
bottom: 0;
width: 100%;
height: 2em;
......
......@@ -8,7 +8,7 @@ def register_template_helper(app):
return a == b
@app.url_defaults
def static_version_inject(endpoint, values):
def static_version_inject(endpoint, values): #pylint: disable=unused-variable
if endpoint == 'static':
values['v'] = app.jinja_env.globals['gitversion']['longhash'] #pylint: disable=no-member
......@@ -23,5 +23,5 @@ def register_template_helper(app):
app.add_template_global(equalto, name='equalto')
# get git commit
GITOUTPUT = subprocess.check_output(['git', "log", "-g", "-1", "--pretty=%H#%h#%d#%s"]).decode('UTF-8').split('#', 3)
app.jinja_env.globals['gitversion'] = {'hash': GITOUTPUT[1], 'longhash': GITOUTPUT[0], 'branch': GITOUTPUT[2], 'msg': GITOUTPUT[3]} #pylint: disable=no-member
git_output = subprocess.check_output(['git', "log", "-g", "-1", "--pretty=%H#%h#%d#%s"]).decode('UTF-8').split('#', 3)
app.jinja_env.globals['gitversion'] = {'hash': git_output[1], 'longhash': git_output[0], 'branch': git_output[2], 'msg': git_output[3]} #pylint: disable=no-member
......@@ -102,6 +102,10 @@
{% for link in config["FOOTER_LINKS"]%}
<li class="list-inline-item"><a href="{{ link.url }}">{{ link.title }}</a></li>
{% endfor %}
<li class="list-inline-item float-right">
<a href="https://git.cccv.de/infra/uffd/uffd/">Sourcecode</a>
<a target="_blank" href="https://git.cccv.de/infra/uffd/uffd/-/commit/{{ gitversion.longhash }}"><span title="{{ gitversion.branch }} {{ gitversion.hash }}: {{ gitversion.msg }}" data-toggle="tooltip">Version: {{ gitversion.hash }}</span></a>
</li>
</ul>
</div>
{% endblock footer %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment