2025-04-08 15:49:41 -04:00
|
|
|
{% extends "root.html" %} {% block head %}
|
2025-03-29 00:26:56 -04:00
|
|
|
<title>{{ community.context.display_name }} - {{ config.name }}</title>
|
|
|
|
{% endblock %} {% block body %} {{ macros::nav() }}
|
|
|
|
<article>
|
2025-03-31 19:31:36 -04:00
|
|
|
<div class="content_container flex flex-col gap-4">
|
|
|
|
{{ components::community_banner(id=community.id, community=community) }}
|
|
|
|
|
2025-03-29 00:26:56 -04:00
|
|
|
<div class="w-full flex gap-4 flex-collapse">
|
|
|
|
<div
|
|
|
|
class="lhs flex flex-col gap-2 sm:w-full"
|
2025-04-03 17:51:31 -04:00
|
|
|
style="width: 20rem; min-width: 20rem"
|
2025-03-29 00:26:56 -04:00
|
|
|
>
|
|
|
|
<div class="card-nest w-full">
|
|
|
|
<div class="card flex gap-2" id="community_avatar_and_name">
|
2025-03-31 19:31:36 -04:00
|
|
|
{{ components::community_avatar(id=community.id,
|
|
|
|
community=community, size="72px") }}
|
2025-03-29 00:26:56 -04:00
|
|
|
<div class="flex flex-col">
|
2025-04-02 11:39:51 -04:00
|
|
|
<div class="flex gap-2 items-center">
|
2025-04-07 16:32:09 -04:00
|
|
|
<h3
|
|
|
|
id="title"
|
|
|
|
class="title name shorter flex gap-2"
|
|
|
|
>
|
2025-04-02 11:39:51 -04:00
|
|
|
<!-- prettier-ignore -->
|
|
|
|
{% if community.context.display_name %}
|
|
|
|
{{ community.context.display_name }}
|
|
|
|
{% else %}
|
|
|
|
{{ community.title }}
|
|
|
|
{% endif %}
|
2025-04-07 16:32:09 -04:00
|
|
|
|
|
|
|
{% if community.context.is_nsfw %}
|
|
|
|
<span
|
|
|
|
title="NSFW community"
|
|
|
|
class="flex items-center"
|
|
|
|
style="color: var(--color-primary)"
|
|
|
|
>
|
|
|
|
{{ icon "square-asterisk" }}
|
|
|
|
</span>
|
|
|
|
{% endif %}
|
2025-04-02 11:39:51 -04:00
|
|
|
</h3>
|
|
|
|
|
|
|
|
{% if user %} {% if user.id != community.owner
|
|
|
|
%}
|
|
|
|
<div class="dropdown">
|
|
|
|
<button
|
|
|
|
class="camo small"
|
|
|
|
onclick="trigger('atto::hooks::dropdown', [event])"
|
|
|
|
exclude="dropdown"
|
|
|
|
>
|
|
|
|
{{ icon "ellipsis" }}
|
|
|
|
</button>
|
|
|
|
|
2025-04-03 17:42:03 -04:00
|
|
|
<div class="inner">
|
2025-04-02 11:39:51 -04:00
|
|
|
<button
|
|
|
|
class="red"
|
|
|
|
onclick="trigger('me::report', ['{{ community.id }}', 'community'])"
|
|
|
|
>
|
|
|
|
{{ icon "flag" }}
|
|
|
|
<span
|
|
|
|
>{{ text "general:action.report"
|
|
|
|
}}</span
|
|
|
|
>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %} {% endif %}
|
|
|
|
</div>
|
2025-03-29 00:26:56 -04:00
|
|
|
|
|
|
|
<span class="fade">{{ community.title }}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% if user %}
|
2025-04-03 17:51:31 -04:00
|
|
|
<div class="card flex gap-2" id="join_or_leave">
|
2025-04-01 15:03:56 -04:00
|
|
|
{% if not is_owner %} {% if not is_joined %} {% if not
|
|
|
|
is_pending %}
|
2025-03-31 15:39:49 -04:00
|
|
|
<button class="primary" onclick="join_community()">
|
2025-03-29 00:26:56 -04:00
|
|
|
{{ icon "circle-plus" }}
|
|
|
|
<span>{{ text "communities:action.join" }}</span>
|
|
|
|
</button>
|
2025-03-31 15:39:49 -04:00
|
|
|
|
|
|
|
<script>
|
|
|
|
globalThis.join_community = () => {
|
|
|
|
fetch(
|
|
|
|
"/api/v1/communities/{{ community.id }}/join",
|
|
|
|
{
|
|
|
|
method: "POST",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
.then((res) => res.json())
|
|
|
|
.then((res) => {
|
|
|
|
trigger("atto::toast", [
|
|
|
|
res.ok ? "success" : "error",
|
|
|
|
res.message,
|
|
|
|
]);
|
2025-04-01 15:03:56 -04:00
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
window.location.reload();
|
|
|
|
}, 150);
|
2025-03-31 15:39:49 -04:00
|
|
|
});
|
|
|
|
};
|
|
|
|
</script>
|
2025-03-29 00:26:56 -04:00
|
|
|
{% else %}
|
2025-04-01 15:03:56 -04:00
|
|
|
<button
|
|
|
|
class="quaternary red"
|
|
|
|
onclick="cancel_request()"
|
|
|
|
>
|
|
|
|
{{ icon "x" }}
|
|
|
|
<span
|
|
|
|
>{{ text "communities:action.cancel_request"
|
|
|
|
}}</span
|
|
|
|
>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
globalThis.cancel_request = async () => {
|
|
|
|
if (
|
|
|
|
!(await trigger("atto::confirm", [
|
|
|
|
"Are you sure you would like to do this?",
|
|
|
|
]))
|
|
|
|
) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
fetch(
|
|
|
|
"/api/v1/communities/{{ community.id }}/memberships/{{ user.id }}",
|
|
|
|
{
|
|
|
|
method: "DELETE",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
.then((res) => res.json())
|
|
|
|
.then((res) => {
|
|
|
|
trigger("atto::toast", [
|
|
|
|
res.ok ? "success" : "error",
|
|
|
|
res.message,
|
|
|
|
]);
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
window.location.reload();
|
|
|
|
}, 150);
|
|
|
|
});
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
{% endif %} {% else %}
|
2025-03-31 15:39:49 -04:00
|
|
|
<button
|
|
|
|
class="quaternary red"
|
|
|
|
onclick="leave_community()"
|
|
|
|
>
|
2025-03-29 00:26:56 -04:00
|
|
|
{{ icon "circle-minus" }}
|
|
|
|
<span>{{ text "communities:action.leave" }}</span>
|
|
|
|
</button>
|
2025-03-31 15:39:49 -04:00
|
|
|
|
|
|
|
<script>
|
|
|
|
globalThis.leave_community = async () => {
|
|
|
|
if (
|
|
|
|
!(await trigger("atto::confirm", [
|
|
|
|
"Are you sure you would like to do this?",
|
|
|
|
]))
|
|
|
|
) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
fetch(
|
|
|
|
"/api/v1/communities/{{ community.id }}/memberships/{{ user.id }}",
|
|
|
|
{
|
|
|
|
method: "DELETE",
|
|
|
|
},
|
|
|
|
)
|
|
|
|
.then((res) => res.json())
|
|
|
|
.then((res) => {
|
|
|
|
trigger("atto::toast", [
|
|
|
|
res.ok ? "success" : "error",
|
|
|
|
res.message,
|
|
|
|
]);
|
2025-04-01 15:03:56 -04:00
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
window.location.reload();
|
|
|
|
}, 150);
|
2025-03-31 15:39:49 -04:00
|
|
|
});
|
|
|
|
};
|
|
|
|
</script>
|
2025-04-03 20:05:21 -04:00
|
|
|
{% endif %} {% endif %} {% if can_manage_community or
|
|
|
|
is_manager %}
|
2025-03-31 11:45:34 -04:00
|
|
|
<a
|
|
|
|
href="/community/{{ community.title }}/manage"
|
2025-03-29 00:26:56 -04:00
|
|
|
class="button primary"
|
|
|
|
>
|
|
|
|
{{ icon "settings" }}
|
|
|
|
<span
|
|
|
|
>{{ text "communities:action.configure" }}</span
|
|
|
|
>
|
2025-03-31 11:45:34 -04:00
|
|
|
</a>
|
2025-03-29 00:26:56 -04:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card-nest flex flex-col">
|
|
|
|
<div id="bio" class="card small">
|
2025-03-29 22:27:57 -04:00
|
|
|
{{ community.context.description|markdown|safe }}
|
2025-03-29 00:26:56 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card flex flex-col gap-2">
|
|
|
|
<div class="w-full flex justify-between items-center">
|
|
|
|
<span class="notification chip">ID</span>
|
|
|
|
<button
|
|
|
|
title="Copy"
|
2025-03-31 15:39:49 -04:00
|
|
|
onclick="trigger('atto::copy_text', ['{{ community.id }}'])"
|
2025-03-29 00:26:56 -04:00
|
|
|
class="camo small"
|
|
|
|
>
|
|
|
|
{{ icon "copy" }}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="w-full flex justify-between items-center">
|
|
|
|
<span class="notification chip">Created</span>
|
|
|
|
<span class="date">{{ community.created }}</span>
|
|
|
|
</div>
|
2025-03-29 23:51:13 -04:00
|
|
|
|
2025-03-31 15:39:49 -04:00
|
|
|
<div class="w-full flex justify-between items-center">
|
|
|
|
<span class="notification chip">Members</span>
|
2025-04-03 20:05:21 -04:00
|
|
|
<a href="/community/{{ community.title }}/members"
|
|
|
|
>{{ community.member_count }}</a
|
|
|
|
>
|
2025-03-31 15:39:49 -04:00
|
|
|
</div>
|
|
|
|
|
2025-03-29 23:51:13 -04:00
|
|
|
<div class="w-full flex justify-between items-center">
|
|
|
|
<span class="notification chip">Score</span>
|
|
|
|
<div class="flex gap-2">
|
|
|
|
<b
|
|
|
|
>{{ community.likes - community.dislikes
|
|
|
|
}}</b
|
|
|
|
>
|
|
|
|
{% if user %}
|
|
|
|
<div
|
|
|
|
class="flex gap-1 reactions_box"
|
|
|
|
hook="check_reactions"
|
|
|
|
hook-arg:id="{{ community.id }}"
|
|
|
|
>
|
|
|
|
{{ components::likes(id=community.id,
|
|
|
|
asset_type="Community",
|
|
|
|
likes=community.likes,
|
|
|
|
dislikes=community.dislikes) }}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
2025-03-29 00:26:56 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2025-04-01 15:03:56 -04:00
|
|
|
<div class="rhs w-full">
|
|
|
|
{% if can_read %} {% block content %}{% endblock %} {% else %}
|
|
|
|
<div class="card-nest">
|
|
|
|
<div class="card small flex items-center gap-2">
|
|
|
|
{{ icon "frown" }}
|
|
|
|
<b
|
|
|
|
>{{ text "communities:label.not_allowed_to_read"
|
|
|
|
}}</b
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card">
|
|
|
|
<span>
|
|
|
|
{{ text "communities:label.might_need_to_join" }}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2025-03-29 00:26:56 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
{% endblock %}
|