2023-02-24 19:29:07 +00:00
{% extends "default.html" %}
2023-02-25 22:06:43 +00:00
{% block pagetitle %}!{{group}}{% endblock %}
2023-02-24 19:29:07 +00:00
{% block content %}
2024-10-16 05:08:17 +00:00
{% if v.mods_group(group) %}
< div id = "myself-in-table" class = "d-none" >
{% with user=v %}
{% include "user_in_table.html" %}
{% endwith %}
< / div >
{% endif %}
2024-02-15 19:01:52 +00:00
< div class = "mx-2" >
{% if v.id != group.owner_id %}
< button id = "leave-{{group}}" type = "button" class = "mt-4 btn btn-danger btn-block {% if v.id not in group.membership_user_ids %}d-none{% endif %}" data-nonce = "{{g.nonce}}" data-onclick = "postToastSwitch(this,'/!{{group}}/leave','leave-{{group}}','apply-{{group}}','d-none')" >
2024-03-27 14:17:24 +00:00
{%- if v.id in group.member_ids or group.name in ('verifiedrich', 'focusgroup') -%}
2024-02-15 19:01:52 +00:00
Leave
{%- else -%}
Cancel Application
{%- endif -%}
< / button >
2023-02-25 21:44:02 +00:00
2024-03-27 14:17:24 +00:00
< button id = "apply-{{group}}" type = "button" class = "mt-4 {% if v.id in group.membership_user_ids %}d-none{% endif %} btn btn-success btn-block" data-nonce = "{{g.nonce}}" data-onclick = "postToastSwitch(this,'/!{{group}}/apply','leave-{{group}}','apply-{{group}}','d-none')" > {% if group.name not in ('verifiedrich', 'focusgroup') %}Apply to {% endif %}Join< / button >
2024-02-15 19:01:52 +00:00
{% endif %}
2023-02-27 17:36:50 +00:00
2024-02-15 19:01:52 +00:00
{% if v.id == group.owner_id %}
{% include "modals/emoji.html" %}
2024-04-07 02:10:51 +00:00
< h5 class = "mt-5" > !{{group}} description< / h3 >
2024-02-15 19:01:52 +00:00
< form class = "mt-3" action = "/!{{group.name}}/description" method = "post" data-nonce = "{{g.nonce}}" data-onsubmit = "sendFormXHR(this)" >
< div class = "container pb-0" style = "background-color: transparent !important" >
< div class = "row" >
< div class = "col col-md-6 px-0 py-3 py-md-0" >
< div class = "body" >
2024-03-01 17:03:21 +00:00
< input hidden name = "formkey" value = "{{v|formkey}}" class = "notranslate" translate = "no" >
2024-02-15 19:01:52 +00:00
< input id = "edit-group-description" maxlength = "100" class = "form-control allow-emojis" type = "text" name = "description" { % if group . description % } value = "{{group.description}}" { % endif % } >
{{macros.emoji_btn('edit-group-description')}}
< div class = "footer" >
< div class = "d-flex" >
< small class = "mt-2" > Limit of 100 characters< / small >
< button type = "submit" class = "btn btn-primary ml-auto" > Submit< / button >
< / div >
2024-02-13 13:00:58 +00:00
< / div >
< / div >
< / div >
< / div >
< / div >
2024-02-15 19:01:52 +00:00
< / form >
{% elif group.description_html %}
2024-10-21 16:34:13 +00:00
< h5 class = "mt-5" > !{{group}} description< / h5 >
2024-02-15 19:01:52 +00:00
< p class = "mb-2" > {{group.description_html | safe}}< / p >
{% endif %}
2023-02-27 17:36:50 +00:00
2024-10-21 16:34:20 +00:00
< h5 class = "mt-5" > !{{group}} post mentions: < a href = "{{SITE_FULL}}/search/posts/?q=!{{group}}" > {{SITE_FULL}}/search/posts/?q=!{{group}}< / a > < / h5 >
< h5 > !{{group}} comment mentions: < a href = "{{SITE_FULL}}/search/comments/?q=!{{group}}" > {{SITE_FULL}}/search/comments/?q=!{{group}}< / a > < / h5 >
2024-02-15 19:01:52 +00:00
< br >
{% macro process_memberships(memberships, name) %}
< h5 class = "my-3" > !{{group}} {{name}}< / h5 >
2023-02-25 21:44:02 +00:00
2024-02-15 19:01:52 +00:00
< div class = "overflow-x-auto mt-1" >
< table class = "ping-groups" >
< thead >
< tr >
< th > #< / th >
< th > Name< / th >
2023-09-07 15:26:31 +00:00
2024-04-16 18:33:30 +00:00
< th class = "disable-sort-click" > < / th >
2024-04-06 01:05:21 +00:00
2023-10-29 12:51:00 +00:00
{% if name == 'members' %}
2024-02-15 19:01:52 +00:00
< th > Approved on< / th >
2024-10-16 05:08:17 +00:00
< th > Approved by< / th >
2023-10-29 12:51:00 +00:00
{% else %}
2024-02-15 19:01:52 +00:00
< th > Applied on< / th >
2023-10-29 12:51:00 +00:00
{% endif %}
2024-02-15 19:01:52 +00:00
< / tr >
< / thead >
< tbody id = "{{name}}_tbody" >
{% for membership in memberships %}
< tr id = "{{membership.user_id}}" >
< td id = "counter-{{membership.user_id}}" > {{loop.index}}< / td >
{% set is_owner = membership.user_id == group.owner_id %}
2024-04-05 11:03:00 +00:00
< td { % if ( is_owner or membership . is_mod ) and not membership . user . earlylife % } class = "unbreakable" { % endif % } >
2024-02-15 19:01:52 +00:00
{% with user=membership.user %}
{% include "user_in_table.html" %}
{% endwith %}
{% if is_owner %}
< img class = "mx-2 group-owner" data-bs-toggle = "tooltip" alt = "Owner" title = "Owner" src = "{{SITE_FULL_IMAGES}}/e/marseykingretard.webp" >
{% elif membership.is_mod %}
< img class = "mx-2 group-mod" data-bs-toggle = "tooltip" alt = "Mod" title = "Mod" src = "{{SITE_FULL_IMAGES}}/e/marseyjanny.webp" >
2023-10-29 12:51:00 +00:00
{% endif %}
2024-02-15 19:01:52 +00:00
< / td >
< td >
{% if v.mods_group(group) %}
{% if v.id == group.owner_id and v.id != membership.user_id %}
< div id = "mod-{{membership.user_id}}" class = "mb-2 {% if name == 'applications' %}d-none{% endif %}" >
< button id = "add-mod-{{membership.user_id}}" type = "button" class = "btn btn-success btn-block {% if membership.is_mod %}d-none{% endif %}" data-nonce = "{{g.nonce}}" data-onclick = "postToastSwitch(this,'/!{{group.name}}/{{membership.user_id}}/add_mod','add-mod-{{membership.user_id}}','remove-mod-{{membership.user_id}}','d-none')" > Add as Mod< / button >
< button id = "remove-mod-{{membership.user_id}}" type = "button" class = "btn btn-danger btn-block {% if not membership.is_mod %}d-none{% endif %}" data-nonce = "{{g.nonce}}" data-onclick = "postToastSwitch(this,'/!{{group.name}}/{{membership.user_id}}/remove_mod','add-mod-{{membership.user_id}}','remove-mod-{{membership.user_id}}','d-none')" > Remove as Mod< / button >
< / div >
{% endif %}
{% if v.id == membership.user_id or v.id == group.owner_id or not membership.user.mods_group(group) %}
< div id = "kick-{{membership.user_id}}" { % if name = = ' applications ' % } class = "d-none" { % endif % } >
2024-10-16 06:22:18 +00:00
{% if v.id == membership.user_id %}
< button type = "button" class = "btn btn-danger btn-block" data-nonce = "{{g.nonce}}" data-onclick = "areyousure(this)" data-areyousure = "leave_membership(this,'{{group}}')" > Leave< / button >
{% else %}
< button type = "button" class = "btn btn-danger btn-block" data-nonce = "{{g.nonce}}" data-onclick = "areyousure(this)" data-areyousure = "reject_membership(this,'{{group}}','{{membership.user_id}}')" > Kick< / button >
{% endif %}
2024-02-15 19:01:52 +00:00
< / div >
{% endif %}
2024-10-16 23:00:39 +00:00
{% if v.mods_group(group) %}
< button id = "unblacklist-{{membership.user_id}}" type = "button" class = "btn btn-success btn-block d-none" data-nonce = "{{g.nonce}}" data-onclick = "unblacklist(this,'{{group}}','{{membership.user_id}}')" > Unblacklist< / button >
{% endif %}
2024-02-15 19:01:52 +00:00
< div { % if name = = ' members ' % } class = "d-none" { % endif % } >
< button type = "button" class = "btn btn-success btn-block" data-nonce = "{{g.nonce}}" data-onclick = "approve_membership(this,'{{group}}','{{membership.user_id}}')" > Approve< / button >
< button type = "button" class = "btn btn-danger btn-block" data-nonce = "{{g.nonce}}" data-onclick = "reject_membership(this,'{{group}}','{{membership.user_id}}')" > Reject< / button >
2023-12-06 20:54:42 +00:00
< / div >
{% endif %}
2023-10-29 12:51:00 +00:00
2024-02-15 19:01:52 +00:00
{% if v.is_member_of_group(group) and is_owner and v.id != group.owner_id %}
< button type = "button" class = "btn btn-danger btn-block" data-nonce = "{{g.nonce}}" data-onclick = "areyousure(this)" data-areyousure = "postToastReload(this,'/!{{group}}/usurp')" > Usurp< / button >
{% endif %}
< / td >
2024-04-06 01:05:21 +00:00
{% if name == 'members' %}
< td id = "time-{{membership.user_id}}" data-time = "{{membership.approved_utc}}" > < / td >
2024-10-16 23:00:39 +00:00
< td id = "approver-{{membership.user_id}}" >
2024-10-16 05:08:17 +00:00
{% with user=membership.approver %}
{% include "user_in_table.html" %}
{% endwith %}
< / td >
2024-04-06 01:05:21 +00:00
{% else %}
< td id = "time-{{membership.user_id}}" data-time = "{{membership.created_utc}}" > < / td >
{% endif %}
2024-02-15 19:01:52 +00:00
< / tr >
{% endfor %}
< / tbody >
< / table >
< / div >
{% endmacro %}
2023-02-24 19:29:07 +00:00
2024-02-15 19:01:52 +00:00
{% if v.mods_group(group) %}
{{process_memberships(applications, 'applications')}}
{{process_memberships(members, 'members')}}
2024-10-16 06:15:23 +00:00
< script defer src = "{{'js/group_mod.js' | asset}}" > < / script >
2024-02-15 19:01:52 +00:00
{% else %}
{{process_memberships(members, 'members')}}
{{process_memberships(applications, 'applications')}}
{% endif %}
2024-10-16 23:00:39 +00:00
< h5 class = "my-3" > !{{group}} blacklist< / h5 >
< div class = "overflow-x-auto mt-1" >
< table class = "ping-groups" >
< thead >
< tr >
< th > #< / th >
< th > Name< / th >
{% if v.mods_group(group) %}
< th class = "disable-sort-click" > < / th >
{% endif %}
< th > Blacklisted on< / th >
< th > Blacklisted by< / th >
< th > Expires on< / th >
< / tr >
< / thead >
< tbody id = "blacklist_tbody" >
{% for blacklist in group.blacklists %}
< tr >
< td > {{loop.index}}< / td >
< td >
{% with user=blacklist.user %}
{% include "user_in_table.html" %}
{% endwith %}
< / td >
{% if v.mods_group(group) %}
< td >
< button type = "button" class = "btn btn-success btn-block" data-nonce = "{{g.nonce}}" data-onclick = "unblacklist(this,'{{group}}','{{blacklist.user_id}}')" > Unblacklist< / button >
< / td >
{% endif %}
< td data-time = "{{blacklist.created_utc}}" > < / td >
< td >
{% with user=blacklist.blacklister %}
{% include "user_in_table.html" %}
{% endwith %}
< / td >
< td data-time = "{{blacklist.created_utc+2592000}}" > < / td >
< / tr >
{% endfor %}
< / tbody >
< / table >
< / div >
2024-02-15 19:01:52 +00:00
< / div >
2023-02-24 19:29:07 +00:00
{% endblock %}