aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/templates/base.html
blob: 19412ed79e8f9f82e3017de5d0a9788d27f028f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!--
SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me>

SPDX-License-Identifier: BSD-3-Clause
-->
{% from "bootstrap5/utils.html" import render_messages %}
<!DOCTYPE html>
<html lang="en" data-bs-theme="dark">
  <head>
    {% block head %}
      <!-- Required meta tags -->
      <meta charset="utf-8">
      <meta name="viewport"
            content="width=device-width, initial-scale=1, shrink-to-fit=no">
      <link rel="icon"
            type="image/svg+xml"
            sizes="any"
            href="{{ url_for('static', filename='images/logo.svg') }}">
      <link rel="icon"
            type="image/png"
            sizes="32x32"
            href="{{ url_for('static', filename='images/favicon.png') }}">

      {% block styles %}
        <!-- Bootstrap CSS -->
        {{ bootstrap.load_css() }}
      {% endblock %}
      <title>{{ title }}</title>
    {% endblock %}
  </head>
  <body>
    <header>
      <nav class="navbar bg-primary py-1">
        <div class="container-fluid px-3">
          <a class="navbar-brand fs-6 mb-0" href="{{ url_for('root.index') }}">
            <img src="{{ url_for('static', filename='images/logo.svg') }}"
                 width="30"
                 height="30"
                 alt=""
                 class="d-inline-block align-center">
            Webmentions
          </a>
          {% if current_user.is_authenticated %}
            <div class="navbar-nav flex-row gap-3">
              <a class="nav-link{% if request.endpoint == 'root.received' %} active{% endif %}"
                 href='{{ url_for("root.received") }}'>Received</a>
              <a class="nav-link{% if request.endpoint == 'root.sent' %} active{% endif %}"
                 href='{{ url_for("root.sent") }}'>Sent</a>
              <form action="{{ url_for('root.logout') }}" method="post" class="m-0">
                <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
                <button type="submit" class="nav-link border-0 bg-transparent">Logout</button>
              </form>
            </div>
          {% endif %}
        </div>
      </nav>
    </header>
    <div class="mt-4">{{ render_messages(container=True) }}</div>
    <div class="container py-4">
      {% block content %}{% endblock %}
    </div>

    {% block scripts %}
      <!-- Optional JavaScript -->
      {{ bootstrap.load_js() }}
    {% endblock %}
  </body>
</html>