add: finish ui rewrite

This commit is contained in:
trisua 2025-06-01 12:25:33 -04:00
parent e9846016e6
commit 5dec98d698
119 changed files with 8776 additions and 9350 deletions

View file

@ -1,92 +0,0 @@
{% extends "root.html" %} {% block head %}
<title>Post quotes - {{ config.name }}</title>
{% endblock %} {% block body %} {{ macros::nav() }}
<main class="flex flex-col gap-2">
{% if post.replying_to -%}
<a href="/post/{{ post.replying_to }}" class="button">
{{ icon "arrow-up" }}
<span>{{ text "communities:action.continue_thread" }}</span>
</a>
{%- endif %}
<!-- prettier-ignore -->
<div style="display: contents;">
{% if post.context.repost and post.context.repost.reposting -%}
{{ components::repost(repost=reposting, post=post, owner=owner, community=community, show_community=true, can_manage_post=can_manage_posts) }}
{% else %}
{{ components::post(post=post, owner=owner, question=question, community=community, show_community=true, can_manage_post=can_manage_posts) }}
{%- endif %}
</div>
<div class="pillmenu">
<a href="/post/{{ post.id }}#/replies">
{{ icon "newspaper" }}
<span>{{ text "communities:label.replies" }}</span>
</a>
<a href="/post/{{ post.id }}/reposts">
{{ icon "repeat-2" }}
<span>{{ text "communities:label.reposts" }}</span>
</a>
<a href="/post/{{ post.id }}/reposts?quotes=true">
{{ icon "quote" }}
<span>{{ text "communities:label.quotes" }}</span>
</a>
</div>
{% if (user and user.id == post.owner) or can_manage_posts -%}
<div class="pillmenu">
{% if user and user.id == post.owner -%}
<a href="/post/{{ post.id }}#/edit">
{{ icon "pen" }}
<span>{{ text "communities:label.edit_content" }}</span>
</a>
{%- endif %}
<a href="/post/{{ post.id }}/likes" class="active">
{{ icon "heart" }}
<span>{{ text "communities:label.likes" }}</span>
</a>
<a href="/post/{{ post.id }}#/configure">
{{ icon "settings" }}
<span>{{ text "communities:action.configure" }}</span>
</a>
</div>
{%- endif %}
<div class="card-nest w-full">
<div class="card small flex items-center gap-2">
{{ icon "heart" }}
<span>{{ text "communities:label.likes" }}</span>
</div>
<div class="card flex flex-wrap gap-4 flex-collapse">
<!-- prettier-ignore -->
{% for tu in list %}
{% set reaction = tu[0] %}
{% set user = tu[1] %}
<div
style="display: contents"
title="{% if reaction.is_like %}Like{% else %}Dislike{% endif %}"
>
{{ components::user_plate(user=user, secondary=true) }}
</div>
{% endfor %} {{ components::pagination(page=page, items=list|length)
}}
</div>
</div>
</main>
<style>
.user_plate {
width: calc(50% - 0.5rem);
}
@media screen and (max-width: 900px) {
.user_plate {
width: 100%;
}
}
</style>
{% endblock %}

View file

