From 3e4ba42aabba2637223e69ada011f38335be3c7f Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sat, 13 Feb 2021 17:08:56 +0100 Subject: [PATCH] style settings page; add bookmark editor page --- htdocs/css/admin.css | 11 +++++++++++ htdocs/settings.html | 25 +++++++++++++++---------- htdocs/settings/bookmarks.html | 19 +++++++++++++++++++ owrx/controllers/bookmarks.py | 12 ++++++++++++ owrx/http.py | 2 ++ 5 files changed, 59 insertions(+), 10 deletions(-) create mode 100644 htdocs/settings/bookmarks.html create mode 100644 owrx/controllers/bookmarks.py diff --git a/htdocs/css/admin.css b/htdocs/css/admin.css index 103fbf8..167159e 100644 --- a/htdocs/css/admin.css +++ b/htdocs/css/admin.css @@ -43,3 +43,14 @@ h1 { max-height: 350px; max-width: 100%; } + +.settings-grid > div { + padding: 20px; +} + +.settings-grid .btn { + width: 100%; + height: 100px; + padding: 20px; + font-size: 1.2rem; +} diff --git a/htdocs/settings.html b/htdocs/settings.html index ef2f564..f06fce5 100644 --- a/htdocs/settings.html +++ b/htdocs/settings.html @@ -11,17 +11,22 @@ ${header}
-
-

Settings

+
+

Settings

- - - \ No newline at end of file diff --git a/htdocs/settings/bookmarks.html b/htdocs/settings/bookmarks.html new file mode 100644 index 0000000..1d7970c --- /dev/null +++ b/htdocs/settings/bookmarks.html @@ -0,0 +1,19 @@ + + + + OpenWebRX Settings + + + + + + + +${header} +
+
+

Bookmarks

+
+ make me pretty! +
+ \ No newline at end of file diff --git a/owrx/controllers/bookmarks.py b/owrx/controllers/bookmarks.py new file mode 100644 index 0000000..51d45cc --- /dev/null +++ b/owrx/controllers/bookmarks.py @@ -0,0 +1,12 @@ +from owrx.controllers.template import WebpageController +from owrx.controllers.admin import AuthorizationMixin + + +class BookmarksController(AuthorizationMixin, WebpageController): + def header_variables(self): + variables = super().header_variables() + variables["assets_prefix"] = "../" + return variables + + def indexAction(self): + self.serve_template("settings/bookmarks.html", **self.template_variables()) diff --git a/owrx/http.py b/owrx/http.py index d816a37..1f816fa 100644 --- a/owrx/http.py +++ b/owrx/http.py @@ -5,6 +5,7 @@ from owrx.controllers.websocket import WebSocketController from owrx.controllers.api import ApiController from owrx.controllers.metrics import MetricsController from owrx.controllers.settings import SettingsController, GeneralSettingsController, SdrSettingsController +from owrx.controllers.bookmarks import BookmarksController from owrx.controllers.session import SessionController from owrx.controllers.profile import ProfileController from owrx.controllers.imageupload import ImageUploadController @@ -108,6 +109,7 @@ class Router(object): "/settings/general", GeneralSettingsController, method="POST", options={"action": "processFormData"} ), StaticRoute("/settings/sdr", SdrSettingsController), + StaticRoute("/settings/bookmarks", BookmarksController), StaticRoute("/login", SessionController, options={"action": "loginAction"}), StaticRoute("/login", SessionController, method="POST", options={"action": "processLoginAction"}), StaticRoute("/logout", SessionController, options={"action": "logoutAction"}),