From 0a418363b0abdf2f04a7c066b90ec0a6ffc119f2 Mon Sep 17 00:00:00 2001 From: Silversthorn Date: Sat, 21 Jan 2023 12:29:08 +0100 Subject: [PATCH] Improving Display of Panel Config Pages --- app/classes/web/panel_handler.py | 2 + app/frontend/templates/panel/config_json.html | 56 +++++++++--------- .../templates/panel/panel_config.html | 57 +++++++++---------- .../panel/parts/crafty_config_list.html | 10 ++++ app/translations/en_EN.json | 3 +- 5 files changed, 68 insertions(+), 60 deletions(-) create mode 100644 app/frontend/templates/panel/parts/crafty_config_list.html diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index 6d94cab6..ef52dbe9 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -895,6 +895,7 @@ class PanelHandler(BaseHandler): exec_user["user_id"] ) + page_data["active_link"] = "panel_config" template = "panel/panel_config.html" elif page == "config_json": @@ -917,6 +918,7 @@ class PanelHandler(BaseHandler): page_data["availables_languages"].append(file.split(".")[0]) page_data["all_languages"].append(file.split(".")[0]) + page_data["active_link"] = "config_json" template = "panel/config_json.html" elif page == "add_user": diff --git a/app/frontend/templates/panel/config_json.html b/app/frontend/templates/panel/config_json.html index 67a34779..9f7e78f7 100644 --- a/app/frontend/templates/panel/config_json.html +++ b/app/frontend/templates/panel/config_json.html @@ -6,33 +6,20 @@ {% block title %}Crafty Controller - {{ translate('panelConfig', 'pageTitle', data['lang']) }}{% end %} {% block content %} - +
- {% if data['superuser'] %} - - {% end %} -
-
@@ -40,6 +27,23 @@
+ + {% if data['superuser'] %} + {% include "parts/crafty_config_list.html %} + {% end %} + + +
+
+ +
+ +
+ +
{% raw xsrf_form_html() %} @@ -63,8 +67,7 @@ - {% for lang in data['all_languages'] %} {% if lang in item[1] %} @@ -73,13 +76,10 @@ {% end %} {% end %} - +
{% elif isinstance(item[1], list) %} - + {% elif isinstance(item[1], bool) %} {% if item[1] == True %}
@@ -97,11 +97,9 @@
{% end %} {% elif isinstance(item[1], int) %} - + {% else %} - + {% end %}
{% end %} diff --git a/app/frontend/templates/panel/panel_config.html b/app/frontend/templates/panel/panel_config.html index 15f0a269..4079fc20 100644 --- a/app/frontend/templates/panel/panel_config.html +++ b/app/frontend/templates/panel/panel_config.html @@ -8,28 +8,16 @@ {% block content %}
- {% if data['superuser'] %} - - {% end %} -
-
@@ -38,6 +26,23 @@
+ + {% if data['superuser'] %} + {% include "parts/crafty_config_list.html %} + {% end %} + + +
+
+ +
+ +
+ +
@@ -45,9 +50,7 @@

{{ translate('panelConfig', 'users', data['lang']) }}

{% if data['user_data']['hints'] %} - + {% end %}
@@ -281,8 +280,7 @@

{{ translate('panelConfig', 'loginBackground', data['lang']) }}




- {% for image in data["backgrounds"] %} {% end %} @@ -290,8 +288,7 @@

{{ translate('panelConfig', 'preview', data['lang']) }}:
- +


diff --git a/app/frontend/templates/panel/parts/crafty_config_list.html b/app/frontend/templates/panel/parts/crafty_config_list.html new file mode 100644 index 00000000..1781ce85 --- /dev/null +++ b/app/frontend/templates/panel/parts/crafty_config_list.html @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/app/translations/en_EN.json b/app/translations/en_EN.json index 49271004..b92928d1 100644 --- a/app/translations/en_EN.json +++ b/app/translations/en_EN.json @@ -233,7 +233,8 @@ "loginBackground": "Login Background Image", "select": "Select", "selectImage": "Select an image", - "preview": "Preview" + "preview": "Preview", + "title": "Crafty Configuration" }, "rolesConfig": { "config": "Role Config",