add reposts/quotes

fix #2
This commit is contained in:
trisua 2025-04-10 18:16:52 -04:00
parent 15e24b9a61
commit df32b9d65e
43 changed files with 708 additions and 234 deletions

View file

@ -42,7 +42,11 @@
<div class="card flex flex-col gap-4">
<!-- prettier-ignore -->
{% for post in pinned %}
{{ components::post(post=post[0], owner=post[1], secondary=true, show_community=false, can_manage_post=can_manage_posts) }}
{% if post[0].context.repost and post[0].context.repost.reposting %}
{{ components::repost(repost=post[2], post=post[0], owner=post[1], secondary=true, show_community=false, can_manage_post=can_manage_posts) }}
{% else %}
{{ components::post(post=post[0], owner=post[1], secondary=true, show_community=false, can_manage_post=can_manage_posts) }}
{% endif %}
{% endfor %}
</div>
</div>
@ -57,7 +61,11 @@
<div class="card flex flex-col gap-4">
<!-- prettier-ignore -->
{% for post in feed %}
{{ components::post(post=post[0], owner=post[1], secondary=true, show_community=false, can_manage_post=can_manage_posts) }}
{% if post[0].context.repost and post[0].context.repost.reposting %}
{{ components::repost(repost=post[2], post=post[0], owner=post[1], secondary=true, show_community=false, can_manage_post=can_manage_posts) }}
{% else %}
{{ components::post(post=post[0], owner=post[1], secondary=true, show_community=false, can_manage_post=can_manage_posts) }}
{% endif %}
{% endfor %}
{{ components::pagination(page=page, items=feed|length) }}

View file

@ -7,9 +7,18 @@
{{ icon "arrow-up" }}
<span>{{ text "communities:action.continue_thread" }}</span>
</a>
{% endif %} {{ components::post(post=post, owner=owner, community=community,
show_community=true, can_manage_post=can_manage_posts) }} {% if user and
post.context.comments_enabled %}
{% 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, 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>
@ -116,6 +125,11 @@
"{{ post.context.comments_enabled }}",
"checkbox",
],
[
["reposts_enabled", "Allow people to repost your post"],
"{{ post.context.reposts_enabled }}",
"checkbox",
],
[
["is_nsfw", "Mark as NSFW"],
"{{ community.context.is_nsfw }}",

View file

@ -396,10 +396,15 @@
}, 250);
</script>
<!-- prettier-ignore -->
<script type="application/json" id="settings_json">{{ community_context_serde|safe }}</script>
<script>
setTimeout(() => {
const ui = ns("ui");
const settings = JSON.parse("{{ community_context_serde|safe }}");
const settings = JSON.parse(
document.getElementById("settings_json").innerHTML,
);
globalThis.upload_avatar = (e) => {
e.preventDefault();