mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: show correct message when creating topics is disabled by a tag (#30328)
This commit is contained in:
@@ -12,10 +12,7 @@
|
||||
</:button>
|
||||
<:tooltip>
|
||||
{{#if @disabled}}
|
||||
<DTooltip
|
||||
@icon="circle-info"
|
||||
@content={{i18n "topic.create_disabled_category"}}
|
||||
/>
|
||||
<DTooltip @icon="circle-info" @content={{i18n this.disallowedReason}} />
|
||||
{{/if}}
|
||||
</:tooltip>
|
||||
</DButtonTooltip>
|
||||
|
||||
@@ -5,4 +5,12 @@ import { tagName } from "@ember-decorators/component";
|
||||
export default class CreateTopicButton extends Component {
|
||||
label = "topic.create";
|
||||
btnClass = "btn-default";
|
||||
|
||||
get disallowedReason() {
|
||||
if (this.canCreateTopicOnTag === false) {
|
||||
return "topic.create_disabled_tag";
|
||||
} else if (this.disabled) {
|
||||
return "topic.create_disabled_category";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user