add: profile and full search

This commit is contained in:
trisua 2025-05-18 16:43:56 -04:00
parent b8b0ef7f21
commit 3e4ee8126a
52 changed files with 897 additions and 484 deletions

View file

@ -4,7 +4,7 @@
<main class="flex flex-col gap-2">
{{ macros::timelines_nav(selected="all") }} {{
macros::timelines_secondary_nav(posts="/all", questions="/all/questions") }}
{% if not user %}
{% if not user -%}
<div class="card-nest">
<div class="card small flex items-center gap-2">
{{ icon "heart" }}
@ -23,18 +23,18 @@
</a>
</div>
</div>
{% endif %}
{%- endif %}
<!-- prettier-ignore -->
<div class="card w-full flex flex-col gap-2">
{% for post in list %}
{% if post[2].read_access == "Everybody" %}
{% if post[0].context.repost and post[0].context.repost.reposting %}
{% 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) }}
{% else %}
{{ components::post(post=post[0], owner=post[1], question=post[4], secondary=true, community=post[2]) }}
{% endif %}
{% endif %}
{%- endif %}
{%- endif %}
{% endfor %}
{{ components::pagination(page=page, items=list|length) }}

View file

@ -9,13 +9,13 @@
<!-- prettier-ignore -->
<div class="card w-full flex flex-col gap-2">
{% for post in list %}
{% if post[2].read_access == "Everybody" %}
{% if post[0].context.repost and post[0].context.repost.reposting %}
{% 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) }}
{% else %}
{{ components::post(post=post[0], owner=post[1], question=post[4], secondary=true, community=post[2]) }}
{% endif %}
{% endif %}
{%- endif %}
{%- endif %}
{% endfor %}
{{ components::pagination(page=page, items=list|length) }}

View file

@ -6,7 +6,7 @@
{{ macros::timelines_nav(selected="home") }} {{
macros::timelines_secondary_nav(posts="/", questions="/questions") }}
{% if list|length == 0 and page == 0 %}
{% if list|length == 0 and page == 0 -%}
<div class="card-nest">
<div class="card">
<b>✨ Welcome to <i>{{ config.name }}</i>!</b>
@ -26,15 +26,15 @@
<!-- prettier-ignore -->
<div class="card w-full flex flex-col gap-2">
{% for post in list %}
{% if post[0].context.repost and post[0].context.repost.reposting %}
{% 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) }}
{% else %}
{{ components::post(post=post[0], owner=post[1], question=post[4], secondary=true, community=post[2]) }}
{% endif %}
{%- endif %}
{% endfor %}
{{ components::pagination(page=page, items=list|length) }}
</div>
{% endif %}
{%- endif %}
</main>
{% endblock %}

View file

@ -9,13 +9,13 @@
<!-- prettier-ignore -->
<div class="card w-full flex flex-col gap-2">
{% for post in list %}
{% if post[2].read_access == "Everybody" %}
{% if post[0].context.repost and post[0].context.repost.reposting %}
{% 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) }}
{% else %}
{{ components::post(post=post[0], owner=post[1], question=post[4], secondary=true, community=post[2]) }}
{% endif %}
{% endif %}
{%- endif %}
{%- endif %}
{% endfor %}
{{ components::pagination(page=page, items=list|length) }}

View file

@ -0,0 +1,75 @@
{% extends "root.html" %} {% block head %}
<title>Search - {{ config.name }}</title>
{% endblock %} {% block body %} {{ macros::nav() }}
<main class="flex flex-col gap-2">
{{ macros::timelines_nav(selected="search") }}
<div class="card-nest w-full">
<div class="card small flex items-center justify-between gap-2">
<div class="flex items-center gap-2">
{{ icon "search" }} {% if not profile -%}
<span>{{ text "general:link.search" }}</span>
{% else %}
<span>{{ components::full_username(user=profile) }}</span>
{%- endif %}
</div>
</div>
<div class="card w-full flex flex-col gap-2">
{% if not profile and not user.permissions|has_supporter -%} {{
components::supporter_ad(body="Become a supporter for full-site
search!") }} {% else %}
<form class="flex flex-col gap-2">
<div class="flex flex-row gap-2">
<input
type="text"
name="query"
id="query"
required
value="{{ query }}"
placeholder="{% if profile -%}Search {{ profile.username }}'s posts{% else %}Search all posts{%- endif %}"
autocomplete="off"
/>
{% if profile -%}
<input
type="text"
class="hidden"
value="{{ profile.id }}"
name="profile"
id="profile"
/>
{%- endif %}
<button class="small square">{{ icon "search" }}</button>
</div>
{% if config.manuals.search_help -%}
<span
><a href="{{ config.manuals.search_help }}">
Search help
</a></span
>
{%- endif %}
</form>
{%- endif %}
<!-- prettier-ignore -->
{% for post in list %}
{% 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) }}
{% else %}
{{ components::post(post=post[0], owner=post[1], question=post[4], secondary=true, community=post[2]) }}
{%- endif %}
{%- endif %}
{% endfor %}
{% if profile -%}
{{ components::pagination(page=page, items=list|length, key="&profile=" ~ profile.id, value="&query=" ~ query) }}
{% else %}
{{ components::pagination(page=page, items=list|length, key="&query=" ~ query) }}
{%- endif %}
</div>
</div>
</main>
{% endblock %}