From 98b7e33288818b2f5d6b95af0b556cc6b7b2c120 Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Fri, 15 Mar 2024 23:00:54 -0400 Subject: [PATCH] fix editing note in config admin page --- relay/frontend/functions.haml | 6 +++--- relay/frontend/page/admin-config.haml | 6 +++--- relay/frontend/static/config.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/relay/frontend/functions.haml b/relay/frontend/functions.haml index 68fbd2c..fe44db6 100644 --- a/relay/frontend/functions.haml +++ b/relay/frontend/functions.haml @@ -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() diff --git a/relay/frontend/page/admin-config.haml b/relay/frontend/page/admin-config.haml index 6519c0e..e5df986 100644 --- a/relay/frontend/page/admin-config.haml +++ b/relay/frontend/page/admin-config.haml @@ -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) diff --git a/relay/frontend/static/config.js b/relay/frontend/static/config.js index edb63f5..3a13104 100644 --- a/relay/frontend/static/config.js +++ b/relay/frontend/static/config.js @@ -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"),