~linuxgoose/bocpress

ref: 849fe77446d4c2485f9f0409f02cbbc7c3cfa756 bocpress/main/templates/main/post_list.html -rw-r--r-- 1.8 KiB
849fe774Jordan Robinson update tags filtering functionality to allow for multiple tags to be filtered on 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
{% extends 'main/layout.html' %}

{% block title %}Posts — {{ request.user.username }}{% endblock %}

{% block content %}
<main>
    <h1>Posts</h1>
    <p>
        <a href="{% url 'post_create' %}">Create a new post »</a>
    </p>
    {% if post_list %}

    {% if tag_cloud and request.user.show_tags_in_post_list %}
    <div class="tag-cloud">
        All tags:
        {% for tag, url, is_active in tag_cloud %}
            <a href="{{ url }}" class="tag {% if is_active %}active{% endif %}">{{ tag }}</a>
        {% endfor %}
    </div>
    {% endif %}

    <p>
        List of posts:
    </p>
    <ul>
        {% for item in posts_with_tag_urls %}
        <li>
            <a href="{% url 'post_detail' item.post.slug %}">
                {{ item.post.title }}
            </a>
            {% if item.post.tag_list and request.user.show_tags_in_post_list %}
                <small><b>Tags</b>:
                    {% for tag, url, is_active in item.tag_urls %}
                        <a href="{{ url }}" class="tag {% if is_active %}active{% endif %}">{{ tag }}</a>
                        {% if not forloop.last %}, {% endif %}
                    {% endfor %}
                </small>
            {% endif %}
            <small><b>Published on</b>:
                {% if item.post.is_published %}
                <time datetime="{{ item.itempost.published_at|date:'Y-m-d' }}" itemprop="datePublished">{{ item.post.published_at|date:'F j, Y' }}
                </time>
                {% endif %}
                {% if not item.post.is_published %}
                — DRAFT/SCHEDULED
                {% endif %}
            </small>
        </li>
        {% endfor %}
    </ul>
    {% endif %}
</main>
{% endblock content %}