Admin Home Tabbed, with view-transitions

This commit is contained in:
JollyDevelopment 2025-01-13 14:42:49 -05:00
parent 7fd3d7ab69
commit a3c601ee06
15 changed files with 50 additions and 15 deletions

View file

@ -0,0 +1,22 @@
<div>
<nav id="block_chooser">
<div class="nav nav-tabs nav-justified" id="typeTab" role="tablist">
<a class="nav-link{% if active_child == 'admin_site' %} active{% endif %}" id="site-profile-tab" type="button" role="tab" href="/admin/site" style="view-transition-name: site">{{ _('Site Profile') }}</a>
<a class="nav-link{% if active_child == 'admin_misc' %} active{% endif %}" id="misc-tab" type="button" role="tab" href="/admin/misc" style="view-transition-name: misc">{{ _('Misc') }}</a>
<a class="nav-link{% if active_child == 'admin_communities' %} active{% endif %}" id="communities-tab" type="button" role="tab" href="/admin/communities" style="view-transition-name: communities">{{ _('Communities') }}</a>
<a class="nav-link{% if active_child == 'admin_topics' %} active{% endif %}" id="topics-tab" type="button" role="tab" href="/admin/topics" style="view-transition-name: topics">{{ _('Topics') }}</a>
<a class="nav-link{% if active_child == 'admin_users' %} active{% endif %}" id="users-tab" type="button" role="tab" href="/admin/users" style="view-transition-name: users">{{ _('Users') }}</a>
{% if g.site.registration_mode == 'RequireApplication' %}
<a class="nav-link{% if active_child == 'admin_approve_registrations' %} active{% endif %}" id="users-tab" type="button" role="tab" href="/admin/approve_registrations" style="view-transition-name: approve">{{ _('Registration') }}</a>
{% endif %}
<a class="nav-link{% if active_child == 'admin_content' %} active{% endif %}" id="content-tab" type="button" role="tab" href="/admin/content" style="view-transition-name: content">{{ _('Content') }}</a>
<a class="nav-link{% if active_child == 'admin_reports' %} active{% endif %}" id="moderation-tab" type="button" role="tab" href="/admin/reports" style="view-transition-name: reports">{{ _('Moderation') }}</a>
<a class="nav-link{% if active_child == 'admin_federation' %} active{% endif %}" id="federation-tab" type="button" role="tab" href="/admin/federation" style="view-transition-name: federation">{{ _('Federation') }}</a>
<a class="nav-link{% if active_child == 'admin_instances' %} active{% endif %}" id="instances-tab" type="button" role="tab" href="/admin/instances" style="view-transition-name: instances">{{ _('Instances') }}</a>
<a class="nav-link{% if active_child == 'admin_newsletter' %} active{% endif %}" id="newsletter-tab" type="button" role="tab" href="/admin/newsletter" style="view-transition-name: newsletter">{{ _('Newsletter') }}</a>
<a class="nav-link{% if active_child == 'admin_permissions' %} active{% endif %}" id="permissions-tab" type="button" role="tab" href="/admin/permissions" style="view-transition-name: permissions">{{ _('Permissions') }}</a>
<a class="nav-link{% if active_child == 'admin_activities' %} active{% endif %}" id="activities-tab" type="button" role="tab" href="/admin/activities" style="view-transition-name: activities">{{ _('Activities') }}</a>
<!-- <a class="nav-link{% if active_child == 'modlog' %} active{% endif %}" id="modlog-tab" type="button" role="tab" href="/modlog">{{ _('Modlog') }}</a> -->
</div>
</nav>
</div>

View file

@ -7,6 +7,8 @@
{% set active_child = 'admin_activities' %} {% set active_child = 'admin_activities' %}
{% block app_content %} {% block app_content %}
{% include 'admin/_tabbed_nav.html' %}
<br>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h1>{{ _('Activities') }}</h1> <h1>{{ _('Activities') }}</h1>

View file

@ -7,6 +7,8 @@
{% set active_child = 'admin_approve_registrations' %} {% set active_child = 'admin_approve_registrations' %}
{% block app_content %} {% block app_content %}
{% include 'admin/_tabbed_nav.html' %}
<br>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h1>{{ _('Registrations') }}</h1> <h1>{{ _('Registrations') }}</h1>

View file

@ -7,6 +7,8 @@
{% set active_child = 'admin_communities' %} {% set active_child = 'admin_communities' %}
{% block app_content %} {% block app_content %}
{% include 'admin/_tabbed_nav.html' %}
<br>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h1>{{ title }}</h1> <h1>{{ title }}</h1>

View file

@ -7,6 +7,8 @@
{% set active_child = 'admin_content' %} {% set active_child = 'admin_content' %}
{% block app_content %} {% block app_content %}
{% include 'admin/_tabbed_nav.html' %}
<br>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h1>{{ _('Content') }}</h1> <h1>{{ _('Content') }}</h1>

View file

@ -7,6 +7,8 @@
{% set active_child = 'admin_federation' %} {% set active_child = 'admin_federation' %}
{% block app_content %} {% block app_content %}
{% include 'admin/_tabbed_nav.html' %}
<br>
<div class="row"> <div class="row">
<div class="col"> <div class="col">

View file

@ -7,6 +7,8 @@
{% set active_child = 'admin_instances' %} {% set active_child = 'admin_instances' %}
{% block app_content %} {% block app_content %}
{% include 'admin/_tabbed_nav.html' %}
<br>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h1>{{ title }}</h1> <h1>{{ title }}</h1>

View file

