discourse/app/assets/javascripts/select-kit/addon/components/multi-select.hbs
Krzysztof Kotlarek 98fc614162
FEATURE: mandatory fields for group site setting (#26612)
Automatically add `moderators` and `admins` auto groups to specific site settings.

In the new group-based permissions systems, we just want to check the user’s groups since it more accurately reflects reality

Affected settings:
- tag_topic_allowed_groups
- create_tag_allowed_groups
- send_email_messages_allowed_groups
- personal_message_enabled_groups
- here_mention_allowed_groups
- approve_unless_allowed_groups
- approve_new_topics_unless_allowed_groups
- skip_review_media_groups
- email_in_allowed_groups
- create_topic_allowed_groups
- edit_wiki_post_allowed_groups
- edit_post_allowed_groups
- self_wiki_allowed_groups
- flag_post_allowed_groups
- post_links_allowed_groups
- embedded_media_post_allowed_groups
- profile_background_allowed_groups
- user_card_background_allowed_groups
- invite_allowed_groups
- ignore_allowed_groups
- user_api_key_allowed_groups
2024-04-18 08:53:52 +10:00

57 lines
1.7 KiB
Handlebars

{{#unless this.selectKit.isHidden}}
{{component
this.selectKit.options.headerComponent
tabindex=this.tabindex
value=this.value
selectedContent=this.selectedContent
selectKit=this.selectKit
id=(concat this.selectKit.uniqueID "-header")
}}
<SelectKit::SelectKitBody
@selectKit={{this.selectKit}}
@id={{concat this.selectKit.uniqueID "-body"}}
>
{{#unless this.selectKit.options.useHeaderFilter}}
{{component
this.selectKit.options.filterComponent
selectKit=this.selectKit
id=(concat this.selectKit.uniqueID "-filter")
}}
{{#if this.selectedContent.length}}
<div class="selected-content">
{{#each this.selectedContent as |item|}}
{{component
this.selectKit.options.selectedChoiceComponent
item=item
selectKit=this.selectKit
mandatoryValues=@mandatoryValues
}}
{{/each}}
</div>
{{/if}}
{{/unless}}
{{#each this.collections as |collection|}}
{{component
(component-for-collection collection.identifier this.selectKit)
collection=collection
selectKit=this.selectKit
value=this.value
}}
{{/each}}
{{#if this.selectKit.filter}}
{{#if (and this.selectKit.hasNoContent (not this.selectKit.isLoading))}}
<span class="no-content" role="alert">
{{i18n "select_kit.no_content"}}
</span>
{{else}}
<span class="results-count" role="alert">
{{i18n "select_kit.results_count" count=this.mainCollection.length}}
</span>
{{/if}}
{{/if}}
</SelectKit::SelectKitBody>
{{/unless}}