diff options
author | citrons <citrons> | 2021-06-29 19:53:24 +0000 |
---|---|---|
committer | citrons <citrons> | 2021-06-29 19:53:24 +0000 |
commit | eb340b12ae9844d5ff2e4a927753c4d92d3f56e0 (patch) | |
tree | e9401f6fcdbee8c4bd69d93085b7a040a9058d1a /apioforum/templates | |
parent | 3a3e427695f3f6754297a2dde335358518d3373a (diff) |
role config, UI, and things
Diffstat (limited to 'apioforum/templates')
-rw-r--r-- | apioforum/templates/edit_permissions.html | 94 | ||||
-rw-r--r-- | apioforum/templates/view_forum.html | 2 |
2 files changed, 95 insertions, 1 deletions
diff --git a/apioforum/templates/edit_permissions.html b/apioforum/templates/edit_permissions.html new file mode 100644 index 0000000..a32ceda --- /dev/null +++ b/apioforum/templates/edit_permissions.html @@ -0,0 +1,94 @@ +{% extends 'base.html' %} +{% from 'common.html' import tag %} +{% block header %}<h1>{% block title %}role permissions for '{{forum.name}}'{% endblock %}</h1>{% endblock %} +{% block content %} +<p> + each user has a role in this forum. + the permissions associated with different roles can be configured here. +</p> +<p> + there are three special roles: "bureaucrat", "approved", and "other". + bureaucrats are automatically granted every permission. + everyone by default has the "other" role. + an assigned role is inherited by all subforæ unless overridden. +</p> +<p> + if a role's permissions are set to inherit, + permissions disabled for a role are disabled for that role in all subforæ. +</p> +<form method="post" id="role_config"> + +{% set show_footnote = False %} +{% for role_config in role_configs %} + <fieldset> + <legend id="config_{{role_config.role}}">{{role_config.role}}</legend> + {% macro perm(p, description, tooltip) %} + <input + type="checkbox" + id="{{role_config.role}}_{{p}}" + name="{{role_config.role}}_{{p}}" + {% if role_config[p] %}checked{% endif %} + /> + <label for="{{role_config.role}}_{{p}}" title="{{tooltip}}"> + {{- description -}} + {%- if overridden[role_config.id][p] -%} + * + {%- set show_footnote = True -%} + {%- endif -%} + </label> + <br/> + {% endmacro %} + {{perm("p_create_threads","create threads", + "allow users with the role to create a thread in the forum")}} + {{perm("p_reply_threads","reply to threads", + "allow users with the role to create a post within a thread")}} + {{perm("p_view_threads","view threads", + "allow users with the role to view threads in the forum")}} + {{perm("p_manage_threads","configure others' threads", + "allow users with the role to delete, lock, or modify the title/tags for others' threads")}} + {{perm("p_create_polls","create polls", + "allow users with the role to create poll threads")}} + {{perm("p_vote","vote", + "allow users with the role to vote on poll threads")}} + {{perm("p_create_subforum","create subforæ", + "allow users with the role to create subforæ in this forum. they will automatically become a bureaucrat in this subforum.")}} + {% if role_config.role != "other" %} + {{perm("p_approve","approve others", + "allow users with the role to assign the 'approved' role to those with the 'other' role")}} + {% endif %} + <hr/> + <input + type="checkbox" + id="{{role_config.role}}_inherit" + name="{{role_config.role}}_inherit" + {% if role_config.inherit %}checked{% endif %} + /> + <label for="{{role_config.role}}_inherit">inherit</label> + </fieldset> +{% endfor %} + +{% if show_footnote %} + <p>* disabled in inherited permissions from parent forum</p> +{% endif %} +</form> + +{% if other_roles %} + <fieldset> + <legend>roles from parent foræ</legend> + <ul> + {% for role in other_roles %} + <li>{{role}} + <form action="{{url_for('forum.add_role',forum_id=forum.id,role_name=role)}}" method="POST" style="display:inline"> + <input type="submit" value="add" /> + </form> + </li> + {% endfor %} + </ul> + </fieldset> +{% endif %} + +<p>confirm changes?</p> +<input type="submit" value="confirm" form="role_config"> +<a href="{{url_for('forum.view_forum',forum_id=forum.id)}}">cancel</a> + +{% endblock %} diff --git a/apioforum/templates/view_forum.html b/apioforum/templates/view_forum.html index fce051f..d3d09e1 100644 --- a/apioforum/templates/view_forum.html +++ b/apioforum/templates/view_forum.html @@ -14,7 +14,7 @@ {% endif %} {% if subforums %} -<h2>subforae</h2> +<h2>subforæ</h2> <div class="forum-list"> {% for subforum in subforums %} <div class="listing"> |