style settings page; add bookmark editor page

This commit is contained in:
Jakob Ketterl 2021-02-13 17:08:56 +01:00
parent cda43b5c5c
commit 3e4ba42aab
5 changed files with 59 additions and 10 deletions

View File

@ -43,3 +43,14 @@ h1 {
max-height: 350px; max-height: 350px;
max-width: 100%; max-width: 100%;
} }
.settings-grid > div {
padding: 20px;
}
.settings-grid .btn {
width: 100%;
height: 100px;
padding: 20px;
font-size: 1.2rem;
}

View File

@ -11,17 +11,22 @@
<body> <body>
${header} ${header}
<div class="container"> <div class="container">
<div class="col-12"> <div class="row">
<h1>Settings</h1> <h1 class="col-12">Settings</h1>
</div> </div>
<div class="col-12"> <div class="row settings-grid">
<a href="settings/general">General settings</a> <div class="col-4">
</div> <a class="btn btn-secondary" href="settings/general">General settings</a>
<div class="col-12"> </div>
<a href="settings/sdr">SDR device settings</a> <div class="col-4">
</div> <a class="btn btn-secondary" href="settings/sdr">SDR device settings</a>
<div class="col-12"> </div>
<a href="features">Feature report</a> <div class="col-4">
<a class="btn btn-secondary" href="settings/bookmarks">Bookmark editor</a>
</div>
<div class="col-4">
<a class="btn btn-secondary" href="features">Feature report</a>
</div>
</div> </div>
</div> </div>
</body> </body>

View File

@ -0,0 +1,19 @@
<!DOCTYPE HTML>
<html>
<head>
<title>OpenWebRX Settings</title>
<link rel="shortcut icon" type="image/x-icon" href="../static/favicon.ico" />
<link rel="stylesheet" href="../static/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="../static/css/admin.css" />
<script src="../compiled/settings.js"></script>
<meta charset="utf-8">
</head>
<body>
${header}
<div class="container">
<div class="row">
<h1 class="col-12">Bookmarks</h1>
</div>
make me pretty!
</div>
</body>

View File

@ -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())

View File

@ -5,6 +5,7 @@ from owrx.controllers.websocket import WebSocketController
from owrx.controllers.api import ApiController from owrx.controllers.api import ApiController
from owrx.controllers.metrics import MetricsController from owrx.controllers.metrics import MetricsController
from owrx.controllers.settings import SettingsController, GeneralSettingsController, SdrSettingsController from owrx.controllers.settings import SettingsController, GeneralSettingsController, SdrSettingsController
from owrx.controllers.bookmarks import BookmarksController
from owrx.controllers.session import SessionController from owrx.controllers.session import SessionController
from owrx.controllers.profile import ProfileController from owrx.controllers.profile import ProfileController
from owrx.controllers.imageupload import ImageUploadController from owrx.controllers.imageupload import ImageUploadController
@ -108,6 +109,7 @@ class Router(object):
"/settings/general", GeneralSettingsController, method="POST", options={"action": "processFormData"} "/settings/general", GeneralSettingsController, method="POST", options={"action": "processFormData"}
), ),
StaticRoute("/settings/sdr", SdrSettingsController), StaticRoute("/settings/sdr", SdrSettingsController),
StaticRoute("/settings/bookmarks", BookmarksController),
StaticRoute("/login", SessionController, options={"action": "loginAction"}), StaticRoute("/login", SessionController, options={"action": "loginAction"}),
StaticRoute("/login", SessionController, method="POST", options={"action": "processLoginAction"}), StaticRoute("/login", SessionController, method="POST", options={"action": "processLoginAction"}),
StaticRoute("/logout", SessionController, options={"action": "logoutAction"}), StaticRoute("/logout", SessionController, options={"action": "logoutAction"}),