mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 06:37:25 +08:00
DEV: Consistent AdminConfigAreaEmptyList options (#29975)
Followup ccc8e37dde6dd16de1f1103d60065c1b5afcbc6e The fix above was good, but I would prefer to give the option of untranslated vs translated label like I have for other admin components for consistency.
This commit is contained in:
parent
cb819ab49a
commit
1f538a81a8
@ -1,23 +1,33 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
import DButton from "discourse/components/d-button";
|
||||
import concatClass from "discourse/helpers/concat-class";
|
||||
import { i18n } from "discourse-i18n";
|
||||
|
||||
const AdminConfigAreaEmptyList = <template>
|
||||
<div class="admin-config-area-empty-list">
|
||||
{{htmlSafe @emptyLabel}}
|
||||
export default class AdminConfigAreaEmptyList extends Component {
|
||||
get emptyLabel() {
|
||||
if (this.args.emptyLabelTranslated) {
|
||||
return this.args.emptyLabelTranslated;
|
||||
}
|
||||
|
||||
{{#if @ctaLabel}}
|
||||
<DButton
|
||||
@label={{@ctaLabel}}
|
||||
class={{concatClass
|
||||
"btn-default btn-small admin-config-area-empty-list__cta-button"
|
||||
@ctaClass
|
||||
}}
|
||||
@action={{@ctaAction}}
|
||||
@route={{@ctaRoute}}
|
||||
/>
|
||||
{{/if}}
|
||||
</div>
|
||||
</template>;
|
||||
return i18n(this.args.emptyLabel);
|
||||
}
|
||||
|
||||
export default AdminConfigAreaEmptyList;
|
||||
<template>
|
||||
<div class="admin-config-area-empty-list">
|
||||
{{htmlSafe this.emptyLabel}}
|
||||
|
||||
{{#if @ctaLabel}}
|
||||
<DButton
|
||||
@label={{@ctaLabel}}
|
||||
class={{concatClass
|
||||
"btn-default btn-small admin-config-area-empty-list__cta-button"
|
||||
@ctaClass
|
||||
}}
|
||||
@action={{@ctaAction}}
|
||||
@route={{@ctaRoute}}
|
||||
/>
|
||||
{{/if}}
|
||||
</div>
|
||||
</template>
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ export default class AdminConfigAreasEmojisList extends Component {
|
||||
@ctaLabel="admin.emoji.add"
|
||||
@ctaRoute="adminEmojis.new"
|
||||
@ctaClass="admin-emojis__add-emoji"
|
||||
@emptyLabel={{i18n "admin.emoji.no_emoji"}}
|
||||
@emptyLabel="admin.emoji.no_emoji"
|
||||
/>
|
||||
{{/if}}
|
||||
</template>
|
||||
|
@ -97,7 +97,7 @@ export default class AdminConfigAreasUserFieldsList extends Component {
|
||||
@ctaLabel="admin.user_fields.add"
|
||||
@ctaRoute="adminUserFields.new"
|
||||
@ctaClass="admin-user_fields__add-emoji"
|
||||
@emptyLabel={{i18n "admin.user_fields.no_user_fields"}}
|
||||
@emptyLabel="admin.user_fields.no_user_fields"
|
||||
/>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
@ -72,7 +72,7 @@ export default class DashboardNewFeatures extends Component {
|
||||
</AdminConfigAreaCard>
|
||||
{{else}}
|
||||
<AdminConfigAreaEmptyList
|
||||
@emptyLabel={{i18n
|
||||
@emptyLabelTranslated={{i18n
|
||||
"admin.dashboard.new_features.previous_announcements"
|
||||
url="https://meta.discourse.org/tags/c/announcements/67/release-notes"
|
||||
}}
|
||||
|
@ -127,7 +127,7 @@
|
||||
@ctaLabel="admin.permalink.add"
|
||||
@ctaRoute="adminPermalinks.new"
|
||||
@ctaClass="admin-permalinks__add-permalink"
|
||||
@emptyLabel={{i18n "admin.permalink.no_permalinks"}}
|
||||
@emptyLabel="admin.permalink.no_permalinks"
|
||||
/>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user