mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 17:57:04 +08:00
Add alert if nicknames display name driver not enabled
This commit is contained in:
parent
ffbb37e956
commit
54f7a41c49
|
@ -1,6 +1,20 @@
|
||||||
|
import Alert from 'flarum/common/components/Alert';
|
||||||
|
import Link from 'flarum/common/components/Link';
|
||||||
|
|
||||||
app.initializers.add('flarum/nicknames', () => {
|
app.initializers.add('flarum/nicknames', () => {
|
||||||
app.extensionData
|
app.extensionData
|
||||||
.for('flarum-nicknames')
|
.for('flarum-nicknames')
|
||||||
|
.registerSetting(function () {
|
||||||
|
if (app.data.settings.display_name_driver === 'nickname') return;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="Form-group">
|
||||||
|
<Alert dismissible={false}>
|
||||||
|
{app.translator.trans('flarum-nicknames.admin.wrong_driver', {a: <Link href={app.route('basics')}></Link>})}
|
||||||
|
</Alert>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})
|
||||||
.registerSetting({
|
.registerSetting({
|
||||||
setting: 'flarum-nicknames.unique',
|
setting: 'flarum-nicknames.unique',
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user