add: individual topic write permissions

This commit is contained in:
trisua 2025-08-04 13:23:27 -04:00
parent 3738a5cd1f
commit 8c779b2f2e
6 changed files with 80 additions and 9 deletions

View file

@ -686,12 +686,12 @@
(div
("class" "flex flex_col gap_1")
(label
("for" "description")
("for" "{{ id }}-description")
(str (text "communities:label.description")))
(input
("type" "text")
("name" "description")
("id" "description")
("id" "{{ id }}-description")
("placeholder" "description")
("value" "{{ topic.description }}")
("required" "")
@ -700,12 +700,12 @@
(div
("class" "flex flex_col gap_1")
(label
("for" "color")
("for" "{{ id }}-color")
(str (text "communities:label.color")))
(input
("type" "color")
("name" "color")
("id" "color")
("id" "{{ id }}-color")
("placeholder" "color")
("required" "")
("value" "{{ topic.color }}")
@ -713,17 +713,37 @@
(div
("class" "flex flex_col gap_1")
(label
("for" "position")
("for" "{{ id }}-position")
(str (text "communities:label.position")))
(input
("type" "number")
("name" "position")
("id" "position")
("id" "{{ id }}-position")
("placeholder" "position")
("required" "")
("value" "{{ topic.position }}")
("min" "0")
("max" "256")))
(div
("class" "flex flex_col gap_1")
(label
("for" "{{ id }}-write_access")
(text "Post permission"))
(select
("name" "write_access")
("id" "{{ id }}-write_access")
(option
("value" "Everybody")
("selected" "{% if topic.write_access == 'Everybody' -%}true{% else %}false{%- endif %}")
(text "Everybody"))
(option
("value" "Joined")
("selected" "{% if topic.write_access == 'Joined' -%}true{% else %}false{%- endif %}")
(text "Joined"))
(option
("value" "Owner")
("selected" "{% if topic.write_access == 'Owner' -%}true{% else %}false{%- endif %}")
(text "Owner only"))))
(button
(icon (text "check"))
(str (text "general:action.save")))))))
@ -794,6 +814,7 @@
description: e.target.description.value,
color: e.target.color.value,
position: Number.parseInt(e.target.position.value),
write_access: e.target.write_access.selectedOptions[0].value,
}),
})
.then((res) => res.json())