aboutsummaryrefslogtreecommitdiff
path: root/weblog/templates/weblog/weblog.html
blob: e1907c614867118bfd85234bd8d18462516ed45e (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
{% extends base_template %}
{% load i18n %}
{% load weblog_extras %}
{% block title_block %}{% endblock %}
{% block blog_block %}
<ul class="breadcrumb">
    {% if breadcrumbs %}
    <li><a href="{% url 'weblog:Index' %}">{{ blog_title }}</a></li>
    {% for crumb in breadcrumbs %}
    {% if forloop.last %}
    <li><a href="#">{{ crumb.name }}</a></li>
    {% else %}<li><a href="{{ crumb.url }}">{{ crumb.name }}</a></li>{% endif %}
    {% endfor %}
    {% else %}
    <li><a href="{% url 'weblog:Index' %}">{{ blog_title }}</a></li>
    {% endif %}
</ul>
<div class="blog-wrapper">
    <div class="blog-content">
        {% block blog_content_block %}
        {% endblock %}
    </div>
    {% if show_sidebar %}
    {% if floating_sidebar %}
    <div class="sidebar-filler hidden"></div>
    {% endif %}
    <div class="weblog-sidebar{% if floating_sidebar %} floating-sidebar{% endif %}">
        {% if show_categories %}
        {% if category %}
        {% if category == 'misc' %}
        {% get_sidebar_categories category %}
        {% else %}
        {% get_sidebar_categories category.slug %}
        {% endif %}
        {% else %}
        {% get_sidebar_categories %}
        {% endif %}
        {% endif %}
        {% if show_archive %}
        {% get_sidebar_archive %}
        {% endif %}
    </div>
    {% endif %}
</div>
{% if floating_sidebar %}
    <script>
        window.addEventListener("load", function(){
            var sb_width = document.querySelector(".weblog-sidebar.floating-sidebar").offsetWidth;
            var sidebar_filler = document.querySelector(".sidebar-filler");
            sidebar_filler.style.width = sb_width+"px";
            sidebar_filler.style.height = "10px";
            window.addEventListener("scroll", floatSidebar);
        });
    </script>
{% endif %}
{% endblock %}