diff --git a/plugins/chat/assets/javascripts/discourse/controllers/create-channel.js b/plugins/chat/assets/javascripts/discourse/controllers/create-channel.js index ae2ed12f483..e7c2bf12eeb 100644 --- a/plugins/chat/assets/javascripts/discourse/controllers/create-channel.js +++ b/plugins/chat/assets/javascripts/discourse/controllers/create-channel.js @@ -5,7 +5,7 @@ import ModalFunctionality from "discourse/mixins/modal-functionality"; import { action, computed } from "@ember/object"; import { gt, notEmpty } from "@ember/object/computed"; import { inject as service } from "@ember/service"; -import { isBlank } from "@ember/utils"; +import { isBlank, isPresent } from "@ember/utils"; import { htmlSafe } from "@ember/template"; const DEFAULT_HINT = htmlSafe( @@ -39,6 +39,13 @@ export default class CreateChannelController extends Controller.extend( return !this.categorySelected || isBlank(this.name); } + @computed("categorySelected", "name") + get categoryName() { + return this.categorySelected && isPresent(this.name) + ? escapeExpression(this.name) + : null; + } + onShow() { this.set("categoryPermissionsHint", DEFAULT_HINT); } diff --git a/plugins/chat/assets/javascripts/discourse/templates/modal/create-channel.hbs b/plugins/chat/assets/javascripts/discourse/templates/modal/create-channel.hbs index 13b2ff45e29..2ed1417f4d7 100644 --- a/plugins/chat/assets/javascripts/discourse/templates/modal/create-channel.hbs +++ b/plugins/chat/assets/javascripts/discourse/templates/modal/create-channel.hbs @@ -1,45 +1,67 @@ - - +
+ + +
- {{#if this.categoryPermissionsHint}} -
- {{this.categoryPermissionsHint}} -
- {{/if}} +
+ + +
+ +
+ + + + {{#if this.categoryPermissionsHint}} +
+ {{this.categoryPermissionsHint}} +
+ {{/if}} +
{{#if this.autoJoinAvailable}} - +
+ +
{{/if}} - - - - - -
\ No newline at end of file + diff --git a/plugins/chat/assets/stylesheets/common/common.scss b/plugins/chat/assets/stylesheets/common/common.scss index 4290dda4137..0b5597e20f3 100644 --- a/plugins/chat/assets/stylesheets/common/common.scss +++ b/plugins/chat/assets/stylesheets/common/common.scss @@ -525,43 +525,6 @@ body.has-full-page-chat { margin-bottom: 0; } -.create-channel-modal { - .modal-inner-container { - width: 500px; - } - .choose-topic-results-list { - max-height: 200px; - overflow-y: scroll; - } - .select-kit.combo-box, - .create-channel-name-input, - .create-channel-description-input, - #choose-topic-title { - width: 100%; - margin-bottom: 0; - } - .category-chooser { - .select-kit-selected-name.selected-name.choice { - color: var( - --primary-high - ); // Make consistent with color of placeholder text when choosing topic - } - } - - .create-channel-hint { - font-size: 0.8em; - margin-top: 0.2em; - } - - .create-channel-label, - label[for="choose-topic-title"] { - margin: 1em 0 0.35em; - } - .chat-channel-title { - margin: 1em 0 0 0; - } -} - .chat-message-collapser, .chat-message-text { > p { diff --git a/plugins/chat/assets/stylesheets/common/create-channel-modal.scss b/plugins/chat/assets/stylesheets/common/create-channel-modal.scss new file mode 100644 index 00000000000..e2706683986 --- /dev/null +++ b/plugins/chat/assets/stylesheets/common/create-channel-modal.scss @@ -0,0 +1,44 @@ +.create-channel-modal { + .modal-inner-container { + width: 500px; + } + + .choose-topic-results-list { + max-height: 200px; + overflow-y: scroll; + } + + .select-kit.combo-box, + .create-channel-name-input, + .create-channel-description-input, + #choose-topic-title { + width: 100%; + margin-bottom: 0; + } + .category-chooser { + .select-kit-selected-name.selected-name.choice { + color: var( + --primary-high + ); // Make consistent with color of placeholder text when choosing topic + } + } + + .create-channel-hint { + font-size: var(--font-down-1); + padding-top: 0.25rem; + color: var(--secondary-low); + } + + .create-channel-control { + margin-bottom: 1rem; + } + + .auto-join-channel { + &__description { + margin: 0; + padding-top: 0.25rem; + color: var(--secondary-low); + font-size: var(--font-down-1) !important; + } + } +} diff --git a/plugins/chat/config/locales/client.en.yml b/plugins/chat/config/locales/client.en.yml index 58e3b4d7aee..6c27e8346cd 100644 --- a/plugins/chat/config/locales/client.en.yml +++ b/plugins/chat/config/locales/client.en.yml @@ -324,8 +324,8 @@ en: channel_wide_mentions_label: "Allow @all and @here mentions" channel_wide_mentions_description: "Allow users to notify all members of #%{channel} with @all or only those who are active in the moment with @here" auto_join_users_label: "Automatically add users" - auto_join_users_info: "Check hourly which users have been active in the last 3 months and, if they have access to the %{category} category, add them to this channel." - enable_auto_join_users: "Automatically add all recently active users" + auto_join_users_info: "Check hourly which users have been active in the last 3 months. Add them to this channel if they have access to the %{category} category." + auto_join_users_info_no_category: "Check hourly which users have been active in the last 3 months. Add them to this channel if they have access to the selected category." auto_join_users_warning: "Every user who isn't a member of this channel and has access to the %{category} category will join. Are you sure?" desktop_notification_level: "Desktop notifications" follow: "Join" diff --git a/plugins/chat/plugin.rb b/plugins/chat/plugin.rb index b3b5070a198..0766b82cc93 100644 --- a/plugins/chat/plugin.rb +++ b/plugins/chat/plugin.rb @@ -13,6 +13,7 @@ register_asset "stylesheets/mixins/chat-scrollbar.scss" register_asset "stylesheets/common/core-extensions.scss" register_asset "stylesheets/common/chat-emoji-picker.scss" register_asset "stylesheets/common/chat-channel-card.scss" +register_asset "stylesheets/common/create-channel-modal.scss" register_asset "stylesheets/common/dc-filter-input.scss" register_asset "stylesheets/common/common.scss" register_asset "stylesheets/common/chat-browse.scss"