diff options
author | citrons <citrons> | 2021-08-06 01:35:37 +0000 |
---|---|---|
committer | citrons <citrons> | 2021-08-06 01:35:37 +0000 |
commit | 52c63cddb3f7860862af6a2185a728baf7593cc7 (patch) | |
tree | 62e02c148d4581bd9da522cec710e173e59c7ff7 /apioforum/templates | |
parent | 6d7246a9496015a00538c00689d43fad241fbcca (diff) |
fix roles even more; forum creation and configuration
Diffstat (limited to 'apioforum/templates')
-rw-r--r-- | apioforum/templates/common.html | 4 | ||||
-rw-r--r-- | apioforum/templates/edit_forum.html | 27 | ||||
-rw-r--r-- | apioforum/templates/role_assignment.html | 2 | ||||
-rw-r--r-- | apioforum/templates/view_forum.html | 20 | ||||
-rw-r--r-- | apioforum/templates/view_unlisted.html | 24 |
5 files changed, 72 insertions, 5 deletions
diff --git a/apioforum/templates/common.html b/apioforum/templates/common.html index 9e60e81..7144667 100644 --- a/apioforum/templates/common.html +++ b/apioforum/templates/common.html @@ -67,6 +67,10 @@ <span class="tag" style="color: {{the_tag.text_colour}}; background-color: {{the_tag.bg_colour}}">{{the_tag.name}}</span> {%- endmacro %} +{% macro ab(name,href) -%} +<a class="actionbutton" href="{{href}}">{{name}}</a> +{%- endmacro %} + {% macro breadcrumb() %} <nav aria-label="Breadcrumb"> <ol class="breadcrumbs"> diff --git a/apioforum/templates/edit_forum.html b/apioforum/templates/edit_forum.html new file mode 100644 index 0000000..c8027e7 --- /dev/null +++ b/apioforum/templates/edit_forum.html @@ -0,0 +1,27 @@ +{% extends 'base.html' %} +{% block header %} +<h1>{% block title %}{%if create %}create{% else %}edit{%endif%} forum{% endblock %}</h1> +{% endblock %} + +{% block content %} +<form method="POST"> + <label for="name">forum name</label> + <input name="name" id="name" value="{{name}}" placeholder="apioforum" required maxlength="100"/> + <br> + <label for="description">forum description (markdown enabled)</label> + <textarea + name="description" + id="description" + class="forum-desc-box" + placeholder="this is a forum for discussing bees" + maxlength="6000" + required + >{{description}}</textarea> + <input type="checkbox" id="unlisted" name="unlisted"/> + <label for="unlisted">unlisted?</label> + <p> + <input type="submit" value="confirm"> + <a href="{{cancel_link}}">cancel</a> + </p> +</form> +{% endblock %} diff --git a/apioforum/templates/role_assignment.html b/apioforum/templates/role_assignment.html index b212606..74dc3cd 100644 --- a/apioforum/templates/role_assignment.html +++ b/apioforum/templates/role_assignment.html @@ -29,7 +29,7 @@ {% if can_change %} <label for="role">assigned role: </label> <select name="role" id="role" autocomplete="off"> - <option value="">(no assigned role)</option> + <option value="" {% if not assigned_role %}selected{% endif %}>(no assigned role)</option> {% for role in forum_roles %} <option value="{{role}}" {% if role == assigned_role %}selected{% endif %}> diff --git a/apioforum/templates/view_forum.html b/apioforum/templates/view_forum.html index a3563be..863f91c 100644 --- a/apioforum/templates/view_forum.html +++ b/apioforum/templates/view_forum.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} -{% from 'common.html' import ts, tag, disp_user, post_url, forum_breadcrumb %} +{% from 'common.html' import ts, tag, disp_user, post_url, forum_breadcrumb, ab %} {% block header %} <h1>{% block title %}{{forum.name}}{% endblock %} <span class="thing-id">#{{forum.id}}</span></h1> {% if forum.id != 1 %} @@ -9,13 +9,25 @@ {%block content%} {{forum.description|md|safe}} +{% if bureaucrats|length > 0 %} + <p> + bureaucrats in this forum: + {% for b in bureaucrats %} + {{disp_user(b)}} + {% endfor %} + </p> +{% endif %} <p> {% if is_bureaucrat(forum.id, g.user) %} - <a class="actionbutton" href="{{url_for('forum.edit_roles',forum_id=forum.id)}}">role/permission settings</a> - <a class="actionbutton" href="{{url_for('forum.view_user_role',forum_id=forum.id)}}">assign roles</a> + {{ab("forum settings",url_for('forum.edit_forum',forum_id=forum.id))}} + {{ab("role/permission settings",url_for('forum.edit_roles',forum_id=forum.id))}} + {{ab("assign roles",url_for('forum.view_user_role',forum_id=forum.id))}} + {% endif %} + {% if has_permission(forum.id, g.user, "p_create_subforum") %} + {{ab("create subforum",url_for('forum.create_forum',forum_id=forum.id))}} {% endif %} {% if not is_bureaucrat(forum.id, g.user) and has_permission(forum.id, g.user, "p_approve") %} - <a class="actionbutton" href="{{url_for('forum.view_user_role',forum_id=forum.id)}}">approve users</a> + {{ab("approve users",url_for('forum.view_user_role',forum_id=forum.id))}} {% endif %} </p> {% if subforums %} diff --git a/apioforum/templates/view_unlisted.html b/apioforum/templates/view_unlisted.html new file mode 100644 index 0000000..c0fd074 --- /dev/null +++ b/apioforum/templates/view_unlisted.html @@ -0,0 +1,24 @@ +{% extends 'base.html' %} +{% from 'common.html' import forum_breadcrumb %} +{% block header %} +<h1>{% block title %}unlisted subforæ in '{{forum.name}}'{% endblock %}</h1> +{% if forum.id != 1 %} + {{ forum_breadcrumb(forum) }} +{% endif %} +{% endblock %} + +{% block content %} +<form method="POST"> + {% if unlisted %} + <ul> + {% for f in unlisted %} + <li> + <a href="{{url_for('forum.view_forum',forum_id=f.id)}}">{{f.name}}</a> + </li> + {% endfor %} + </ul> + {% else %} + <p>there are no unlisted subforæ in '{{forum.name}}'</p> + {% endif %} +</form> +{% endblock %} |