Don't hardcode admin URL

Fixes #1219.
This commit is contained in:
Franz Liedke 2017-08-04 23:37:59 +02:00
parent 287085dc25
commit c037658675
No known key found for this signature in database
GPG Key ID: 9A0231A879B055F4
2 changed files with 4 additions and 6 deletions

View File

@ -27783,13 +27783,11 @@ System.register('flarum/components/SessionDropdown', ['flarum/helpers/avatar', '
href: app.route('settings')
}), 50);
if (user.groups().some(function (group) {
return group.id() === Group.ADMINISTRATOR_ID;
})) {
if (app.forum.attribute('adminUrl')) {
items.add('administration', LinkButton.component({
icon: 'wrench',
children: app.translator.trans('core.forum.header.admin_button'),
href: app.forum.attribute('baseUrl') + '/admin',
href: app.forum.attribute('adminUrl'),
target: '_blank',
config: function config() {}
}), 0);

View File

@ -62,12 +62,12 @@ export default class SessionDropdown extends Dropdown {
50
);
if (user.groups().some(group => group.id() === Group.ADMINISTRATOR_ID)) {
if (app.forum.attribute('adminUrl')) {
items.add('administration',
LinkButton.component({
icon: 'wrench',
children: app.translator.trans('core.forum.header.admin_button'),
href: app.forum.attribute('baseUrl') + '/admin',
href: app.forum.attribute('adminUrl'),
target: '_blank',
config: () => {}
}),