@ -0,0 +1,85 @@
(text "{% extends \"root.html\" %} {% block head %}")
(title
(text "Post likes - {{ config.name }}"))
(text "{% endblock %} {% block body %} {{ macros::nav() }}")
(main
("class" "flex flex-col gap-2")
(text "{% if post.replying_to -%}")
(a
("href" "/post/{{ post.replying_to }}")
("class" "button")
(text "{{ icon \"arrow-up\" }}")
(span
(text "{{ text \"communities:action.continue_thread\" }}")))
(text "{%- endif %}")
(div
("style" "display: contents;")
(text "{% if post.context.repost and post.context.repost.reposting -%} {{ components::repost(repost=reposting, post=post, owner=owner, community=community, show_community=true, can_manage_post=can_manage_posts) }} {% else %} {{ components::post(post=post, owner=owner, question=question, community=community, show_community=true, can_manage_post=can_manage_posts) }} {%- endif %}"))
(div
("class" "pillmenu")
(a
("href" "/post/{{ post.id }}#/replies")
(text "{{ icon \"newspaper\" }}")
(span
(text "{{ text \"communities:label.replies\" }}")))
(a
("href" "/post/{{ post.id }}/reposts")
(text "{{ icon \"repeat-2\" }}")
(span
(text "{{ text \"communities:label.reposts\" }}")))
(a
("href" "/post/{{ post.id }}/reposts?quotes=true")
(text "{{ icon \"quote\" }}")
(span
(text "{{ text \"communities:label.quotes\" }}"))))
(text "{% if (user and user.id == post.owner) or can_manage_posts -%}")
(div
("class" "pillmenu")
(text "{% if user and user.id == post.owner -%}")
(a
("href" "/post/{{ post.id }}#/edit")
(text "{{ icon \"pen\" }}")
(span
(text "{{ text \"communities:label.edit_content\" }}")))
(text "{%- endif %}")
(a
("href" "/post/{{ post.id }}/likes")
("class" "active")
(text "{{ icon \"heart\" }}")
(span
(text "{{ text \"communities:label.likes\" }}")))
(a
("href" "/post/{{ post.id }}#/configure")
(text "{{ icon \"settings\" }}")
(span
(text "{{ text \"communities:action.configure\" }}"))))
(text "{%- endif %}")
(div
("class" "card-nest w-full")
(div
("class" "card small flex items-center gap-2")
(text "{{ icon \"heart\" }}")
(span
(text "{{ text \"communities:label.likes\" }}")))
(div
("class" "card flex flex-wrap gap-4 flex-collapse")
(text "{% for tu in list %} {% set reaction = tu[0] %} {% set user = tu[1] %}")
(div
("style" "display: contents")
("title" "{% if reaction.is_like %}Like{% else %}Dislike{% endif %}")
(text "{{ components::user_plate(user=user, secondary=true) }}"))
(text "{% endfor %} {{ components::pagination(page=page, items=list|length) }}"))))
(style
(text ".user_plate {
width: calc(50% - 0.5rem);
}
@media screen and (max-width: 900px) {
.user_plate {
width: 100%;
}
}"))
(text "{% endblock %}")

View file

@ -1,344 +0,0 @@
{% extends "root.html" %} {% block head %}
<title>Post - {{ config.name }}</title>
{% endblock %} {% block body %} {{ macros::nav() }}
<main class="flex flex-col gap-2">
{% if post.replying_to -%}
<a href="/post/{{ post.replying_to }}" class="button">
{{ icon "arrow-up" }}
<span>{{ text "communities:action.continue_thread" }}</span>
</a>
{%- endif %}
<!-- prettier-ignore -->
<div style="display: contents;">
{% if post.context.repost and post.context.repost.reposting -%}
{{ components::repost(repost=reposting, post=post, owner=owner, community=community, show_community=true, can_manage_post=can_manage_posts) }}
{% else %}
{{ components::post(post=post, owner=owner, question=question, community=community, show_community=true, can_manage_post=can_manage_posts) }}
{%- endif %}
</div>
{% if user and post.context.comments_enabled -%}
<div class="card-nest">
<div class="card small">
<b>{{ text "communities:label.create_reply" }}</b>
</div>
<form
class="card flex flex-col gap-2"
onsubmit="create_reply_from_form(event)"
>
<div class="flex flex-col gap-1">
<label for="content"
>{{ text "communities:label.content" }}</label
>
<textarea
type="text"
name="content"
id="content"
placeholder="content"
required
minlength="2"
maxlength="4096"
></textarea>
</div>
<div id="files_list" class="flex gap-2 flex-wrap"></div>
<div class="flex gap-2">
{{ components::emoji_picker(element_id="content",
render_dialog=true) }} {% if is_supporter -%} {{
components::file_picker(files_list_id="files_list") }} {% endif
%}
<button class="primary">
{{ text "communities:action.create" }}
</button>
</div>
</form>
</div>
{%- endif %}
<div class="pillmenu">
<a href="#/replies" data-tab-button="replies" class="active">
{{ icon "newspaper" }}
<span>{{ text "communities:label.replies" }}</span>
</a>
<a href="/post/{{ post.id }}/reposts">
{{ icon "repeat-2" }}
<span>{{ text "communities:label.reposts" }}</span>
</a>
<a href="/post/{{ post.id }}/reposts?quotes=true">
{{ icon "quote" }}
<span>{{ text "communities:label.quotes" }}</span>
</a>
</div>
{% if (user and user.id == post.owner) or can_manage_posts -%}
<div class="pillmenu">
{% if user and user.id == post.owner -%}
<a href="/post/{{ post.id }}#/edit">
{{ icon "pen" }}
<span>{{ text "communities:label.edit_content" }}</span>
</a>
{%- endif %}
<a href="/post/{{ post.id }}/likes">
{{ icon "heart" }}
<span>{{ text "communities:label.likes" }}</span>
</a>
<a href="#/configure" data-tab-button="configure">
{{ icon "settings" }}
<span>{{ text "communities:action.configure" }}</span>
</a>
</div>
{%- endif %}
<div class="flex flex-col gap-2 hidden" data-tab="configure">
<div class="card-nest w-full">
<div class="card small flex items-center gap-2">
{{ icon "settings" }}
<span>{{ text "communities:action.configure" }}</span>
</div>
<div
class="card tertiary flex flex-col gap-4"
id="post_context"
></div>
</div>
<button onclick="save_context()">
{{ icon "check" }}
<span>{{ text "general:action.save" }}</span>
</button>
<script>
setTimeout(() => {
const ui = ns("ui");
const element = document.getElementById("post_context");
const settings = JSON.parse("{{ post_context_serde|safe }}");
globalThis.save_context = () => {
fetch("/api/v1/posts/{{ post.id }}/context", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
context: settings,
}),
})
.then((res) => res.json())
.then((res) => {
trigger("atto::toast", [
res.ok ? "success" : "error",
res.message,
]);
});
};
ui.refresh_container(element, []);
const can_manage_pins = "{{ can_manage_pins }}" === "true";
const is_owner =
"{{ user and user.id == post.owner }}" === "true";
const settings_fields = [
[
[
"comments_enabled",
"Allow people to comment on your post",
],
"{{ post.context.comments_enabled }}",
"checkbox",
],
[
[
"reposts_enabled",
"Allow people to repost/quote your post",
],
"{{ post.context.reposts_enabled }}",
"checkbox",
],
[
[
"reactions_enabled",
"Allow people to like/dislike your post",
],
"{{ post.context.reactions_enabled }}",
"checkbox",
],
[
["is_nsfw", "Hide from public timelines"],
"{{ community.context.is_nsfw }}",
"checkbox",
],
[
["content_warning", "Content warning"],
settings.content_warning,
"textarea",
],
[
["tags", "Tags"],
settings.tags.join(", "),
"input",
{
embed_html:
'<span class="fade">Tags should be separated by a comma.</span>',
},
],
];
if (can_manage_pins) {
settings_fields.push([
["is_pinned", "Pinned to community wall"],
"{{ post.context.is_pinned }}",
"checkbox",
]);
}
if (is_owner) {
settings_fields.push([
["is_profile_pinned", "Pinned to your profile"],
"{{ post.context.is_profile_pinned }}",
"checkbox",
]);
}
ui.generate_settings_ui(element, settings_fields, settings, {
tags: (new_tags) => {
settings.tags = new_tags
.split(",")
.map((t) => t.trim());
},
});
}, 250);
</script>
</div>
{% if user and user.id == post.owner -%}
<div class="card-nest w-full hidden" data-tab="edit">
<div class="card small flex items-center gap-2">
{{ icon "pen" }}
<span>{{ text "communities:label.edit_content" }}</span>
</div>
<form
class="card flex flex-col gap-2"
onsubmit="edit_post_from_form(event)"
>
<div class="flex flex-col gap-1">
<label for="content"
>{{ text "communities:label.content" }}</label
>
<textarea
type="text"
name="new_content"
id="new_content"
placeholder="content"
required
minlength="2"
maxlength="4096"
>
{{ post.content }}</textarea
>
</div>
<div class="flex gap-2">
{{ components::emoji_picker(element_id="new_content",
render_dialog=false) }}
<button class="primary">
{{ text "general:action.save" }}
</button>
</div>
</form>
</div>
<script>
async function edit_post_from_form(e) {
e.preventDefault();
await trigger("atto::debounce", ["posts::edit"]);
fetch("/api/v1/posts/{{ post.id }}/content", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
content: e.target.new_content.value,
}),
})
.then((res) => res.json())
.then((res) => {
trigger("atto::toast", [
res.ok ? "success" : "error",
res.message,
]);
});
}
</script>
{%- endif %}
<div class="card-nest w-full" data-tab="replies">
<div class="card small flex items-center gap-2">
{{ icon "newspaper" }}
<span>{{ text "communities:label.replies" }}</span>
</div>
<div class="card flex flex-col gap-4">
<!-- prettier-ignore -->
{% for post in replies %}
{{ components::post(post=post[0], owner=post[1], question=post[3], secondary=true, show_community=false) }}
{% endfor %}
{{ components::pagination(page=page, items=replies|length) }}
</div>
</div>
</main>
<script>
async function create_reply_from_form(e) {
e.preventDefault();
await trigger("atto::debounce", ["posts::create"]);
// create body
const body = new FormData();
if (e.target.file_picker) {
for (const file of e.target.file_picker.files) {
body.append(file.name, file);
}
}
body.append(
"body",
JSON.stringify({
content: e.target.content.value,
community: "{{ community.id }}",
replying_to: "{{ post.id }}",
}),
);
// ...
fetch("/api/v1/posts", {
method: "POST",
body,
})
.then((res) => res.json())
.then((res) => {
trigger("atto::toast", [
res.ok ? "success" : "error",
res.message,
]);
if (res.ok) {
setTimeout(() => {
window.location.href = `/post/${res.payload}`;
}, 100);
}
});
}
</script>
{% endblock %}

