add accordion macro, new user list view
This commit is contained in:
@ -1,10 +1,59 @@
|
||||
{% from "common/macros.html" import timestamp, accordion %}
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="darkbg settings-container">
|
||||
<ul>
|
||||
{% for user in users %}
|
||||
<li><a href="{{url_for("users.page", username=user['username'])}}">{{user['username']}}</a>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div class="darkbg inbox-container">
|
||||
{% set guests = (users | selectattr('permission', 'eq', PermissionLevel.GUEST.value) | list) %}
|
||||
{% set not_guests = (users | selectattr('permission', 'gt', PermissionLevel.GUEST.value) | list) %}
|
||||
{% call(section) accordion(disabled=(guests | count==0)) %}
|
||||
{% if section == "header" %}
|
||||
<span>Unconfirmed guests</span>
|
||||
{% elif section == "content" %}
|
||||
<table class="users-table">
|
||||
<thead>
|
||||
<th>Username</th>
|
||||
<th class="small">Signed up on</th>
|
||||
</thead>
|
||||
{% for user in guests %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{url_for("users.page", username=user['username'])}}">{{user['username']}}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ timestamp(user.created_at) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
|
||||
{% call(section) accordion() %}
|
||||
{% if section == "header" %}
|
||||
<span>Other users</span>
|
||||
{% elif section == "content" %}
|
||||
<table class="users-table">
|
||||
<thead>
|
||||
<th>Username</th>
|
||||
<th class="small">Permission</th>
|
||||
<th class="small">Signed up on</th>
|
||||
</thead>
|
||||
{% for user in not_guests %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{url_for("users.page", username=user['username'])}}">{{user['username']}}
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ user.permission | permission_string }}
|
||||
</td>
|
||||
<td>
|
||||
{{ timestamp(user.created_at) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user