Integrate federation app with shared menu/header system
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 44s

Replace standalone base.html with the shared _types/root layout.
Social pages get a second nav row via _types/social/index.html.
Root / becomes a blank page with shared chrome. Auth pages use
the shared layout without the social nav bar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-23 00:10:56 +00:00
parent 9a1be0461c
commit 8dc354ae0b
18 changed files with 103 additions and 94 deletions

View File

@@ -0,0 +1,3 @@
{% extends '_types/root/_index.html' %}
{% block meta %}{% endblock %}
{% block content %}{% endblock %}

View File

@@ -0,0 +1,52 @@
{% import 'macros/links.html' as links %}
{% macro header_row(oob=False) %}
{% call links.menu_row(id='social-row', oob=oob) %}
<div class="w-full flex flex-row items-center gap-2 flex-wrap">
{% if actor %}
<nav class="flex gap-3 text-sm items-center flex-wrap">
<a href="{{ url_for('social.home_timeline') }}"
class="px-2 py-1 rounded hover:bg-stone-200 {% if request.path == url_for('social.home_timeline') %}font-bold{% endif %}">
Timeline
</a>
<a href="{{ url_for('social.public_timeline') }}"
class="px-2 py-1 rounded hover:bg-stone-200 {% if request.path == url_for('social.public_timeline') %}font-bold{% endif %}">
Public
</a>
<a href="{{ url_for('social.compose_form') }}"
class="px-2 py-1 rounded hover:bg-stone-200 {% if request.path == url_for('social.compose_form') %}font-bold{% endif %}">
Compose
</a>
<a href="{{ url_for('social.following_list') }}"
class="px-2 py-1 rounded hover:bg-stone-200 {% if request.path == url_for('social.following_list') %}font-bold{% endif %}">
Following
</a>
<a href="{{ url_for('social.followers_list') }}"
class="px-2 py-1 rounded hover:bg-stone-200 {% if request.path == url_for('social.followers_list') %}font-bold{% endif %}">
Followers
</a>
<a href="{{ url_for('social.search') }}"
class="px-2 py-1 rounded hover:bg-stone-200 {% if request.path == url_for('social.search') %}font-bold{% endif %}">
Search
</a>
<a href="{{ url_for('social.notifications') }}"
class="px-2 py-1 rounded hover:bg-stone-200 relative {% if request.path == url_for('social.notifications') %}font-bold{% endif %}">
Notifications
<span hx-get="{{ url_for('social.notification_count') }}" hx-trigger="load, every 30s" hx-swap="innerHTML"
class="absolute -top-2 -right-3 text-xs bg-red-500 text-white rounded-full px-1 empty:hidden"></span>
</a>
<a href="{{ url_for('actors.profile', username=actor.preferred_username) }}"
class="px-2 py-1 rounded hover:bg-stone-200">
@{{ actor.preferred_username }}
</a>
</nav>
{% else %}
<nav class="flex gap-3 text-sm items-center">
<a href="{{ url_for('identity.choose_username_form') }}"
class="px-2 py-1 rounded hover:bg-stone-200 font-bold">
Choose username
</a>
</nav>
{% endif %}
</div>
{% endcall %}
{% endmacro %}

View File

@@ -0,0 +1,10 @@
{% extends '_types/root/_index.html' %}
{% block meta %}{% endblock %}
{% block root_header_child %}
{% from '_types/root/_n/macros.html' import index_row with context %}
{% call index_row('social-header-child', '_types/social/header/_header.html') %}
{% endcall %}
{% endblock %}
{% block content %}
{% block social_content %}{% endblock %}
{% endblock %}