summaryrefslogtreecommitdiffstats
path: root/templates/base.html
blob: bce5e1b805ad8aea24786c5b4a6b596130d196fb (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
<!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" />
    <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 }}"}'>

    <main>
        <header>
            <a class="logo" href="/">
                <img src="{% static "img/icon-128.png" %}" width="32">
                {{ config.site_name }}
            </a>
            <menu>
                {% if user.is_authenticated %}
                    <a href="/compose/" title="Compose" {% if top_section == "compose" %}class="selected"{% endif %}>
                        <i class="fa-solid fa-feather"></i> Compose
                    </a>
                    <a href="{% url "settings" %}" title="Settings" {% if top_section == "settings" %}class="selected"{% endif %}>
                        <i class="fa-solid fa-gear"></i> Settings
                    </a>
                    {% if request.user.admin %}
                        <a href="{% url "admin" %}" title="Admin" {% if top_section == "admin" %}class="selected"{% endif %}>
                            <i class="fa-solid fa-toolbox"></i> Admin
                        </a>
                    {% endif %}
                    <div class="gap"></div>
                    <a href="/identity/select/" class="identity">
                        {% if not request.identity %}
                            No Identity
                            <img src="{% static "img/unknown-icon-128.png" %}" title="No identity selected">
                        {% elif request.identity.icon_uri %}
                            {{ request.identity.username }} <small>@{{ request.identity.domain_id }}</small>
                            <img src="{{ request.identity.icon_uri }}" title="{{ request.identity.handle }}">
                        {% else %}
                            {{ request.identity.username }} <small>@{{ request.identity.domain_id }}</small>
                            <img src="{% static "img/unknown-icon-128.png" %}" title="{{ request.identity.handle }}">
                        {% endif %}
                    </a>
                {% else %}
                    <a href="/auth/login/"><i class="fa-solid fa-right-to-bracket"></i> Login</a>
                {% endif %}
            </menu>
        </header>

        {% block content %}
        {% endblock %}
    </main>

</body>
</html>