add: profile replies tab

add: profile media tab
This commit is contained in:
trisua 2025-05-18 20:51:55 -04:00
parent 3e4ee8126a
commit c74f36b97c
10 changed files with 465 additions and 39 deletions

View file

@ -212,4 +212,27 @@ selected="posts") -%} {% if user -%}
<span>{{ text "communities:tab.questions" }}</span>
</a>
</div>
{%- endif %} {%- endmacro %}
{%- endif %} {%- endmacro %} {% macro profile_nav(selected="") -%}
<div class="pillmenu">
<a
href="/@{{ profile.username }}"
class="{% if selected == 'posts' -%}active{%- endif %}"
>
{{ text "auth:label.posts" }}
</a>
<a
href="/@{{ profile.username }}/replies"
class="{% if selected == 'replies' -%}active{%- endif %}"
>
{{ text "auth:label.replies" }}
</a>
<a
href="/@{{ profile.username }}/media"
class="{% if selected == 'media' -%}active{%- endif %}"
>
{{ text "auth:label.media" }}
</a>
</div>
{%- endmacro %}

View file

@ -0,0 +1,42 @@
{% extends "profile/base.html" %} {% block content %} {% if
profile.settings.enable_questions and (user or
profile.settings.allow_anonymous_questions) %}
<div style="display: contents">
{{ components::create_question_form(receiver=profile.id,
header=profile.settings.motivational_header) }}
</div>
{%- endif %} {{ macros::profile_nav(selected="media") }}
<div class="card-nest">
<div class="card small flex gap-2 justify-between items-center">
<div class="flex gap-2 items-center">
{{ icon "clock" }}
<span>{{ text "auth:label.recent_posts_with_media" }}</span>
</div>
{% if user -%}
<a
href="/search?profile={{ profile.id }}"
class="button quaternary small"
>
{{ icon "search" }}
<span>{{ text "general:link.search" }}</span>
</a>
{%- endif %}
</div>
<div class="card flex flex-col gap-4">
<!-- prettier-ignore -->
{% for post in posts %}
{% if post[2].read_access == "Everybody" -%}
{% if post[0].context.repost and post[0].context.repost.reposting -%}
{{ components::repost(repost=post[3], post=post[0], owner=post[1], secondary=true, community=post[2], show_community=true, can_manage_post=is_self) }}
{% else %}
{{ components::post(post=post[0], owner=post[1], question=post[4], secondary=true, community=post[2], can_manage_post=is_self) }}
{%- endif %}
{%- endif %}
{% endfor %}
{{ components::pagination(page=page, items=posts|length) }}
</div>
</div>
{% endblock %}

View file

@ -25,8 +25,7 @@ profile.settings.allow_anonymous_questions) %}
{% endfor %}
</div>
</div>
{%- endif %}
{%- endif %} {{ macros::profile_nav(selected="posts") }}
<div class="card-nest">
<div class="card small flex gap-2 justify-between items-center">
<div class="flex gap-2 items-center">

View file

@ -0,0 +1,42 @@
{% extends "profile/base.html" %} {% block content %} {% if
profile.settings.enable_questions and (user or
profile.settings.allow_anonymous_questions) %}
<div style="display: contents">
{{ components::create_question_form(receiver=profile.id,
header=profile.settings.motivational_header) }}
</div>
{%- endif %} {{ macros::profile_nav(selected="replies") }}
<div class="card-nest">
<div class="card small flex gap-2 justify-between items-center">
<div class="flex gap-2 items-center">
{{ icon "clock" }}
<span>{{ text "auth:label.recent_replies" }}</span>
</div>
{% if user -%}
<a
href="/search?profile={{ profile.id }}"
class="button quaternary small"
>
{{ icon "search" }}
<span>{{ text "general:link.search" }}</span>
</a>
{%- endif %}
</div>
<div class="card flex flex-col gap-4">
<!-- prettier-ignore -->
{% for post in posts %}
{% if post[2].read_access == "Everybody" -%}
{% if post[0].context.repost and post[0].context.repost.reposting -%}
{{ components::repost(repost=post[3], post=post[0], owner=post[1], secondary=true, community=post[2], show_community=true, can_manage_post=is_self) }}
{% else %}
{{ components::post(post=post[0], owner=post[1], question=post[4], secondary=true, community=post[2], can_manage_post=is_self) }}
{%- endif %}
{%- endif %}
{% endfor %}
{{ components::pagination(page=page, items=posts|length) }}
</div>
</div>
{% endblock %}

View file

@ -40,16 +40,24 @@
/>
{%- endif %}
<button class="small square">{{ icon "search" }}</button>
<div class="flex gap-2 flex-row">
<button class="small square">
{{ icon "search" }}
</button>
{% if config.manuals.search_help -%}
<a
class="button small square secondary"
title="Search help"
href="{{ config.manuals.search_help }}"
>
{{ icon "circle-help" }}
</a>
{%- endif %}
</div>
</div>
{% if config.manuals.search_help -%}
<span
><a href="{{ config.manuals.search_help }}">
Search help
</a></span
>
{%- endif %}
<span><a> Search help </a></span>
</form>
{%- endif %}