diff options
author | citrons <citrons@mondecitronne.com> | 2025-06-14 19:03:27 -0500 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2025-06-15 12:20:07 +0100 |
commit | 754b5a09aa6fe5915cde13ebd41dc57045445990 (patch) | |
tree | 971762a42cf0b3141250048a6f03792cf6b9dc13 /apioforum/templates | |
parent | 72dd59cb0be36b19b97039b7bfe955f355ae8588 (diff) |
view existing role assignments in a forum
Diffstat (limited to 'apioforum/templates')
-rw-r--r-- | apioforum/templates/role_assignment.html | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/apioforum/templates/role_assignment.html b/apioforum/templates/role_assignment.html index 8309506..2944fe1 100644 --- a/apioforum/templates/role_assignment.html +++ b/apioforum/templates/role_assignment.html @@ -1,6 +1,6 @@ {% extends 'base.html' %} {% from 'common.html' import ab %} -{% block header %}<h1>{% block title %}configure user role in '{{forum.name}}'{% endblock %}</h1>{% endblock %} +{% block header %}<h1>{% block title %}configure user roles in '{{forum.name}}'{% endblock %}</h1>{% endblock %} {% block content %} <p> each user has a role in the forum. @@ -18,7 +18,7 @@ <form method="post" action="{{url_for('forum.view_user_role',forum_id=forum.id)}}"> <label for="user">role settings for user: </label> - <input type="text" class="name-input" id="user" name="user" value="{{user}}"/> + <input type="text" class="name-input" id="user" name="user" value="{{user}}" required/> <input type="submit" value="view"/> </form> @@ -45,12 +45,35 @@ <p>you do not have permission to change the role of this user</p> {% endif %} </form> -{% endif %} {% if can_change %}<p>confirm changes?</p>{% endif %} <p> {% if can_change %}<input type="submit" value="confirm" form="role-form">{% endif %} - <a href="{{url_for('forum.view_forum',forum_id=forum.id)}}">cancel</a> + <a href="{{url_for('forum.view_user_role',forum_id=forum.id)}}">cancel</a> </p> +{% else %} +<p><a href="{{url_for('forum.view_forum',forum_id=forum.id)}}">back</a></p> +{% if role_assignments %}<h2>assigned roles</h2>{% endif %} +<table class="role-list"> + {% for ass in role_assignments %} + {% set can_change = ass.role == "other" or is_bureaucrat(forum.id, g.user) %} + <tr> + <td>{{disp_user(ass.user)}} + <td><form method="post" action="{{url_for('forum.edit_user_role',forum_id=forum.id,username=ass.user)}}"> + <select name="role" autocomplete="off" {% if not can_change %}disabled{% endif%}> + <option value="">(no assigned role)</option> + {% for role in forum_roles %} + <option value="{{role}}" + {% if role == ass.role %}selected{% endif %}> + {{role}} + </option> + {% endfor %} + </select> + <input type="submit" value="change" {% if not can_change %}disabled{% endif%}/> + </form> + </tr> + {% endfor %} +</ul> +{% endif %} {% endblock %} |