189 lines
6.1 KiB
HTML
189 lines
6.1 KiB
HTML
{% macro nav(selected="", show_lhs=true, hide_user_menu=false) -%}
|
|
<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="{{ home }}"
|
|
class="button {% if selected == 'home' %}active{% endif %}"
|
|
>
|
|
{{ icon "house" }}
|
|
<span class="desktop">{{ text "general:link.home" }}</span>
|
|
</a>
|
|
|
|
{% if user %}
|
|
<a
|
|
href="/communities"
|
|
class="button {% if selected == 'communities' %}active{% endif %}"
|
|
>
|
|
{{ icon "book-heart" }}
|
|
<span class="desktop"
|
|
>{{ text "general:link.communities" }}</span
|
|
>
|
|
</a>
|
|
{% endif %} {% endif %}
|
|
</div>
|
|
|
|
<div class="flex nav_side">
|
|
{% if user %}
|
|
<a
|
|
href="/communities/intents/post"
|
|
class="button"
|
|
title="Create post"
|
|
>
|
|
{{ icon "square-pen" }}
|
|
</a>
|
|
|
|
<a
|
|
href="/chats/0/0"
|
|
class="button {% if selected == 'chats' %}active{% endif %}"
|
|
title="Chats"
|
|
>
|
|
{{ icon "message-circle" }}
|
|
</a>
|
|
|
|
<a
|
|
href="/requests"
|
|
class="button {% if selected == 'requests' %}active{% endif %}"
|
|
title="Requests"
|
|
>
|
|
{{ icon "inbox" }}
|
|
<span
|
|
class="notification tr {% if user.request_count <= 0 %}hidden{% endif %}"
|
|
id="requests_span"
|
|
>{{ user.request_count }}</span
|
|
>
|
|
</a>
|
|
|
|
<a
|
|
href="/notifs"
|
|
class="button {% if selected == 'notifications' %}active{% endif %}"
|
|
title="Notifications"
|
|
>
|
|
{{ icon "bell" }}
|
|
<span
|
|
class="notification tr {% if user.notification_count <= 0 %}hidden{% endif %}"
|
|
id="notifications_span"
|
|
>{{ user.notification_count }}</span
|
|
>
|
|
</a>
|
|
|
|
{% if not hide_user_menu %}
|
|
<div class="dropdown">
|
|
<button
|
|
class="flex-row title"
|
|
onclick="trigger('atto::hooks::dropdown', [event])"
|
|
exclude="dropdown"
|
|
style="gap: 0.25rem !important"
|
|
>
|
|
{{ components::avatar(username=user.username, size="24px")
|
|
}} {{ icon "chevron-down" c(dropdown-arrow) }}
|
|
</button>
|
|
|
|
{{ components::user_menu() }}
|
|
</div>
|
|
{% endif %} {% else %}
|
|
<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" }}
|
|
<span>{{ text "auth:action.login" }}</span>
|
|
</a>
|
|
<a href="/auth/register" class="button">
|
|
{{ icon "user-plus" }}
|
|
<span>{{ text "auth:action.register" }}</span>
|
|
</a>
|
|
|
|
<div class="title"></div>
|
|
<a href="https://trisua.com/t/tetratto">
|
|
{{ icon "code" }}
|
|
<span>View source</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
{%- endmacro %} {% macro timelines_nav(selected="") -%}
|
|
<div class="pillmenu w-full">
|
|
{% if user %}
|
|
<a href="/" class="{% if selected == 'home' %}active{% endif %}">
|
|
{{ icon "newspaper" }}
|
|
<span>{{ text "general:link.home" }}</span>
|
|
</a>
|
|
{% else %}
|
|
<a href="/" class="{% if selected == 'all' %}active{% endif %}">
|
|
{{ icon "earth" }}
|
|
<span>{{ text "general:link.all" }}</span>
|
|
</a>
|
|
{% endif %}
|
|
|
|
<a href="/popular" class="{% if selected == 'popular' %}active{% endif %}">
|
|
{{ icon "trending-up" }}
|
|
<span>{{ text "general:link.popular" }}</span>
|
|
</a>
|
|
|
|
{% if user %}
|
|
<a
|
|
href="/following"
|
|
class="{% if selected == 'following' %}active{% endif %}"
|
|
>
|
|
{{ icon "rss" }}
|
|
<span>{{ text "general:link.following" }}</span>
|
|
</a>
|
|
|
|
<a href="/all" class="{% if selected == 'all' %}active{% endif %}">
|
|
{{ icon "earth" }}
|
|
<span>{{ text "general:link.all" }}</span>
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
{%- endmacro %} {% macro timelines_secondary_nav(posts="", questions="",
|
|
selected="posts") -%} {% if user %}
|
|
<div class="pillmenu w-full">
|
|
<a href="{{ posts }}" class="{% if selected == 'posts' %}active{% endif %}">
|
|
{{ icon "newspaper" }}
|
|
<span>{{ text "communities:label.posts" }}</span>
|
|
</a>
|
|
|
|
<a
|
|
href="{{ questions }}"
|
|
class="{% if selected == 'questions' %}active{% endif %}"
|
|
>
|
|
{{ icon "message-circle-heart" }}
|
|
<span>{{ text "communities:label.questions" }}</span>
|
|
</a>
|
|
</div>
|
|
{% endif %} {%- endmacro %} {% macro community_nav(community, selected="") -%}
|
|
{% if community.context.enable_questions %}
|
|
<div class="pillmenu">
|
|
<a
|
|
href="/community/{{ community.title }}"
|
|
class="{% if selected == 'posts' %}active{% endif %}"
|
|
>
|
|
{{ icon "newspaper" }}
|
|
<span>{{ text "communities:tab.posts" }}</span>
|
|
</a>
|
|
|
|
<a
|
|
href="/community/{{ community.title }}/questions"
|
|
class="{% if selected == 'questions' %}active{% endif %}"
|
|
>
|
|
{{ icon "message-circle-heart" }}
|
|
<span>{{ text "communities:tab.questions" }}</span>
|
|
</a>
|
|
</div>
|
|
{% endif %} {%- endmacro %}
|