add: post likes page

fix: requests pkey
This commit is contained in:
trisua 2025-05-14 19:54:53 -04:00
parent bbb629336f
commit b63df2cb31
11 changed files with 274 additions and 14 deletions

View file

@ -0,0 +1,74 @@
{% 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>
<a href="/post/{{ post.id }}/likes" class="active">
{{ icon "heart" }}
<span>{{ text "communities:label.likes" }}</span>
</a>
</div>
{% if (user and user.id == post.owner) or can_manage_posts %} {% if user and
user.id == post.owner %}
<div class="pillmenu">
<a href="/post/{{ post.id }}#/edit">
{{ icon "pen" }}
<span>{{ text "communities:label.edit_content" }}</span>
</a>
{% endif %}
<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-col gap-4">
<!-- prettier-ignore -->
{% for user in list %}
{{ components::user_plate(user=user, secondary=true) }}
{% endfor %}
{{ components::pagination(page=page, items=list|length) }}
</div>
</div>
</main>
{% endblock %}

View file

@ -74,19 +74,26 @@
<span>{{ text "communities:label.quotes" }}</span>
</a>
{% if user and user.id == post.owner %}
<a href="/post/{{ post.id }}/likes">
{{ icon "heart" }}
<span>{{ text "communities:label.likes" }}</span>
</a>
</div>
{% if (user and user.id == post.owner) or can_manage_posts %} {% if user and
user.id == post.owner %}
<div class="pillmenu">
<a href="#/edit" data-tab-button="edit">
{{ icon "pen" }}
<span>{{ text "communities:label.edit_content" }}</span>
</a>
{% endif %} {% if (user and user.id == post.owner) or can_manage_posts
%}
{% endif %}
<a href="#/configure" data-tab-button="configure">
{{ icon "settings" }}
<span>{{ text "communities:action.configure" }}</span>
</a>
{% endif %}
</div>
{% endif %}
<div class="flex flex-col gap-2 hidden" data-tab="configure">
<div class="card-nest w-full">

View file

@ -34,19 +34,26 @@
<span>{{ text "communities:label.quotes" }}</span>
</a>
{% if user and user.id == post.owner %}
<a href="/post/{{ post.id }}/likes">
{{ icon "heart" }}
<span>{{ text "communities:label.likes" }}</span>
</a>
</div>
{% if (user and user.id == post.owner) or can_manage_posts %} {% if user and
user.id == post.owner %}
<div class="pillmenu">
<a href="/post/{{ post.id }}#/edit">
{{ icon "pen" }}
<span>{{ text "communities:label.edit_content" }}</span>
</a>
{% endif %} {% if (user and user.id == post.owner) or can_manage_posts
%}
{% endif %}
<a href="/post/{{ post.id }}#/configure">
{{ icon "settings" }}
<span>{{ text "communities:action.configure" }}</span>
</a>
{% endif %}
</div>
{% endif %}
<div class="card-nest w-full">
<div class="card small flex items-center gap-2">

View file

@ -34,19 +34,26 @@
<span>{{ text "communities:label.quotes" }}</span>
</a>
{% if user and user.id == post.owner %}
<a href="/post/{{ post.id }}/likes">
{{ icon "heart" }}
<span>{{ text "communities:label.likes" }}</span>
</a>
</div>
{% if (user and user.id == post.owner) or can_manage_posts %} {% if user and
user.id == post.owner %}
<div class="pillmenu">
<a href="/post/{{ post.id }}#/edit">
{{ icon "pen" }}
<span>{{ text "communities:label.edit_content" }}</span>
</a>
{% endif %} {% if (user and user.id == post.owner) or can_manage_posts
%}
{% endif %}
<a href="/post/{{ post.id }}#/configure">
{{ icon "settings" }}
<span>{{ text "communities:action.configure" }}</span>
</a>
{% endif %}
</div>
{% endif %}
<div class="card-nest w-full">
<div class="card small flex items-center gap-2">