@ -7,6 +7,8 @@
{% set active_child = 'admin_misc' %} {% set active_child = 'admin_misc' %}
{% block app_content %} {% block app_content %}
{% include 'admin/_tabbed_nav.html' %}
<br>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h1>{{ _('Misc settings') }}</h1> <h1>{{ _('Misc settings') }}</h1>

View file

@ -3,6 +3,8 @@
{% set active_child = 'admin_newsletter' %} {% set active_child = 'admin_newsletter' %}
{% block app_content %} {% block app_content %}
{% include 'admin/_tabbed_nav.html' %}
<br>
<div class="row"> <div class="row">
<div class="col"> <div class="col">

View file

@ -7,6 +7,8 @@
{% set active_child = 'admin_permissions' %} {% set active_child = 'admin_permissions' %}
{% block app_content %} {% block app_content %}
{% include 'admin/_tabbed_nav.html' %}
<br>
<div class="row"> <div class="row">
<div class="col"> <div class="col">

View file

@ -7,6 +7,8 @@
{% set active_child = 'admin_reports' %} {% set active_child = 'admin_reports' %}
{% block app_content %} {% block app_content %}
{% include 'admin/_tabbed_nav.html' %}
<br>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h1>{{ _('Reports') }}</h1> <h1>{{ _('Reports') }}</h1>

View file

@ -6,8 +6,11 @@
{% from 'bootstrap/form.html' import render_field %} {% from 'bootstrap/form.html' import render_field %}
{% set active_child = 'admin_site' %} {% set active_child = 'admin_site' %}
{% block app_content %} {% block app_content %}
{% include 'admin/_tabbed_nav.html' %}
<br>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h1>{{ _('Site profile') }}</h1> <h1>{{ _('Site profile') }}</h1>

View file

@ -7,6 +7,8 @@
{% set active_child = 'admin_topics' %} {% set active_child = 'admin_topics' %}
{% block app_content %} {% block app_content %}
{% include 'admin/_tabbed_nav.html' %}
<br>
{% macro render_topic(topic, depth) %} {% macro render_topic(topic, depth) %}
<tr> <tr>
<td nowrap="nowrap">{{ '--' * depth }} <a href="/topic/{{ topic['topic'].path() }}">{{ topic['topic'].name }}</a></td> <td nowrap="nowrap">{{ '--' * depth }} <a href="/topic/{{ topic['topic'].path() }}">{{ topic['topic'].name }}</a></td>

View file

@ -7,6 +7,8 @@
{% set active_child = 'admin_users' %} {% set active_child = 'admin_users' %}
{% block app_content %} {% block app_content %}
{% include 'admin/_tabbed_nav.html' %}
<br>
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h1>{{ _('Users') }}</h1> <h1>{{ _('Users') }}</h1>

View file

@ -224,21 +224,7 @@
<li class="nav-item dropdown{% if active_parent == 'admin' %} active{% endif %}"> <li class="nav-item dropdown{% if active_parent == 'admin' %} active{% endif %}">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="/admin/" aria-haspopup="true" aria-expanded="false">{{ _('Admin') }}</a> <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="/admin/" aria-haspopup="true" aria-expanded="false">{{ _('Admin') }}</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_site' }}" href="{{ url_for('admin.admin_site') }}">{{ _('Site profile') }}</a></li> <li><a class="dropdown-item{{ ' active' if active_child == 'admin_site' }}" href="{{ url_for('admin.admin_site') }}">{{ _('Home') }}</a></li>
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_misc' }}" href="{{ url_for('admin.admin_misc') }}">{{ _('Misc settings') }}</a></li>
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_communities' }}" href="{{ url_for('admin.admin_communities') }}">{{ _('Communities') }}</a></li>
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_topics' }}" href="{{ url_for('admin.admin_topics') }}">{{ _('Topics') }}</a></li>
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_users' }}" href="{{ url_for('admin.admin_users', local_remote='local') }}">{{ _('Users') }}</a></li>
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_content' }}" href="{{ url_for('admin.admin_content') }}">{{ _('Content') }}</a></li>
{% if g.site.registration_mode == 'RequireApplication' %}
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_approve_registrations' }}" href="{{ url_for('admin.admin_approve_registrations') }}">{{ _('Registration applications') }}</a></li>
{% endif %}
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_reports' }}" href="{{ url_for('admin.admin_reports') }}">{{ _('Moderation') }}</a></li>
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_federation' }}" href="{{ url_for('admin.admin_federation') }}">{{ _('Federation') }}</a></li>
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_instances' }}" href="{{ url_for('admin.admin_instances') }}">{{ _('Instances') }}</a></li>
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_newsletter' }}" href="{{ url_for('admin.newsletter') }}">{{ _('Newsletter') }}</a></li>
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_permissions' }}" href="{{ url_for('admin.admin_permissions') }}">{{ _('Permissions') }}</a></li>
<li><a class="dropdown-item{{ ' active' if active_child == 'admin_activities' }}" href="{{ url_for('admin.admin_activities') }}">{{ _('Activities') }}</a></li>
<li><a class="dropdown-item{{ ' active' if active_child == 'modlog' }}" href="{{ url_for('main.modlog') }}">{{ _('Modlog') }}</a></li> <li><a class="dropdown-item{{ ' active' if active_child == 'modlog' }}" href="{{ url_for('main.modlog') }}">{{ _('Modlog') }}</a></li>
{% if debug_mode %} {% if debug_mode %}
<li><a class="dropdown-item{{ ' active' if active_child == 'dev_tools' }}" href="{{ url_for('dev.tools') }}">{{ _('Dev Tools') }}</a></li> <li><a class="dropdown-item{{ ' active' if active_child == 'dev_tools' }}" href="{{ url_for('dev.tools') }}">{{ _('Dev Tools') }}</a></li>