Add navigation bar

Closes: #89
This commit is contained in:
Edward Betts 2024-01-02 16:08:22 +00:00
parent aa7d7b7e6c
commit 31d5da22ac
7 changed files with 35 additions and 69 deletions

View file

@ -40,20 +40,6 @@
<h1>Accommodation</h1>
<p>
<a href="{{ url_for("index") }}">&larr; back to agenda</a>
|
<a href="{{ url_for("travel_list") }}">travel</a>
|
<a href="{{ url_for("conference_list") }}">conference</a>
|
<a href="{{ url_for("gaps_page") }}">gaps</a>
|
<strong>accommodation</strong>
</p>
<ul>
<li>Total nights away in 2024: {{ total_nights_2024 }}</li>
<li>Total nights abroad in 2024: {{ nights_abroad_2024 }}</li>

View file

@ -12,12 +12,11 @@
{% block style %}
{% endblock %}
</head>
{% from "navbar.html" import navbar with context %}
<body>
{% block content %}
{% endblock %}
{% block scripts %}
{% endblock %}
{% block nav %}{{ navbar() }}{% endblock %}
{% block content %}{% endblock %}
{% block scripts %}{% endblock %}
</body>
</html>

View file

@ -53,18 +53,6 @@
<h1>Conferences</h1>
<p>
<a href="{{ url_for("index") }}">&larr; back to agenda</a>
|
<a href="{{ url_for("travel_list") }}">travel</a>
|
<strong>conference</strong>
|
<a href="{{ url_for("gaps_page") }}">gaps</a>
|
<a href="{{ url_for("accommodation_list") }}">accommodation</a>
</p>
<div class="grid-container">
{{ section("Current", current, "attending") }}
{{ section("Future", future, "going") }}

View file

@ -4,20 +4,6 @@
<div class="p-2">
<h1>Gaps</h1>
<p>
<a href="{{ url_for("index") }}">&larr; back to agenda</a>
|
<a href="{{ url_for("travel_list") }}">travel</a>
|
<a href="{{ url_for("conference_list") }}">conference</a>
|
<strong>gaps</strong>
|
<a href="{{ url_for("accommodation_list") }}">accommodation</a>
</p>
<table class="table table-hover w-auto">
<thead>
<tr>

View file

@ -1,5 +1,3 @@
{# vim: set ft=htmljinja
#}
<!doctype html>
<html lang="en">
<head>
@ -103,20 +101,14 @@
{% from "navbar.html" import navbar with context %}
<body>
{{ navbar() }}
<div class="container-fluid mt-2">
<h1>Agenda</h1>
<p>
<a href="/tools">&larr; personal tools</a>
|
<a href="{{ url_for("travel_list") }}">travel</a>
|
<a href="{{ url_for("conference_list") }}">conference</a>
|
<a href="{{ url_for("gaps_page") }}">gaps</a>
|
<a href="{{ url_for("accommodation_list") }}">accommodation</a>
</p>
<ul>

29
templates/navbar.html Normal file
View file

@ -0,0 +1,29 @@
{% macro navbar() %}
{% set pages = [
{"endpoint": "index", "label": "Home" },
{"endpoint": "conference_list", "label": "Conference" },
{"endpoint": "travel_list", "label": "Travel" },
{"endpoint": "accommodation_list", "label": "Accommodation" },
{"endpoint": "gaps_page", "label": "Gaps" },
] %}
<nav class="navbar navbar-expand-lg bg-success" data-bs-theme="dark">
<div class="container-fluid">
<a class="navbar-brand" href="{{ url_for("index") }}">Agenda</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
{% for page in pages %}
<li class="nav-item">
<a class="nav-link{% if request.endpoint == page.endpoint %} border border-white border-2 active{% endif %}" href="{{ url_for(page.endpoint) }}">{{ page.label }}</a>
</li>
{% endfor %}
</ul>
</div>
</div>
</nav>
{% endmacro %}

View file

@ -22,8 +22,6 @@
justify-content: start;
}
.grid-item {
/* Additional styling for grid items can go here */
}
@ -36,18 +34,6 @@
<h1>Travel</h1>
<p>
<a href="{{ url_for("index") }}">&larr; back to agenda</a>
|
<strong>travel</strong>
|
<a href="{{ url_for("conference_list") }}">conference</a>
|
<a href="{{ url_for("gaps_page") }}">gaps</a>
|
<a href="{{ url_for("accommodation_list") }}">accommodation</a>
</p>
<h3>flights</h3>
<div class="grid-container">