~linuxgoose/bocpress

ref: 74b8eaa5e0e62bc5f51c755585a7239e21126e49 bocpress/main/templates/main/page_detail.html -rw-r--r-- 1.7 KiB
74b8eaa5Jordan Robinson fix button text colour on dark mode 2 months ago
                                                                                
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
{% extends 'main/layout.html' %}

{% block title %}{{ page.title }}{{ blog_user.blog_title }}{% endblock %}

{% block meta_description %}{{ page.body|truncatewords:16 }}{% endblock %}

{% block head_rsl_license %}
{% include 'partials/rsl_license_head.html' %}
{% endblock head_rsl_license %}

{% block head_extra %}
<style>

    /* Light theme */
    @media (prefers-color-scheme: light) {
    {{ light_css|safe }}
    }

    /* Dark theme */
    @media (prefers-color-scheme: dark) {
    {{ dark_css|safe }}
    }
</style>
{% endblock head_extra %}

{% block content %}
<main>
    {% if blog_user.blog_title %}
    <a href="{% url 'index' %}" class="pages-item-brand">{{ blog_user.blog_title }}</a>
    {% endif %}

    <h1 class="pages-item-title">{{ page.title }}</h1>

    {% if request.user.is_authenticated and request.subdomain == user.username %}
    <div class="pages-item-byline">
        Last updated on <time datetime="{{ page.updated_at|date:'Y-m-d' }}">{{ page.updated_at|date:'F j, Y' }}</time>
        | <a href="{% url 'page_update' page.slug %}">Edit page</a>
        | <a href="{% url 'page_delete' page.slug %}">Delete page</a>
    </div>
    {% endif %}

    <div class="pages-item-body">
        {{ page.body_as_html|safe }}
    </div>
</main>

{% include 'partials/webring.html' %}

{% include 'partials/footer_blog.html' %}

{% endblock content %}

{% block scripts %}
{% if not blog_user.comments_on %}
<script>
    window.addEventListener('keypress', function (evt) {
        if (evt.key === 'u') {
            document.location.assign('/pages');
        } else if (evt.key === 'e') {
            let url = document.location.pathname + 'edit';
            document.location.assign(url);
        }
    });
</script>
{% endif %}
{% endblock scripts %}