diff --git a/analytics.py b/analytics.py index 4d562aa..65c6c50 100644 --- a/analytics.py +++ b/analytics.py @@ -10,6 +10,8 @@ import auth file_access_temp = [] +app_config = auth.return_app_config() + # Example database name; you can change to whatever you want: DB_NAME = 'access_log.db' @@ -190,11 +192,26 @@ def songs_dashboard(): performance_data = [(count, titel) for titel, count in performance_counts.items()] performance_data.sort(reverse=True, key=lambda x: x[0]) - return render_template('songs_dashboard.html', timeframe=timeframe_param, performance_data=performance_data, site=site, category=category, admin_enabled=auth.is_admin()) + title_short = app_config.get('TITLE_SHORT', 'Default Title') + title_long = app_config.get('TITLE_LONG' , 'Default Title') + + return render_template('songs_dashboard.html', + timeframe=timeframe_param, + performance_data=performance_data, + site=site, + category=category, + admin_enabled=auth.is_admin(), + title_short=title_short, + title_long=title_long) @require_secret def connections(): - return render_template('connections.html', admin_enabled=auth.is_admin()) + title_short = app_config.get('TITLE_SHORT', 'Default Title') + title_long = app_config.get('TITLE_LONG' , 'Default Title') + return render_template('connections.html', + admin_enabled=auth.is_admin(), + title_short=title_short, + title_long=title_long) @require_secret def dashboard(): @@ -465,6 +482,9 @@ def dashboard(): # Convert the top-files rows to a list of dictionaries rows = [dict(rel_path=r[0], access_count=r[1]) for r in rows] + title_short = app_config.get('TITLE_SHORT', 'Default Title') + title_long = app_config.get('TITLE_LONG' , 'Default Title') + return render_template( "dashboard.html", timeframe=session['timeframe'], @@ -478,7 +498,9 @@ def dashboard(): unique_user=unique_user, cached_percentage=cached_percentage, timeframe_data=timeframe_data, - admin_enabled=auth.is_admin() + admin_enabled=auth.is_admin(), + title_short=title_short, + title_long=title_long ) def export_to_excel(): diff --git a/auth.py b/auth.py index 01d27aa..e604ed0 100644 --- a/auth.py +++ b/auth.py @@ -235,6 +235,9 @@ def mylinks(): token_url[token] = url token_valid_to[token] = token_item.get('validity', 'Unbekannt') + title_short = app_config.get('TITLE_SHORT', 'Default Title') + title_long = app_config.get('TITLE_LONG' , 'Default Title') + return render_template('mylinks.html', valid_secrets=valid_secrets, secret_qr_codes=secret_qr_codes, @@ -247,7 +250,10 @@ def mylinks(): token_folders=token_folders, token_url=token_url, token_valid_to=token_valid_to, - admin_enabled=is_admin() + admin_enabled=is_admin(), + + title_short=title_short, + title_long=title_long ) diff --git a/folder_secret_config_editor.py b/folder_secret_config_editor.py index 7e93f2d..c437919 100644 --- a/folder_secret_config_editor.py +++ b/folder_secret_config_editor.py @@ -6,6 +6,7 @@ import secrets import string import auth +app_config = auth.return_app_config() # Secret alphabet ALPHABET = string.ascii_letters + string.digits @@ -13,7 +14,13 @@ ALPHABET = string.ascii_letters + string.digits @auth.require_admin def folder_secret_config_editor(): - return render_template('folder_secret_config_editor.html', alphabet=ALPHABET, admin_enabled=auth.is_admin()) + title_short = app_config.get('TITLE_SHORT', 'Default Title') + title_long = app_config.get('TITLE_LONG' , 'Default Title') + return render_template('folder_secret_config_editor.html', + alphabet=ALPHABET, + admin_enabled=auth.is_admin(), + title_short=title_short, + title_long=title_long) @auth.require_admin def folder_secret_config_action(): diff --git a/static/app.css b/static/app.css index 57c34dc..38b9f06 100644 --- a/static/app.css +++ b/static/app.css @@ -4,6 +4,7 @@ html, body { color: var(--main-text-color); height: 100%; margin: 0; + /* padding: 0; */ } /* Global Styles */ @@ -23,6 +24,7 @@ body { display: flex; align-items: center; padding: 10px 20px; + /* width: 100%; */ } .site-header img.logo { height: 50px; @@ -51,6 +53,12 @@ body { font-size: 18px; } +.container-fluid { + height: 100%; + display: flex; + flex-direction: column; +} + /* Breadcrumb Styles */ .breadcrumb { margin-bottom: 15px; @@ -294,3 +302,17 @@ footer { .image-item.loaded .thumbnail { transform: scale(1.05); } + +.qr-code { + max-width: 300px; + display: block; + margin: auto; +} + +.card { + margin-bottom: 20px; +} + +.locked { background-color:#eee; } + +.unlocked { background-color: #fff3cd; } \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 5789a34..c212de4 100644 --- a/templates/base.html +++ b/templates/base.html @@ -7,52 +7,39 @@
+
+
-
-
+
+