diff --git a/framework/core/js/src/forum/components/EditUserModal.js b/framework/core/js/src/forum/components/EditUserModal.js
index 81b61dcc1..99f43a517 100644
--- a/framework/core/js/src/forum/components/EditUserModal.js
+++ b/framework/core/js/src/forum/components/EditUserModal.js
@@ -3,6 +3,7 @@ import Button from '../../common/components/Button';
import GroupBadge from '../../common/components/GroupBadge';
import Group from '../../common/models/Group';
import extractText from '../../common/utils/extractText';
+import ItemList from '../../common/utils/ItemList';
/**
* The `EditUserModal` component displays a modal dialog with a login form.
@@ -37,80 +38,91 @@ export default class EditUserModal extends Modal {
return (
-
-
-
-
-
- {app.session.user !== this.props.user ? [
-
-
-
-
-
- {!this.isEmailConfirmed() ? (
-
- {Button.component({
- className: 'Button Button--block',
- children: app.translator.trans('core.forum.edit_user.activate_button'),
- loading: this.loading,
- onclick: this.activate.bind(this)
- })}
-
- ) : ''}
-
,
-
-
- ] : ''}
-
-
-
-
- {Object.keys(this.groups)
- .map(id => app.store.getById('groups', id))
- .map(group => (
-
- ))}
-
-
-
-
- {Button.component({
- className: 'Button Button--primary',
- type: 'submit',
- loading: this.loading,
- children: app.translator.trans('core.forum.edit_user.submit_button')
- })}
-
+ {this.fields().toArray()}
);
}
+ fields() {
+ const items = new ItemList();
+
+ items.add('username',
+
+
+
, 40);
+
+ if (app.session.user !== this.props.user) {
+ items.add('email',
+
+
+
+
+ {!this.isEmailConfirmed() ? (
+
+ {Button.component({
+ className: 'Button Button--block',
+ children: app.translator.trans('core.forum.edit_user.activate_button'),
+ loading: this.loading,
+ onclick: this.activate.bind(this)
+ })}
+
+ ) : ''}
+
, 30);
+
+ items.add('password', , 20);
+
+ }
+
+ items.add('groups',
+
+
+ {Object.keys(this.groups)
+ .map(id => app.store.getById('groups', id))
+ .map(group => (
+
+ ))}
+
+
, 10);
+
+ items.add('submit',
+ {Button.component({
+ className: 'Button Button--primary',
+ type: 'submit',
+ loading: this.loading,
+ children: app.translator.trans('core.forum.edit_user.submit_button')
+ })}
+
, -10);
+
+ return items;
+ }
+
activate() {
this.loading = true;
const data = {