Commit 21a1c964 authored by Julian Rother's avatar Julian Rother
Browse files

Add version information to documentation page

/close #161
parent 9ae236dc
......@@ -18,6 +18,7 @@ import os
from datetime import datetime
import math
import mimetypes
import subprocess
import config
from shared import db, date_filter, datetime_filter, date_filter_long, date_filter_short, time_filter, time_filter_short, user_manager, security_manager, current_user, check_login, login_required, group_required, class_filter, needs_date_test, todostate_name_filter, code_filter, indent_tab_filter
......@@ -80,6 +81,18 @@ app.jinja_env.globals.update(max=max)
def get_git_revision():
gitlab_url = ""
commit_hash = subprocess.check_output(["git", "log", "-g", "-1", "--pretty=%H"]).decode("UTF-8").strip()
timestamp = int(subprocess.check_output(["git", "log", "-g", "-1", "--pretty=%at"]).strip())
commit_date = datetime.fromtimestamp(timestamp)
return {"url": gitlab_url, "hash": commit_hash, "date": commit_date}
app.jinja_env.globals["git_revision"] = get_git_revision()
# blueprints here
......@@ -214,6 +214,11 @@
Optional kann zusätzlich eine Uhrzeit angegeben werden: <code>[sitzung;Datum;Uhrzeit]</code> (z.B. <code>[sitzung;01.01.2018;9:00]</code>).
{% endif %}
{% if git_revision %}
<h3 id="version">Version</h4>
Dieses Protokollsystem nutzt die Software <a href="{{git_revision.url}}">„Protokollsystem 3“</a> in der Version vom <a href="{{git_revision.url}}/commit/{{git_revision.hash}}">{{|datify}}</a>.
Alle Änderungen, die seitdem hinzugekommen sind, kannst du <a href="{{git_revision.url}}/compare/{{git_revision.hash}}...master">hier</a> sehen.
{% endif %}
{% endblock %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment