summaryrefslogtreecommitdiffstats
path: root/templates/base.html
blob: 4614223f4f0b8dbaa3f4a49d110eaeb98b5d1e54 (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html>
<head>
    <title>{% block title %}{% endblock %} - {{ config.site_name }}</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    {% load static %}
    <link rel="stylesheet" href="{% static "css/style.css" %}" type="text/css" media="screen" />
    <link rel="stylesheet" href="{% static "fonts/raleway/raleway.css" %}" type="text/css" />
    <link rel="stylesheet" href="{% static "fonts/font_awesome/all.min.css" %}" type="text/css" />
    <link rel="manifest" href="/manifest.json" />
    <link rel="shortcut icon" href="{{ config.site_icon }}">
    <script src="{% static "js/hyperscript.min.js" %}"></script>
    <script src="{% static "js/htmx.min.js" %}"></script>
    <style>
        body {
            --color-highlight: {{ config.highlight_color }};
        }
    </style>
    {% block extra_head %}{% endblock %}
</head>
<body class="{% block body_class %}{% endblock %}" hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
    <a id='skip-to-main' class='screenreader-text' href='#main-content'>Skip to Content</a>
    <a id='skip-to-nav' class='screenreader-text' href='#side-navigation'>Skip to Navigation</a>
    <main>
        <header>
            <a class="logo" href="/">
                <img src="{{ config.site_icon }}" width="32">
                {{ config.site_name }}
            </a>
            <menu>
                {% if user.is_authenticated %}
                    <a href="{% url "compose" %}" title="Compose" role="menuitem" {% if top_section == "compose" %}class="selected"{% endif %}>
                        <i class="fa-solid fa-feather"></i>
                    </a>
                    <a href="{% url "search" %}" title="Search" role="menuitem" {% if top_section == "search" %}class="selected"{% endif %}>
                        <i class="fa-solid fa-search"></i>
                    </a>
                    {% if allows_refresh %}
                        <a href="." title="Refresh" role="menuitem" hx-get="." hx-select=".left-column" hx-target=".left-column" hx-swap="outerHTML" hx-trigger="click, every 120s">
                            <i class="fa-solid fa-rotate"></i>
                        </a>
                    {% endif %}
                    <div class="gap"></div>
                    <a href="/identity/select/" role="menuitem" class="identity">
                        {% if not request.identity %}
                            No Identity
                            <img src="{% static "img/unknown-icon-128.png" %}" title="No identity selected">
                        {% else %}
                            {{ request.identity.username }}
                            <img src="{{ request.identity.local_icon_url.relative }}" title="{{ request.identity.handle }}">
                        {% endif %}
                    </a>
                {% else %}
                    <div class="gap"></div>
                    <a href="/auth/login/" role="menuitem" class="identity"><i class="fa-solid fa-right-to-bracket"></i> Login</a>
                {% endif %}
            </menu>
        </header>

        {% block full_content %}
            {% block pre_content %}
            {% endblock %}
            <div class="columns">
                <div class="left-column" id="main-content">
                    {% block content %}
                    {% endblock %}
                </div>
                <div class="right-column" id="side-navigation">
                    {% block right_content %}
                        {% include "activities/_menu.html" %}
                    {% endblock %}
                </div>
            </div>
        {% endblock %}
    </main>

    <footer>
        {% if config.site_about %}<a href="{% url "about" %}">About</a>{% endif %}
        {% if config.policy_rules %}<a href="{% url "rules" %}">Server&nbsp;Rules</a>{% endif %}
        {% if config.policy_terms %}<a href="{% url "terms" %}">Terms&nbsp;of&nbsp;Service</a>{% endif %}
        {% if config.policy_privacy %}<a href="{% url "privacy" %}">Privacy&nbsp;Policy</a>{% endif %}
        <a href="https://jointakahe.org">Takahē&nbsp;{{ config.version }}</a>
    </footer>

</body>
</html>