mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2025-12-15 02:45:09 +00:00
Settings can be loaded
This commit is contained in:
@@ -1,9 +1,4 @@
|
||||
//- Needs saved
|
||||
|
||||
mixin form-component(id, description)
|
||||
.field-row
|
||||
label.description(for=id)= description
|
||||
block(id="ten")
|
||||
//- Needs saved, settings
|
||||
|
||||
mixin fieldset(name)
|
||||
fieldset
|
||||
@@ -11,15 +6,15 @@ mixin fieldset(name)
|
||||
.fieldset-contents
|
||||
block
|
||||
|
||||
mixin input(id, description, value, disabled)
|
||||
mixin input(id, description, disabled)
|
||||
.field-row
|
||||
label.description(for=id)= description
|
||||
input(type="text" id=id name=id value=value disabled=disabled)
|
||||
input(type="text" id=id name=id value=settings[id] disabled=disabled)
|
||||
|
||||
mixin checkbox(id, description, label, checked, disabled)
|
||||
mixin checkbox(id, description, label, disabled)
|
||||
.field-row.checkbox-row
|
||||
label.description(for=id)= description
|
||||
input.checkbox(type="checkbox" id=id name=id checked=checked disabled=disabled autocomplete="off")
|
||||
input.checkbox(type="checkbox" id=id name=id checked=(settings[id] !== 0) disabled=disabled autocomplete="off")
|
||||
label.pill(for=id tabindex=(disabled ? null : 0) onkeypress=`[" ", "Enter"].includes(event.key) && this.click()`)= label
|
||||
span.fake-checkbox
|
||||
|
||||
@@ -27,7 +22,8 @@ mixin select(id, description, disabled, options)
|
||||
.field-row
|
||||
label.description(for=id)= description
|
||||
select(id=id name=id disabled=disabled)
|
||||
block
|
||||
each option in options
|
||||
option(value=option.value selected=(option.value === settings[id]))= option.text
|
||||
|
||||
doctype html
|
||||
html
|
||||
@@ -44,24 +40,28 @@ html
|
||||
h1 Settings
|
||||
|
||||
+fieldset("Features")
|
||||
+select("language", "Language", true)
|
||||
option English (International)
|
||||
+select("language", "Language", true, [
|
||||
{value: "en", text: "English (International)"},
|
||||
{value: "en-us", text: "English (US)"}
|
||||
])
|
||||
|
||||
+checkbox("show_comments", "Display comments", "Display", false, true)
|
||||
+checkbox("show_comments", "Display comments", "Display", true)
|
||||
|
||||
+checkbox("link_hashtags", "Clickable hashtags", "Clickable", false, true)
|
||||
+checkbox("link_hashtags", "Clickable hashtags", "Clickable", true)
|
||||
|
||||
+checkbox("spa", "Fast navigation", "Enabled", true, true)
|
||||
+checkbox("spa", "Fast navigation", "Enabled", true)
|
||||
|
||||
+fieldset("Appearance")
|
||||
+select("theme", "Theme", true)
|
||||
option Classic
|
||||
+select("theme", "Theme", true, [
|
||||
{value: "classic", text: "Classic"}
|
||||
])
|
||||
|
||||
+select("caption_side", "Caption side", true)
|
||||
option Left (Bibliogram)
|
||||
option Right (Instagram)
|
||||
+select("caption_side", "Caption side", true, [
|
||||
{value: "left", text: "Left (Bibliogram)"},
|
||||
{value: "right", text: "Right (Instagram)"}
|
||||
])
|
||||
|
||||
+checkbox("display_alt", "Display alt text inline", "Display", false, true)
|
||||
+checkbox("display_alt", "Display alt text inline", "Display", true)
|
||||
|
||||
//- div
|
||||
//- Here are all the possible input styles. Uncomment to test styling.
|
||||
|
||||
Reference in New Issue
Block a user