Add feature to show date standard using the config for issue #48

This commit is contained in:
squandor 2017-01-08 01:09:16 +01:00
parent 1e8e7daa60
commit 5f46a40cf5
3 changed files with 6 additions and 1 deletions

View File

@ -9,6 +9,7 @@
username = password # Add users for Domoboard here. In this case login with username "username" and password "password"
[[domoboard]]
time = False # True/False: show time in top bar
date = False # True/False: show date in top bar
google_maps_api_key = X # Google Maps Embed API key
# Add Navbar items here. The key is the navbar link name. The first value is the URI name, second value can be any font awesome logo to be displayed.

View File

@ -111,7 +111,7 @@ def configValueExists(value):
def validateConfigFormat(config):
requiredSettings = {"general_settings/server": ["url", "flask_url", "user", "password", "secret_key"],
"general_settings/domoboard": ["time"],
"general_settings/domoboard": ["time", "date"],
"navbar/menu": [None] }
for sect, fields in requiredSettings.iteritems():
section = sect.split('/')

View File

@ -21,6 +21,10 @@
$('#time-part').html(momentNow.format('HH:mm'));
}, 100);
{% if configValues["domoboard"].get("date") == "True" %}
$('#date-part').removeClass('hide_date');
$('#date-part').addClass('show_date');
{% endif %}
$( "#date-part" ).click(function() {
$('#date-part').removeClass('show_date');