diff --git a/doorlockd b/doorlockd index 00fbd46..930323c 100755 --- a/doorlockd +++ b/doorlockd @@ -64,8 +64,6 @@ default_ldap_uri = 'ldaps://ldap1.binary.kitchen/ ' \ 'ldaps://ldapm.binary.kitchen/' default_binddn = 'cn=%s,ou=people,dc=binary-kitchen,dc=de' -html_title = 'Binary Kitchen Doorlock (%s - v%s)' % (__status__, __version__) - webapp = Flask(__name__, template_folder=template_folder, static_folder=static_folder) @@ -75,6 +73,11 @@ serial_port = webapp.config.get('SERIAL_PORT') simulate_ldap = webapp.config.get('SIMULATE_LDAP') simulate_serial = webapp.config.get('SIMULATE_SERIAL') run_hooks = webapp.config.get('RUN_HOOKS') +room = webapp.config.get('ROOM') +title = webapp.config.get('TITLE') +welcome = webapp.config.get('WELCOME') + +html_title = '%s (%s - v%s)' % (title, __status__, __version__) ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_DEMAND) ldap.set_option(ldap.OPT_REFERRALS, 0) @@ -406,7 +409,10 @@ def on_connect(): @webapp.route('/display') def display(): - return render_template('display.html') + return render_template('display.html', + room=room, + title=title, + welcome=welcome) @webapp.route('/api', methods=['POST']) @@ -478,7 +484,7 @@ def home(): response=response, state_text=logic.state.to_html(), led=logic.state.to_img(), - title=html_title) + banner='%s - %s' % (title, room)) if __name__ == '__main__': diff --git a/doorlockd.cfg b/doorlockd.cfg index 75607cd..16ebdfa 100644 --- a/doorlockd.cfg +++ b/doorlockd.cfg @@ -11,4 +11,7 @@ LDAP_BINDDN = 'cn=%s,ou=people,dc=binary-kitchen,dc=de' BOOTSTRAP_SERVE_LOCAL = True +TITLE = 'Binary Kitchen Doorlock' +ROOM = 'Hauptraum' +WELCOME = 'Willkommen in der Binary Kitchen' SERIAL_PORT = '/dev/ttyAMA0' diff --git a/share/doorlockd/templates/display.html b/share/doorlockd/templates/display.html index 4b25090..845ef4f 100644 --- a/share/doorlockd/templates/display.html +++ b/share/doorlockd/templates/display.html @@ -1,7 +1,6 @@ {% extends "layout.html" %} {% block head %} -{{ title }} {{ super() }} {% endblock %} @@ -34,10 +33,11 @@ {% endblock %} {% block content %} -

Willkommen in der Binary Kitchen!

+

{{ welcome }}

+
{{ room }}
diff --git a/share/doorlockd/templates/index.html b/share/doorlockd/templates/index.html index 2126a2a..0d755a4 100644 --- a/share/doorlockd/templates/index.html +++ b/share/doorlockd/templates/index.html @@ -7,7 +7,7 @@ {%- endblock metas %} {% block content %} -

Binary Kitchen Doorlock

+

{{ banner }}