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

removed version from footer as well as drop the git dependency

parent eb2c2c2e
Branches
Tags
No related merge requests found
...@@ -15,7 +15,6 @@ Development chat: [#uffd-development](https://rocket.events.ccc.de/channel/uffd- ...@@ -15,7 +15,6 @@ Development chat: [#uffd-development](https://rocket.events.ccc.de/channel/uffd-
- python3-fido2 (version 0.5.0, optional) - python3-fido2 (version 0.5.0, optional)
- python3-flask-oauthlib - python3-flask-oauthlib
- python3-flask-babel - python3-flask-babel
- git (cli utility, musst be in path)
Some of the dependencies (especially fido2 and flask-oauthlib) changed their API in recent versions, so make sure to install the versions from Debian Buster. Some of the dependencies (especially fido2 and flask-oauthlib) changed their API in recent versions, so make sure to install the versions from Debian Buster.
You can also use virtualenv with the supplied `requirements.txt`. You can also use virtualenv with the supplied `requirements.txt`.
......
import random import random
import subprocess
import base64 import base64
from datetime import timedelta, datetime from datetime import timedelta, datetime
import io import io
...@@ -28,11 +27,6 @@ def register_template_helper(app): ...@@ -28,11 +27,6 @@ def register_template_helper(app):
def datauri(data, mimetype='text/plain'): #pylint: disable=unused-variable def datauri(data, mimetype='text/plain'): #pylint: disable=unused-variable
return Markup('data:%s;base64,%s'%(mimetype, base64.b64encode(data.encode()).decode())) return Markup('data:%s;base64,%s'%(mimetype, base64.b64encode(data.encode()).decode()))
@app.url_defaults
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
app.jinja_env.trim_blocks = True app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True app.jinja_env.lstrip_blocks = True
...@@ -42,7 +36,3 @@ def register_template_helper(app): ...@@ -42,7 +36,3 @@ def register_template_helper(app):
app.add_template_global(min, name='min') app.add_template_global(min, name='min')
app.add_template_global(max, name='max') app.add_template_global(max, name='max')
app.add_template_global(equalto, name='equalto') app.add_template_global(equalto, name='equalto')
# get git commit
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
...@@ -130,8 +130,7 @@ ...@@ -130,8 +130,7 @@
<li class="list-inline-item"><a href="{{ link.url }}">{{ link.title }}</a></li> <li class="list-inline-item"><a href="{{ link.url }}">{{ link.title }}</a></li>
{% endfor %} {% endfor %}
<li class="list-inline-item float-right"> <li class="list-inline-item float-right">
<a href="https://git.cccv.de/uffd/uffd/">{{_("Sourcecode")}}</a> <a href="https://git.cccv.de/uffd/uffd/">{{_("About uffd")}}</a>
<a target="_blank" href="https://git.cccv.de/uffd/uffd/-/commit/{{ gitversion.longhash }}"><span title="{{ gitversion.branch }} {{ gitversion.hash }}: {{ gitversion.msg }}" data-toggle="tooltip">Version: {{ gitversion.hash }}</span></a>
</li> </li>
</ul> </ul>
</div> </div>
......
No preview for this file type
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PROJECT VERSION\n" "Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2021-07-30 19:49+0200\n" "POT-Creation-Date: 2021-07-30 21:03+0200\n"
"PO-Revision-Date: 2021-05-25 21:18+0200\n" "PO-Revision-Date: 2021-05-25 21:18+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: de\n" "Language: de\n"
...@@ -962,8 +962,8 @@ msgstr "Verlassen von Rollen ist deaktiviert" ...@@ -962,8 +962,8 @@ msgstr "Verlassen von Rollen ist deaktiviert"
#: uffd/selfservice/views.py:147 #: uffd/selfservice/views.py:147
#, python-format #, python-format
msgid "You left role \"%(role_name)s\"" msgid "You left role %(role_name)s"
msgstr "Rolle \"%(role_name)s\" verlassen" msgstr "Rolle %(role_name)s verlassen"
#: uffd/selfservice/views.py:211 #: uffd/selfservice/views.py:211
#, python-format #, python-format
...@@ -1408,8 +1408,8 @@ msgid "Change" ...@@ -1408,8 +1408,8 @@ msgid "Change"
msgstr "Ändern" msgstr "Ändern"
#: uffd/templates/base.html:133 #: uffd/templates/base.html:133
msgid "Sourcecode" msgid "About uffd"
msgstr "Quellcode" msgstr "Über uffd"
#: uffd/user/views_group.py:21 #: uffd/user/views_group.py:21
msgid "Groups" msgid "Groups"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment