From c03765867550746a4c6a3fd42f0ca98ac21fa23e Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Fri, 4 Aug 2017 23:37:59 +0200 Subject: [PATCH] Don't hardcode admin URL Fixes #1219. --- js/forum/dist/app.js | 6 ++---- js/forum/src/components/SessionDropdown.js | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/js/forum/dist/app.js b/js/forum/dist/app.js index 217f002c2..4bcdd072e 100644 --- a/js/forum/dist/app.js +++ b/js/forum/dist/app.js @@ -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); diff --git a/js/forum/src/components/SessionDropdown.js b/js/forum/src/components/SessionDropdown.js index 5d7d6d9c1..ae5792c35 100644 --- a/js/forum/src/components/SessionDropdown.js +++ b/js/forum/src/components/SessionDropdown.js @@ -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: () => {} }),