mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-25 14:48:44 +08:00
Adds an Events category type alongside Support and Ideas in the simplified category creation flow. Auto-enables Calendar + Discourse Post Event, registers the category in events_calendar_categories, and writes a matching calendar_categories entry. Gated behind enable_events_category_type_setup. The Events tab exposes: default calendar view, display weekends, allowed groups, event date format, topic sorting, and the upcoming events sidebar link. Framework support for per-category type settings: - CategoriesController#create and #update now accept category_type_settings, slicing the payload by each type's own configuration_schema_keys(:category_settings). On create the slice merges into Categories::Configure's category_configuration_values; on update the controller iterates the category's attached types and calls configure_category per type, so per-type fields persist on edit and a type only ever sees its own keys. - Categories::Types::Base#read_category_settings is a new extension point types override to return current per-category values; the CategorySerializer aggregates these as category_type_settings so the edit form preloads stored values rather than schema defaults. - Categories::Types::Base forwards :choices through the resolved schema and lets a type override site setting :type and :choices when it wants a bool to render as a labelled enum. configure_custom_fields and configure_site_settings tolerate string or symbol keys. - SchemaFormField gains enum (FormKit select) and group_list (GroupChooser) branches. EditCategoryTypeSchemaFields renders a new form section bound to a category_type_settings form object that iterates schema.category_settings, gated by a hasCategorySettings getter. tabs.js seeds the bucket from model.category_type_settings plus schema defaults; Category#_categoryTypeSaveProperties sends it on save. --------- Co-authored-by: Martin Brennan <martin@discourse.org> |
||
|---|---|---|
| .. | ||
| discourse_calendar/categories/types | ||
| discourse_post_event | ||
| discouse-calendar | ||