This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/templates/modal/move-to-topic.hbs
Joffrey JAFFEUX 0431942f3d
DEV: select-kit 2 (#7998)
This new iteration of select-kit focuses on following best principales and disallowing mutations inside select-kit components. A best effort has been made to avoid breaking changes, however if you content was a flat array, eg: ["foo", "bar"] You will need to set valueProperty=null and nameProperty=null on the component.

Also almost every component should have an `onChange` handler now to decide what to do with the updated data. **select-kit will not mutate your data by itself anymore**
2020-02-03 14:22:14 +01:00

117 lines
4.2 KiB
Handlebars

{{#d-modal-body id='choosing-topic'}}
{{#if model.isPrivateMessage}}
<div class="radios">
{{#if canSplitToPM}}
<label class="radio-label" for="move-to-new-message">
{{radio-button id='move-to-new-message' name="move-to-entity" value="new_message" selection=selection}}
<b>{{i18n 'topic.move_to_new_message.radio_label'}}</b>
</label>
{{/if}}
<label class="radio-label" for="move-to-existing-message">
{{radio-button id='move-to-existing-message' name="move-to-entity" value="existing_message" selection=selection}}
<b>{{i18n 'topic.move_to_existing_message.radio_label'}}</b>
</label>
</div>
{{#if canSplitTopic}}
{{#if newMessage}}
<p>{{{i18n 'topic.move_to_new_message.instructions' count=selectedPostsCount}}}</p>
<form>
<label>{{i18n 'topic.move_to_new_message.message_title'}}</label>
{{text-field value=topicName placeholderKey="composer.title_placeholder" elementId='split-topic-name'}}
{{#if canTagMessages}}
<label>{{i18n 'tagging.tags'}}</label>
{{tag-chooser tags=tags filterable=true}}
{{/if}}
</form>
{{/if}}
{{/if}}
{{#if existingMessage}}
<p>{{{i18n 'topic.move_to_existing_message.instructions' count=selectedPostsCount}}}</p>
<form>
{{choose-message currentTopicId=model.id selectedTopicId=selectedTopicId}}
<label>{{i18n 'topic.move_to_new_message.participants'}}</label>
{{user-selector usernames=participants class="participant-selector"}}
</form>
{{/if}}
{{else}}
<div class="radios">
{{#if canSplitTopic}}
<label class="radio-label" for="move-to-new-topic">
{{radio-button id='move-to-new-topic' name="move-to-entity" value="new_topic" selection=selection}}
<b>{{i18n 'topic.split_topic.radio_label'}}</b>
</label>
{{/if}}
<label class="radio-label" for="move-to-existing-topic">
{{radio-button id='move-to-existing-topic' name="move-to-entity" value="existing_topic" selection=selection}}
<b>{{i18n 'topic.merge_topic.radio_label'}}</b>
</label>
{{#if canSplitToPM}}
<label class="radio-label" for="move-to-new-message">
{{radio-button id='move-to-new-message' name="move-to-entity" value="new_message" selection=selection}}
<b>{{i18n 'topic.move_to_new_message.radio_label'}}</b>
</label>
{{/if}}
</div>
{{#if existingTopic}}
<p>{{{i18n 'topic.merge_topic.instructions' count=selectedPostsCount}}}</p>
<form>
{{choose-topic currentTopicId=model.id selectedTopicId=selectedTopicId}}
</form>
{{/if}}
{{#if canSplitTopic}}
{{#if newTopic}}
<p>{{{i18n 'topic.split_topic.instructions' count=selectedPostsCount}}}</p>
<form>
<label>{{i18n 'topic.split_topic.topic_name'}}</label>
{{text-field value=topicName placeholderKey="composer.title_placeholder" elementId='split-topic-name'}}
<label>{{i18n 'categories.category'}}</label>
{{category-chooser
value=categoryId
class="small"
onChange=(action (mut categoryId))
}}
{{#if canAddTags}}
<label>{{i18n 'tagging.tags'}}</label>
{{tag-chooser tags=tags filterable=true categoryId=categoryId}}
{{/if}}
</form>
{{/if}}
{{/if}}
{{#if canSplitTopic}}
{{#if newMessage}}
<p>{{{i18n 'topic.move_to_new_message.instructions' count=selectedPostsCount}}}</p>
<form>
<label>{{i18n 'topic.move_to_new_message.message_title'}}</label>
{{text-field value=topicName placeholderKey="composer.title_placeholder" elementId='split-topic-name'}}
{{#if canTagMessages}}
<label>{{i18n 'tagging.tags'}}</label>
{{tag-chooser tags=tags filterable=true}}
{{/if}}
</form>
{{/if}}
{{/if}}
{{/if}}
{{/d-modal-body}}
<div class="modal-footer">
{{#d-button class="btn-primary" disabled=buttonDisabled action=(action "performMove")}}
{{d-icon "sign-out-alt"}} {{buttonTitle}}
{{/d-button}}
</div>