add: community member list

This commit is contained in:
trisua 2025-04-03 20:05:21 -04:00
parent 1a2efdba1f
commit ca0c4b9e0b
12 changed files with 264 additions and 16 deletions

View file

@ -165,7 +165,8 @@
});
};
</script>
{% endif %} {% endif %} {% if is_owner or is_manager %}
{% endif %} {% endif %} {% if can_manage_community or
is_manager %}
<a
href="/community/{{ community.title }}/manage"
class="button primary"
@ -204,7 +205,9 @@
<div class="w-full flex justify-between items-center">
<span class="notification chip">Members</span>
<span>{{ community.member_count }}</span>
<a href="/community/{{ community.title }}/members"
>{{ community.member_count }}</a
>
</div>
<div class="w-full flex justify-between items-center">

View file

@ -0,0 +1,38 @@
{% import "macros.html" as macros %} {% import "components.html" as components
%} {% extends "communities/base.html" %} {% block content %}
<div class="flex flex-col gap-4 w-full">
<div class="card-nest">
<div class="card small flex gap-2 items-center">
{{ icon "users-round" }}
<span>{{ text "communities:tab.members" }}</span>
</div>
<div class="card flex flex-col gap-4">
<!-- prettier-ignore -->
{% for item in list %}
<div class="card-nest">
<div class="card small flex items-center gap-2 justify-between">
<span>
Since
<span class="date">{{ item[0].created }}</span>
</span>
{% if can_manage_roles %}
<a
href="/community/{{ community.title }}/manage?uid={{ item[1].id }}#/members"
class="button small quaternary"
>
{{ icon "pencil" }}
<span>{{ text "general:action.manage" }}</span>
</a>
{% endif %}
</div>
{{ components::user_card(user=item[1]) }}
</div>
{% endfor %} {{ components::pagination(page=page, items=list|length)
}}
</div>
</div>
</div>
{% endblock %}

View file

@ -335,6 +335,7 @@
BANNED: 1 << 5,
REQUESTED: 1 << 6,
MANAGE_PINS: 1 << 7,
MANAGE_COMMUNITY: 1 << 8,
};
function all_matching_permissions(role) {