add: forges ui

TODO: forges tickets feed, posts open/closed state
This commit is contained in:
trisua 2025-06-09 16:45:36 -04:00
parent 5b1db42c51
commit a6140f7c8c
40 changed files with 1664 additions and 1270 deletions

View file

@ -896,49 +896,56 @@
\"change_banner\",
]);
const settings_fields = [
[
[\"display_name\", \"Display title\"],
\"{{ community.context.display_name }}\",
\"input\",
],
[
[\"description\", \"Description\"],
settings.description,
\"textarea\",
],
[
[\"is_nsfw\", \"Mark as NSFW\"],
\"{{ community.context.is_nsfw }}\",
\"checkbox\",
]
];
// {% if not community.is_forge -%}
settings_fields.push([
[
\"enable_questions\",
\"Allow users to ask questions in this community\",
],
\"{{ community.context.enable_questions }}\",
\"checkbox\",
]);
settings_fields.push([
[
\"enable_titles\",
\"Allow users to attach a title to their posts\",
],
\"{{ community.context.enable_titles }}\",
\"checkbox\",
]);
settings_fields.push([
[
\"require_titles\",
\"Require users to attach a title to their posts\",
],
\"{{ community.context.require_titles }}\",
\"checkbox\",
]);
// {%- endif %}
ui.generate_settings_ui(
document.getElementById(\"manage_fields\"),
[
[
[\"display_name\", \"Display title\"],
\"{{ community.context.display_name }}\",
\"input\",
],
[
[\"description\", \"Description\"],
settings.description,
\"textarea\",
],
[
[\"is_nsfw\", \"Mark as NSFW\"],
\"{{ community.context.is_nsfw }}\",
\"checkbox\",
],
[
[
\"enable_questions\",
\"Allow users to ask questions in this community\",
],
\"{{ community.context.enable_questions }}\",
\"checkbox\",
],
[
[
\"enable_titles\",
\"Allow users to attach a title to their posts\",
],
\"{{ community.context.enable_titles }}\",
\"checkbox\",
],
[
[
\"require_titles\",
\"Require users to attach a title to their posts\",
],
\"{{ community.context.require_titles }}\",
\"checkbox\",
],
],
settings_fields,
settings,
);
}, 250);"))