Browse Source

Add the Custom role to the admin panel

The admin panel only knew types 0/1/2 plus the masqueraded "4":
Manager mapping. A Custom member would have been shown as "Manager"
with the Manager radio (value 3) preselected in the role dialog, so
saving it silently converted the member to Manager and wiped their
manage_* flags. Any remaining legacy Manager member (type 3) would
have thrown a TypeError and broken the dialog entirely.

Add a proper Custom (4) entry and radio button, and keep a Manager (3)
entry for members created through older clients.
pull/7397/head
tom27052006 2 weeks ago
parent
commit
011e5c005b
  1. 6
      src/static/scripts/admin_users.js
  2. 3
      src/static/templates/admin/users.hbs

6
src/static/scripts/admin_users.js

@ -174,10 +174,14 @@ const ORG_TYPES = {
"name": "User",
"bg": "blue"
},
"4": {
"3": {
"name": "Manager",
"bg": "green"
},
"4": {
"name": "Custom",
"bg": "teal"
},
};
// Special sort function to sort dates in ISO format

3
src/static/templates/admin/users.hbs

@ -135,6 +135,9 @@
<div class="radio">
<label><input type="radio" value="3" class="form-radio-input" name="user_type" id="userOrgTypeManager">&nbsp;Manager</label>
</div>
<div class="radio">
<label><input type="radio" value="4" class="form-radio-input" name="user_type" id="userOrgTypeCustom">&nbsp;Custom</label>
</div>
<div class="radio">
<label><input type="radio" value="1" class="form-radio-input" name="user_type" id="userOrgTypeAdmin">&nbsp;Admin</label>
</div>

Loading…
Cancel
Save