fix editing note in config admin page

This commit is contained in:
Izalia Mae 2024-03-15 23:00:54 -04:00
parent d579ec634d
commit 98b7e33288
3 changed files with 7 additions and 7 deletions

View file

@ -1,13 +1,13 @@
-macro new_checkbox(name, checked)
-if checked
%input(id="{{name}}" name="{{name}}" type="checkbox" checked)
%input(id="{{name}}" type="checkbox" checked)
-else
%input(id="{{name}}" name="{{name}}" type="checkbox")
%input(id="{{name}}" type="checkbox")
-macro new_select(name, selected, items)
%select(id="{{name}}" name="{{name}}")
%select(id="{{name}}")
-for item in items
-if item == selected
%option(value="{{item}}" selected) -> =item.title()

View file

@ -11,10 +11,10 @@
.grid-2col
%label(for="name") << Name
%input(id = "name" name="name" placeholder="Relay Name" value="{{config.name or ''}}")
%input(id = "name" placeholder="Relay Name" value="{{config.name or ''}}")
%label(for="description") << Description
%textarea(id="description" name="note" value="{{config.note or ''}}") << {{config.note}}
%label(for="note") << Description
%textarea(id="note" value="{{config.note or ''}}") << {{config.note}}
%label(for="theme") << Color Theme
=func.new_select("theme", config.theme, themes)

View file

@ -1,6 +1,6 @@
const elems = [
document.querySelector("#name"),
document.querySelector("#description"),
document.querySelector("#note"),
document.querySelector("#theme"),
document.querySelector("#log-level"),
document.querySelector("#whitelist-enabled"),