View file

@ -0,0 +1,321 @@
(text "{% extends \"root.html\" %} {% block head %}")
(title
(text "Post - {{ config.name }}"))
(text "{% endblock %} {% block body %} {{ macros::nav() }}")
(main
("class" "flex flex-col gap-2")
(text "{% if post.replying_to -%}")
(a
("href" "/post/{{ post.replying_to }}")
("class" "button")
(text "{{ icon \"arrow-up\" }}")
(span
(text "{{ text \"communities:action.continue_thread\" }}")))
(text "{%- endif %}")
(div
("style" "display: contents;")
(text "{% if post.context.repost and post.context.repost.reposting -%} {{ components::repost(repost=reposting, post=post, owner=owner, community=community, show_community=true, can_manage_post=can_manage_posts) }} {% else %} {{ components::post(post=post, owner=owner, question=question, community=community, show_community=true, can_manage_post=can_manage_posts) }} {%- endif %}"))
(text "{% if user and post.context.comments_enabled -%}")
(div
("class" "card-nest")
(div
("class" "card small")
(b
(text "{{ text \"communities:label.create_reply\" }}")))
(form
("class" "card flex flex-col gap-2")
("onsubmit" "create_reply_from_form(event)")
(div
("class" "flex flex-col gap-1")
(label
("for" "content")
(text "{{ text \"communities:label.content\" }}"))
(textarea
("type" "text")
("name" "content")
("id" "content")
("placeholder" "content")
("required" "")
("minlength" "2")
("maxlength" "4096")))
(div
("id" "files_list")
("class" "flex gap-2 flex-wrap"))
(div
("class" "flex gap-2")
(text "{{ components::emoji_picker(element_id=\"content\", render_dialog=true) }} {% if is_supporter -%} {{ components::file_picker(files_list_id=\"files_list\") }} {% endif %}")
(button
("class" "primary")
(text "{{ text \"communities:action.create\" }}")))))
(text "{%- endif %}")
(div
("class" "pillmenu")
(a
("href" "#/replies")
("data-tab-button" "replies")
("class" "active")
(text "{{ icon \"newspaper\" }}")
(span
(text "{{ text \"communities:label.replies\" }}")))
(a
("href" "/post/{{ post.id }}/reposts")
(text "{{ icon \"repeat-2\" }}")
(span
(text "{{ text \"communities:label.reposts\" }}")))
(a
("href" "/post/{{ post.id }}/reposts?quotes=true")
(text "{{ icon \"quote\" }}")
(span
(text "{{ text \"communities:label.quotes\" }}"))))
(text "{% if (user and user.id == post.owner) or can_manage_posts -%}")
(div
("class" "pillmenu")
(text "{% if user and user.id == post.owner -%}")
(a
("href" "/post/{{ post.id }}#/edit")
(text "{{ icon \"pen\" }}")
(span
(text "{{ text \"communities:label.edit_content\" }}")))
(text "{%- endif %}")
(a
("href" "/post/{{ post.id }}/likes")
(text "{{ icon \"heart\" }}")
(span
(text "{{ text \"communities:label.likes\" }}")))
(a
("href" "#/configure")
("data-tab-button" "configure")
(text "{{ icon \"settings\" }}")
(span
(text "{{ text \"communities:action.configure\" }}"))))
(text "{%- endif %}")
(div
("class" "flex flex-col gap-2 hidden")
("data-tab" "configure")
(div
("class" "card-nest w-full")
(div
("class" "card small flex items-center gap-2")
(text "{{ icon \"settings\" }}")
(span
(text "{{ text \"communities:action.configure\" }}")))
(div
("class" "card tertiary flex flex-col gap-4")
("id" "post_context")))
(button
("onclick" "save_context()")
(text "{{ icon \"check\" }}")
(span
(text "{{ text \"general:action.save\" }}")))
(script
(text "setTimeout(() => {
const ui = ns(\"ui\");
const element = document.getElementById(\"post_context\");
const settings = JSON.parse(\"{{ post_context_serde|safe }}\");
globalThis.save_context = () => {
fetch(\"/api/v1/posts/{{ post.id }}/context\", {
method: \"POST\",
headers: {
\"Content-Type\": \"application/json\",
},
body: JSON.stringify({
context: settings,
}),
})
.then((res) => res.json())
.then((res) => {
trigger(\"atto::toast\", [
res.ok ? \"success\" : \"error\",
res.message,
]);
});
};
ui.refresh_container(element, []);
const can_manage_pins = \"{{ can_manage_pins }}\" === \"true\";
const is_owner =
\"{{ user and user.id == post.owner }}\" === \"true\";
const settings_fields = [
[
[
\"comments_enabled\",
\"Allow people to comment on your post\",
],
\"{{ post.context.comments_enabled }}\",
\"checkbox\",
],
[
[
\"reposts_enabled\",
\"Allow people to repost/quote your post\",
],
\"{{ post.context.reposts_enabled }}\",
\"checkbox\",
],
[
[
\"reactions_enabled\",
\"Allow people to like/dislike your post\",
],
\"{{ post.context.reactions_enabled }}\",
\"checkbox\",
],
[
[\"is_nsfw\", \"Hide from public timelines\"],
\"{{ community.context.is_nsfw }}\",
\"checkbox\",
],
[
[\"content_warning\", \"Content warning\"],
settings.content_warning,
\"textarea\",
],
[
[\"tags\", \"Tags\"],
settings.tags.join(\", \"),
\"input\",
{
embed_html:
'<span class=\"fade\">Tags should be separated by a comma.</span>',
},
],
];
if (can_manage_pins) {
settings_fields.push([
[\"is_pinned\", \"Pinned to community wall\"],
\"{{ post.context.is_pinned }}\",
\"checkbox\",
]);
}
if (is_owner) {
settings_fields.push([
[\"is_profile_pinned\", \"Pinned to your profile\"],
\"{{ post.context.is_profile_pinned }}\",
\"checkbox\",
]);
}
ui.generate_settings_ui(element, settings_fields, settings, {
tags: (new_tags) => {
settings.tags = new_tags
.split(\",\")
.map((t) => t.trim());
},
});
}, 250);")))
(text "{% if user and user.id == post.owner -%}")
(div
("class" "card-nest w-full hidden")
("data-tab" "edit")
(div
("class" "card small flex items-center gap-2")
(text "{{ icon \"pen\" }}")
(span
(text "{{ text \"communities:label.edit_content\" }}")))
(form
("class" "card flex flex-col gap-2")
("onsubmit" "edit_post_from_form(event)")
(div
("class" "flex flex-col gap-1")
(label
("for" "content")
(text "{{ text \"communities:label.content\" }}"))
(textarea
("type" "text")
("name" "new_content")
("id" "new_content")
("placeholder" "content")
("required" "")
("minlength" "2")
("maxlength" "4096")
(text "{{ post.content }}")))
(div
("class" "flex gap-2")
(text "{{ components::emoji_picker(element_id=\"new_content\", render_dialog=false) }}")
(button
("class" "primary")
(text "{{ text \"general:action.save\" }}")))))
(script
(text "async function edit_post_from_form(e) {
e.preventDefault();
await trigger(\"atto::debounce\", [\"posts::edit\"]);
fetch(\"/api/v1/posts/{{ post.id }}/content\", {
method: \"POST\",
headers: {
\"Content-Type\": \"application/json\",
},
body: JSON.stringify({
content: e.target.new_content.value,
}),
})
.then((res) => res.json())
.then((res) => {
trigger(\"atto::toast\", [
res.ok ? \"success\" : \"error\",
res.message,
]);
});
}"))
(text "{%- endif %}")
(div
("class" "card-nest w-full")
("data-tab" "replies")
(div
("class" "card small flex items-center gap-2")
(text "{{ icon \"newspaper\" }}")
(span
(text "{{ text \"communities:label.replies\" }}")))
(div
("class" "card flex flex-col gap-4")
(text "{% for post in replies %} {{ components::post(post=post[0], owner=post[1], question=post[3], secondary=true, show_community=false) }} {% endfor %} {{ components::pagination(page=page, items=replies|length) }}"))))
(script
(text "async function create_reply_from_form(e) {
e.preventDefault();
await trigger(\"atto::debounce\", [\"posts::create\"]);
// create body
const body = new FormData();
if (e.target.file_picker) {
for (const file of e.target.file_picker.files) {
body.append(file.name, file);
}
}
body.append(
\"body\",
JSON.stringify({
content: e.target.content.value,
community: \"{{ community.id }}\",
replying_to: \"{{ post.id }}\",
}),
);
// ...
fetch(\"/api/v1/posts\", {
method: \"POST\",
body,
})
.then((res) => res.json())
.then((res) => {
trigger(\"atto::toast\", [
res.ok ? \"success\" : \"error\",
res.message,
]);
if (res.ok) {
setTimeout(() => {
window.location.href = `/post/${res.payload}`;
}, 100);
}
});
}"))
(text "{% endblock %}")

View file

@ -1,74 +0,0 @@
{% extends "root.html" %} {% block head %}
<title>Post quotes - {{ config.name }}</title>
{% endblock %} {% block body %} {{ macros::nav() }}
<main class="flex flex-col gap-2">
{% if post.replying_to -%}
<a href="/post/{{ post.replying_to }}" class="button">
{{ icon "arrow-up" }}
<span>{{ text "communities:action.continue_thread" }}</span>
</a>
{%- endif %}
<!-- prettier-ignore -->
<div style="display: contents;">
{% if post.context.repost and post.context.repost.reposting -%}
{{ components::repost(repost=reposting, post=post, owner=owner, community=community, show_community=true, can_manage_post=can_manage_posts) }}
{% else %}
{{ components::post(post=post, owner=owner, question=question, community=community, show_community=true, can_manage_post=can_manage_posts) }}
{%- endif %}
</div>
<div class="pillmenu">
<a href="/post/{{ post.id }}#/replies">
{{ icon "newspaper" }}
<span>{{ text "communities:label.replies" }}</span>
</a>
<a href="/post/{{ post.id }}/reposts">
{{ icon "repeat-2" }}
<span>{{ text "communities:label.reposts" }}</span>
</a>
<a href="/post/{{ post.id }}/reposts?quotes=true" class="active">
{{ icon "quote" }}
<span>{{ text "communities:label.quotes" }}</span>
</a>
</div>
{% if (user and user.id == post.owner) or can_manage_posts -%}
<div class="pillmenu">
{% if user and user.id == post.owner -%}
<a href="/post/{{ post.id }}#/edit">
{{ icon "pen" }}
<span>{{ text "communities:label.edit_content" }}</span>
</a>
{%- endif %}
<a href="/post/{{ post.id }}/likes">
{{ icon "heart" }}
<span>{{ text "communities:label.likes" }}</span>
</a>
<a href="/post/{{ post.id }}#/configure">
{{ icon "settings" }}
<span>{{ text "communities:action.configure" }}</span>
</a>
</div>
{%- endif %}
<div class="card-nest w-full">
<div class="card small flex items-center gap-2">
{{ icon "quote" }}
<span>{{ text "communities:label.quotes" }}</span>
</div>
<div class="card flex flex-col gap-4">
<!-- prettier-ignore -->
{% for post in list %}
{{ components::post(post=post[0], owner=post[1], question=post[3], secondary=true, show_community=false) }}
{% endfor %}
{{ components::pagination(page=page, items=list|length, key="quotes", value="true") }}
</div>
</div>
</main>
{% endblock %}

View file

@ -0,0 +1,69 @@
(text "{% extends \"root.html\" %} {% block head %}")
(title
(text "Post quotes - {{ config.name }}"))
(text "{% endblock %} {% block body %} {{ macros::nav() }}")
(main
("class" "flex flex-col gap-2")
(text "{% if post.replying_to -%}")
(a
("href" "/post/{{ post.replying_to }}")
("class" "button")
(text "{{ icon \"arrow-up\" }}")
(span
(text "{{ text \"communities:action.continue_thread\" }}")))
(text "{%- endif %}")
(div
("style" "display: contents;")
(text "{% if post.context.repost and post.context.repost.reposting -%} {{ components::repost(repost=reposting, post=post, owner=owner, community=community, show_community=true, can_manage_post=can_manage_posts) }} {% else %} {{ components::post(post=post, owner=owner, question=question, community=community, show_community=true, can_manage_post=can_manage_posts) }} {%- endif %}"))
(div
("class" "pillmenu")
(a
("href" "/post/{{ post.id }}#/replies")
(text "{{ icon \"newspaper\" }}")
(span
(text "{{ text \"communities:label.replies\" }}")))
(a
("href" "/post/{{ post.id }}/reposts")
(text "{{ icon \"repeat-2\" }}")
(span
(text "{{ text \"communities:label.reposts\" }}")))
(a
("href" "/post/{{ post.id }}/reposts?quotes=true")
("class" "active")
(text "{{ icon \"quote\" }}")
(span
(text "{{ text \"communities:label.quotes\" }}"))))
(text "{% if (user and user.id == post.owner) or can_manage_posts -%}")
(div
("class" "pillmenu")
(text "{% if user and user.id == post.owner -%}")
(a
("href" "/post/{{ post.id }}#/edit")
(text "{{ icon \"pen\" }}")
(span
(text "{{ text \"communities:label.edit_content\" }}")))
(text "{%- endif %}")
(a
("href" "/post/{{ post.id }}/likes")
(text "{{ icon \"heart\" }}")
(span
(text "{{ text \"communities:label.likes\" }}")))
(a
("href" "/post/{{ post.id }}#/configure")
(text "{{ icon \"settings\" }}")
(span
(text "{{ text \"communities:action.configure\" }}"))))
(text "{%- endif %}")
(div
("class" "card-nest w-full")
(div
("class" "card small flex items-center gap-2")
(text "{{ icon \"quote\" }}")
(span
(text "{{ text \"communities:label.quotes\" }}")))
(div
("class" "card flex flex-col gap-4")
(text "{% for post in list %} {{ components::post(post=post[0], owner=post[1], question=post[3], secondary=true, show_community=false) }} {% endfor %} {{ components::pagination(page=page, items=list|length, key=\"quotes\", value=\"true\") }}"))))
(text "{% endblock %}")

View file

@ -1,93 +0,0 @@
{% extends "root.html" %} {% block head %}
<title>Post reposts - {{ config.name }}</title>
{% endblock %} {% block body %} {{ macros::nav() }}
<main class="flex flex-col gap-2">
{% if post.replying_to -%}
<a href="/post/{{ post.replying_to }}" class="button">
{{ icon "arrow-up" }}
<span>{{ text "communities:action.continue_thread" }}</span>
</a>
{%- endif %}
<!-- prettier-ignore -->
<div style="display: contents;">
{% if post.context.repost and post.context.repost.reposting -%}
{{ components::repost(repost=reposting, post=post, owner=owner, community=community, show_community=true, can_manage_post=can_manage_posts) }}
{% else %}
{{ components::post(post=post, owner=owner, question=question, community=community, show_community=true, can_manage_post=can_manage_posts) }}
{%- endif %}
</div>
<div class="pillmenu">
<a href="/post/{{ post.id }}#/replies">
{{ icon "newspaper" }}
<span>{{ text "communities:label.replies" }}</span>
</a>
<a href="/post/{{ post.id }}/reposts" class="active">
{{ icon "repeat-2" }}
<span>{{ text "communities:label.reposts" }}</span>
</a>
<a href="/post/{{ post.id }}/reposts?quotes=true">
{{ icon "quote" }}
<span>{{ text "communities:label.quotes" }}</span>
</a>
</div>
{% if (user and user.id == post.owner) or can_manage_posts -%}
<div class="pillmenu">
{% if user and user.id == post.owner -%}
<a href="/post/{{ post.id }}#/edit">
{{ icon "pen" }}
<span>{{ text "communities:label.edit_content" }}</span>
</a>
{%- endif %}
<a href="/post/{{ post.id }}/likes">
{{ icon "heart" }}
<span>{{ text "communities:label.likes" }}</span>
</a>
<a href="/post/{{ post.id }}#/configure">
{{ icon "settings" }}
<span>{{ text "communities:action.configure" }}</span>
</a>
</div>
{%- endif %}
<div class="card-nest w-full">
<div class="card small flex items-center gap-2">
{{ icon "repeat-2" }}
<span>{{ text "communities:label.reposts" }}</span>
</div>
<div class="card flex flex-col gap-4">
{% for post in list %}
<div class="card-nest">
<div class="card flex items-center gap-2">
<a href="/@{{ post[1].username }}">
{{ components::avatar(username=post[1].username,
size="24px", selector_type="username") }}
</a>
<div class="name">
{{ components::full_username(user=post[1]) }}
</div>
</div>
<div class="card flex items-center gap-2 flex-wrap secondary">
<a
href="/post/{{ post[0].id }}"
class="quaternary small button"
>
{{ icon "external-link" }}
<span>{{ text "general:action.open" }}</span>
</a>
</div>
</div>
{% endfor %} {{ components::pagination(page=page, items=list|length,
key="quotes", value="false") }}
</div>
</div>
</main>
{% endblock %}

View file

@ -0,0 +1,88 @@
(text "{% extends \"root.html\" %} {% block head %}")
(title
(text "Post reposts - {{ config.name }}"))
(text "{% endblock %} {% block body %} {{ macros::nav() }}")
(main
("class" "flex flex-col gap-2")
(text "{% if post.replying_to -%}")
(a
("href" "/post/{{ post.replying_to }}")
("class" "button")
(text "{{ icon \"arrow-up\" }}")
(span
(text "{{ text \"communities:action.continue_thread\" }}")))
(text "{%- endif %}")
(div
("style" "display: contents;")
(text "{% if post.context.repost and post.context.repost.reposting -%} {{ components::repost(repost=reposting, post=post, owner=owner, community=community, show_community=true, can_manage_post=can_manage_posts) }} {% else %} {{ components::post(post=post, owner=owner, question=question, community=community, show_community=true, can_manage_post=can_manage_posts) }} {%- endif %}"))
(div
("class" "pillmenu")
(a
("href" "/post/{{ post.id }}#/replies")
(text "{{ icon \"newspaper\" }}")
(span
(text "{{ text \"communities:label.replies\" }}")))
(a
("href" "/post/{{ post.id }}/reposts")
("class" "active")
(text "{{ icon \"repeat-2\" }}")
(span
(text "{{ text \"communities:label.reposts\" }}")))
(a
("href" "/post/{{ post.id }}/reposts?quotes=true")
(text "{{ icon \"quote\" }}")
(span
(text "{{ text \"communities:label.quotes\" }}"))))
(text "{% if (user and user.id == post.owner) or can_manage_posts -%}")
(div
("class" "pillmenu")
(text "{% if user and user.id == post.owner -%}")
(a
("href" "/post/{{ post.id }}#/edit")
(text "{{ icon \"pen\" }}")
(span
(text "{{ text \"communities:label.edit_content\" }}")))
(text "{%- endif %}")
(a
("href" "/post/{{ post.id }}/likes")
(text "{{ icon \"heart\" }}")
(span
(text "{{ text \"communities:label.likes\" }}")))
(a
("href" "/post/{{ post.id }}#/configure")
(text "{{ icon \"settings\" }}")
(span
(text "{{ text \"communities:action.configure\" }}"))))
(text "{%- endif %}")
(div
("class" "card-nest w-full")
(div
("class" "card small flex items-center gap-2")
(text "{{ icon \"repeat-2\" }}")
(span
(text "{{ text \"communities:label.reposts\" }}")))
(div
("class" "card flex flex-col gap-4")
(text "{% for post in list %}")
(div
("class" "card-nest")
(div
("class" "card flex items-center gap-2")
(a
("href" "/@{{ post[1].username }}")
(text "{{ components::avatar(username=post[1].username, size=\"24px\", selector_type=\"username\") }}"))
(div
("class" "name")
(text "{{ components::full_username(user=post[1]) }}")))
(div
("class" "card flex items-center gap-2 flex-wrap secondary")
(a
("href" "/post/{{ post[0].id }}")
("class" "quaternary small button")
(text "{{ icon \"external-link\" }}")
(span
(text "{{ text \"general:action.open\" }}")))))
(text "{% endfor %} {{ components::pagination(page=page, items=list|length, key=\"quotes\", value=\"false\") }}"))))
(text "{% endblock %}")