Commit 87eba101 authored by Andreas Valder's avatar Andreas Valder
Browse files

added commit hash and debug highlight

parent d82943b2
......@@ -54,6 +54,10 @@ if sys.argv[0].endswith('run.py'):
config.from_pyfile('config.py', silent=True)
if config['DEBUG']:
app.jinja_env.auto_reload = True
# get git commit
import subprocess
app.jinja_env.globals['gitversion'] = subprocess.check_output(['git', "log", "-g", "-1", "--pretty=%h # %d # %s"]).decode('UTF-8').split('#')
if not config.get('SECRET_KEY', None):
config['SECRET_KEY'] = os.urandom(24)
......
......@@ -38,7 +38,7 @@
</head>
<body>
{% block navbar %}
<nav class="hidden-print navbar navbar-default navbar-static-top">
<nav class="hidden-print navbar navbar-default navbar-static-top" {% if config.DEBUG %} style="background-color: red" {% endif %} >
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse"
......@@ -127,7 +127,7 @@
</div>
</div>
{% block footer %}
<footer class="footer hidden-print">
<footer class="footer hidden-print" {% if config.DEBUG %} style="background-color: red" {% endif %} >
<div class="container-fluid">
<ul class="list-inline" style="margin-top: 5px;">
<li>
......@@ -145,9 +145,10 @@
<li>
<a href="https://twitter.com/rwthvideo">Twitter</a>
</li>
{% if ismod() %}
{% if ismod() or config.DEBUG %}
<li class="pull-right">
{{ gethostname() }}
<a target="_blank" href="https://git.fsmpi.rwth-aachen.de/videoagwebsite/videoagwebsite/commit/{{ gitversion[0] }}"><span title="{{ gitversion[0] }} {{ gitversion[1] }}: {{ gitversion[2] }}" data-toggle="tooltip">{{ gitversion[0] }}</span></a>
<span>{{ gethostname() }}</span>
</li>
{% endif %}
</div>
......@@ -159,8 +160,12 @@
$( function () {
moderator.permissioneditor.setpermissions({{global_permissions|tojson|safe}});
moderator.api.setcsrftoken('{{ session['_csrf_token'] }}');
$('[data-toggle="tooltip"]').tooltip({ 'trigger': 'hover' });
});
</script>
{% endif %}
<script>
$( function () {
$('[data-toggle="tooltip"]').tooltip({ 'trigger': 'hover' });
});
</script>
</html>
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