diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-09-09 01:33:51 +1000 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-09-09 01:33:51 +1000 |
| commit | eea4e42609e319b38f14bca9f31cc3327ffaf175 (patch) | |
| tree | 50eff229bcb7314e6f22837f1046a151adf3ddf7 /templates | |
| parent | 9a846d5ad5838d4db824623d9916d6b4e34c29ee (diff) | |
Add ability to create custom user/permissions groups
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/mod/config-editor.html | 9 | ||||
| -rw-r--r-- | templates/mod/user.html | 20 | ||||
| -rw-r--r-- | templates/mod/users.html | 11 |
3 files changed, 18 insertions, 22 deletions
diff --git a/templates/mod/config-editor.html b/templates/mod/config-editor.html index a43f8cf7..4f4cba93 100644 --- a/templates/mod/config-editor.html +++ b/templates/mod/config-editor.html @@ -42,10 +42,11 @@ <input name="{{ name }}" type="text" value="{{ var.value|e }}"> {% elseif var.permissions %} <select name="{{ name }}"> - <option value="{{ constant('JANITOR') }}"{% if var.value == constant('JANITOR')%} selected{% endif %}>JANITOR</option> - <option value="{{ constant('MOD') }}"{% if var.value == constant('MOD')%} selected{% endif %}>MOD</option> - <option value="{{ constant('ADMIN') }}"{% if var.value == constant('ADMIN')%} selected{% endif %}>ADMIN</option> - <option value="{{ constant('DISABLED') }}"{% if var.value == constant('DISABLED')%} selected{% endif %}>DISABLED</option> + {% for group_value, group_name in config.mod.groups %} + <option value="{{ group_value }}"{% if var.value == group_value %} selected{% endif %}> + {{ group_name }} + </option> + {% endfor %} </select> {% elseif var.type == 'integer' %} <input name="{{ name }}" type="number" value="{{ var.value|e }}"> diff --git a/templates/mod/user.html b/templates/mod/user.html index 1bb297af..89240824 100644 --- a/templates/mod/user.html +++ b/templates/mod/user.html @@ -28,21 +28,15 @@ </tr> {% if new %} <tr> - <th>{% trans 'Class' %}</th> + <th>{% trans 'Group' %}</th> <td> <ul style="padding:5px 8px;list-style:none"> - <li> - <input type="radio" name="type" id="janitor" value="{{ constant('JANITOR') }}"> - <label for="janitor">{% trans 'Janitor' %}</label> - </li> - <li> - <input type="radio" name="type" id="mod" value="{{ constant('MOD') }}" checked> - <label for="mod">{% trans 'Mod' %}</label> - </li> - <li> - <input type="radio" name="type" id="admin" value="{{ constant('Admin') }}"> - <label for="admin">{% trans 'Admin' %}</label> - </li> + {% for group_value, group_name in config.mod.groups if group_name != 'Disabled' %} + <li> + <input type="radio" name="type" id="group_{{ group_name }}" value="{{ group_value }}"> + <label for="group_{{ group_name }}">{% trans group_name %}</label> + </li> + {% endfor %} </ul> </td> </tr> diff --git a/templates/mod/users.html b/templates/mod/users.html index fbd43b32..984c48e1 100644 --- a/templates/mod/users.html +++ b/templates/mod/users.html @@ -15,9 +15,10 @@ <td><small>{{ user.id }}</small></td> <td>{{ user.username|e }}</td> <td> - {% if user.type == constant('JANITOR') %}{% trans 'Janitor' %} - {% elseif user.type == constant('MOD') %}{% trans 'Mod' %} - {% elseif user.type == constant('ADMIN') %}{% trans 'Admin' %} + {% if config.mod.groups[user.type] %} + {{ config.mod.groups[user.type] }} + {% else %} + <em>{% trans 'Unknown' %}</em> ({{ user.type }}) {% endif %} </td> <td> @@ -46,10 +47,10 @@ </td> {% endif %} <td> - {% if mod|hasPermission(config.mod.promoteusers) and user.type < constant('ADMIN') %} + {% if mod|hasPermission(config.mod.promoteusers) and user.type < constant(config.mod.groups[0:-1]|last) %} <a style="float:left;text-decoration:none" href="?/users/{{ user.id }}/promote" title="{% trans 'Promote' %}">▲</a> {% endif %} - {% if mod|hasPermission(config.mod.promoteusers) and user.type > constant('JANITOR') %} + {% if mod|hasPermission(config.mod.promoteusers) and user.type > constant(config.mod.groups|first) %} <a style="float:left;text-decoration:none" href="?/users/{{ user.id }}/demote" title="{% trans 'Demote' %}">▼</a> {% endif %} {% if mod|hasPermission(config.mod.modlog) %} |
