about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/account
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-01-04 13:10:43 +0100
committerEugen Rochko <eugen@zeonfederated.com>2019-01-04 13:10:43 +0100
commit6f9a7bd02ca9efe5e798d8f4642f94ad4b5b88a2 (patch)
treea24033f96f5899bb866db1e7e222d308e194df58 /app/javascript/mastodon/features/account
parent1512af2811cb5b2ffccac5452eb291b1af46f89d (diff)
Add quick links to the admin interface in the WebUI (#8545)
* Allow to show a specific status in the admin interface

* Let the front-end know the current account is a moderator

* Add admin links to status and account menus

If the current logged-in user is an admin, add quick links to the admin
interface in account and toot dropdown menu. Suggestion by @ashkitten

* Use @statuses.first instead of @statuses[0]
Diffstat (limited to 'app/javascript/mastodon/features/account')
-rw-r--r--app/javascript/mastodon/features/account/components/action_bar.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/account/components/action_bar.js b/app/javascript/mastodon/features/account/components/action_bar.js
index e6ae1a2fd..8ed4c917a 100644
--- a/app/javascript/mastodon/features/account/components/action_bar.js
+++ b/app/javascript/mastodon/features/account/components/action_bar.js
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
 import DropdownMenuContainer from '../../../containers/dropdown_menu_container';
 import { NavLink } from 'react-router-dom';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
-import { me } from '../../../initial_state';
+import { me, isStaff  } from '../../../initial_state';
 import { shortNumberFormat } from '../../../utils/numbers';
 
 const messages = defineMessages({
@@ -35,6 +35,7 @@ const messages = defineMessages({
   endorse: { id: 'account.endorse', defaultMessage: 'Feature on profile' },
   unendorse: { id: 'account.unendorse', defaultMessage: 'Don\'t feature on profile' },
   add_or_remove_from_list: { id: 'account.add_or_remove_from_list', defaultMessage: 'Add or Remove from lists' },
+  admin_account: { id: 'status.admin_account', defaultMessage: 'Open moderation interface for @{name}' },
 });
 
 export default @injectIntl
@@ -151,6 +152,11 @@ class ActionBar extends React.PureComponent {
       }
     }
 
+    if (account.get('id') !== me && isStaff) {
+      menu.push(null);
+      menu.push({ text: intl.formatMessage(messages.admin_account, { name: account.get('username') }), href: `/admin/accounts/${account.get('id')}` });
+    }
+
     return (
       <div>
         {extraInfo}