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) {

View file

@ -115,7 +115,14 @@ show_community %}
>
{{ components::community_avatar(id=post.community,
community=community) }}
<b>{{ community.title }}</b>
<b>
<!-- prettier-ignore -->
{% if community.context.display_name %}
{{ community.context.display_name }}
{% else %}
{{ community.title }}
{% endif %}
</b>
{% if post.context.is_pinned %} {{ icon "pin" }} {% endif %}
</a>

View file

@ -2,12 +2,26 @@
<title>Notifications - {{ config.name }}</title>
{% endblock %} {% block body %} {{ macros::nav(selected="notifications") }}
<main class="flex flex-col gap-2">
<button onclick="trigger('me::clear_notifs')">
{{ icon "bomb" }}
<span>{{ text "notifs:action.clear" }}</span>
</button>
<div class="card-nest">
<div class="card small flex items-center justify-between gap-2">
<span class="flex items-center gap-2">
{{ icon "bell" }}
<span>{{ text "notifs:label.notifications" }}</span>
</span>
{% for notification in notifications %} {{
components::notification(notification=notification) }} {% endfor %}
<button
onclick="trigger('me::clear_notifs')"
class="small quaternary"
>
{{ icon "bomb" }}
<span>{{ text "notifs:action.clear" }}</span>
</button>
</div>
<div class="card tertiary flex flex-col gap-4">
{% for notification in notifications %} {{
components::notification(notification=notification) }} {% endfor %}
</div>
</div>
</main>
{% endblock %}