UX: show correct message when creating topics is disabled by a tag (#30328)
This commit is contained in:
parent
8f26ae7b7d
commit
284fe89165
|
@ -12,10 +12,7 @@
|
||||||
</:button>
|
</:button>
|
||||||
<:tooltip>
|
<:tooltip>
|
||||||
{{#if @disabled}}
|
{{#if @disabled}}
|
||||||
<DTooltip
|
<DTooltip @icon="circle-info" @content={{i18n this.disallowedReason}} />
|
||||||
@icon="circle-info"
|
|
||||||
@content={{i18n "topic.create_disabled_category"}}
|
|
||||||
/>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</:tooltip>
|
</:tooltip>
|
||||||
</DButtonTooltip>
|
</DButtonTooltip>
|
||||||
|
|
|
@ -5,4 +5,12 @@ import { tagName } from "@ember-decorators/component";
|
||||||
export default class CreateTopicButton extends Component {
|
export default class CreateTopicButton extends Component {
|
||||||
label = "topic.create";
|
label = "topic.create";
|
||||||
btnClass = "btn-default";
|
btnClass = "btn-default";
|
||||||
|
|
||||||
|
get disallowedReason() {
|
||||||
|
if (this.canCreateTopicOnTag === false) {
|
||||||
|
return "topic.create_disabled_tag";
|
||||||
|
} else if (this.disabled) {
|
||||||
|
return "topic.create_disabled_category";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3275,6 +3275,7 @@ en:
|
||||||
other: "%{count} posts in topic"
|
other: "%{count} posts in topic"
|
||||||
create: "New Topic"
|
create: "New Topic"
|
||||||
create_disabled_category: "You're not allowed to create topics in this category"
|
create_disabled_category: "You're not allowed to create topics in this category"
|
||||||
|
create_disabled_tag: "You're not allowed to create topics with this tag"
|
||||||
create_long: "Create a new Topic"
|
create_long: "Create a new Topic"
|
||||||
open_draft: "Open Draft"
|
open_draft: "Open Draft"
|
||||||
private_message: "Start a message"
|
private_message: "Start a message"
|
||||||
|
|
Loading…
Reference in New Issue