2025-03-22 22:17:47 -04:00
|
|
|
{% macro nav(selected="", show_lhs=true) -%}
|
|
|
|
<nav>
|
|
|
|
<div class="content_container">
|
|
|
|
<div class="flex nav_side">
|
|
|
|
<a href="/" class="button desktop title">
|
|
|
|
<b>{{ config.name }}</b>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
{% if show_lhs %}
|
|
|
|
<a
|
|
|
|
href="/"
|
|
|
|
class="button {% if selected == 'home' %}active{% endif %}"
|
|
|
|
>
|
2025-03-23 12:31:48 -04:00
|
|
|
{{ icon "house" }}
|
2025-03-23 16:37:43 -04:00
|
|
|
<span class="desktop">{{ text "general:link.home" }}</span>
|
2025-03-23 12:31:48 -04:00
|
|
|
</a>
|
2025-03-27 18:10:47 -04:00
|
|
|
|
|
|
|
<a
|
|
|
|
href="/communities"
|
|
|
|
class="button {% if selected == 'communities' %}active{% endif %}"
|
|
|
|
>
|
|
|
|
{{ icon "book-heart" }}
|
|
|
|
<span class="desktop"
|
|
|
|
>{{ text "general:link.communities" }}</span
|
|
|
|
>
|
|
|
|
</a>
|
2025-03-22 22:17:47 -04:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="flex nav_side">
|
|
|
|
{% if user %}
|
2025-03-27 18:10:47 -04:00
|
|
|
<a href="/notifs" class="button" title="Notifications">
|
|
|
|
{{ icon "bell" }} {% if user.notification_count > 0 %}
|
|
|
|
<span class="notification tr"
|
|
|
|
>{{ user.notification_count }}</span
|
|
|
|
>
|
|
|
|
{% endif %}
|
|
|
|
</a>
|
|
|
|
|
2025-03-22 22:17:47 -04:00
|
|
|
<div class="dropdown">
|
2025-03-23 12:31:48 -04:00
|
|
|
<!-- prettier-ignore -->
|
2025-03-22 22:17:47 -04:00
|
|
|
<button
|
|
|
|
class="flex-row title"
|
|
|
|
onclick="trigger('atto::hooks::dropdown', [event])"
|
|
|
|
exclude="dropdown"
|
|
|
|
style="gap: 0.25rem !important"
|
|
|
|
>
|
|
|
|
{{ macros::avatar(username=user.username, size="24px") }}
|
2025-03-23 12:31:48 -04:00
|
|
|
{{ icon "chevron-down" c(dropdown-arrow) }}
|
2025-03-22 22:17:47 -04:00
|
|
|
</button>
|
2025-03-23 16:37:43 -04:00
|
|
|
|
|
|
|
<div class="inner">
|
|
|
|
<b class="title">{{ user.username }}</b>
|
2025-03-25 23:58:27 -04:00
|
|
|
<a href="/user/{{ user.username }}">
|
2025-03-27 18:10:47 -04:00
|
|
|
{{ icon "circle-user-round" }}
|
2025-03-23 16:37:43 -04:00
|
|
|
<span>{{ text "auth:link.my_profile" }}</span>
|
|
|
|
</a>
|
|
|
|
|
2025-03-25 22:52:47 -04:00
|
|
|
<a href="/settings">
|
|
|
|
{{ icon "settings" }}
|
|
|
|
<span>{{ text "auth:link.settings" }}</span>
|
|
|
|
</a>
|
|
|
|
|
2025-03-23 16:37:43 -04:00
|
|
|
<div class="title"></div>
|
|
|
|
<button class="red" onclick="trigger('me::logout')">
|
|
|
|
{{ icon "log-out" }}
|
|
|
|
<span>{{ text "auth:action.logout" }}</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
2025-03-22 22:17:47 -04:00
|
|
|
</div>
|
|
|
|
{% else %}
|
2025-03-23 12:31:48 -04:00
|
|
|
<div class="dropdown">
|
|
|
|
<button
|
|
|
|
class="title"
|
|
|
|
onclick="trigger('atto::hooks::dropdown', [event])"
|
|
|
|
exclude="dropdown"
|
|
|
|
>
|
|
|
|
{{ icon "chevron-down" c(dropdown-arrow) }}
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<div class="inner">
|
|
|
|
<a href="/auth/login" class="button">
|
|
|
|
{{ icon "log-in" }}
|
2025-03-23 16:37:43 -04:00
|
|
|
<span>{{ text "auth:action.login" }}</span>
|
2025-03-23 12:31:48 -04:00
|
|
|
</a>
|
|
|
|
<a href="/auth/register" class="button">
|
|
|
|
{{ icon "user-plus" }}
|
2025-03-23 16:37:43 -04:00
|
|
|
<span>{{ text "auth:action.register" }}</span>
|
2025-03-23 12:31:48 -04:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
2025-03-22 22:17:47 -04:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
{%- endmacro %} {% macro avatar(username, size="24px") -%}
|
|
|
|
<img
|
|
|
|
title="{{ username }}'s avatar"
|
|
|
|
src="/api/v1/auth/profile/{{ username }}/avatar"
|
|
|
|
alt="@{{ username }}"
|
|
|
|
class="avatar shadow"
|
|
|
|
style="--size: {{ size }}"
|
|
|
|
/>
|
|
|
|
{%- endmacro %}
|