mirror of
https://github.com/discourse/discourse.git
synced 2024-12-04 08:33:40 +08:00
fc2259d1c8
Admin can create up to 50 custom flags. It is limited for performance reasons. When the limit is reached "Add button" is disabled and backend is protected by guardian.
36 lines
977 B
Plaintext
36 lines
977 B
Plaintext
import Component from "@glimmer/component";
|
|
import { LinkTo } from "@ember/routing";
|
|
import concatClass from "discourse/helpers/concat-class";
|
|
import dIcon from "discourse-common/helpers/d-icon";
|
|
import i18n from "discourse-common/helpers/i18n";
|
|
|
|
export default class AdminFlagItem extends Component {
|
|
get headerCssClass() {
|
|
return `admin-${this.args.name}__header`;
|
|
}
|
|
<template>
|
|
<div class={{this.headerCssClass}}>
|
|
<h2>{{i18n @heading}}</h2>
|
|
{{#if @primaryActionRoute}}
|
|
<LinkTo
|
|
@route={{@primaryActionRoute}}
|
|
class={{concatClass
|
|
"btn-primary"
|
|
"btn"
|
|
"btn-icon-text"
|
|
@primaryActionCssClass
|
|
}}
|
|
@disabled={{@primaryActionDisabled}}
|
|
>
|
|
{{dIcon @primaryActionIcon}}
|
|
{{i18n @primaryActionLabel}}
|
|
</LinkTo>
|
|
{{/if}}
|
|
|
|
{{#if @subheading}}
|
|
<h3>{{i18n @subheading}}</h3>
|
|
{{/if}}
|
|
</div>
|
|
</template>
|
|
}
|