aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/templates/resources/resource_list.html
blob: 2ef0d48fc4cfaf57e8921495913208d2b0cdc6e6 (plain) (blame)
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
88
89
90
91
92
93
94
{% extends "base.html" %}
{% load static %}
{% load markdown_extras %}
{% block title %}
    Joanna Lemon Learning - Resource List
{% endblock title %}
{% block content %}

    <div class="row my-4">
        {% include "resources/admin_bar.html" %}
    </div>

    {# featured resources #}
    {% if featured_resources %}
        <div class="row my-4 text-center">
            <h5 class="display-6">Featured resources</h5>
        </div>

        <div class="row">
        {% for featured_resource in featured_resources %}
            {% if featured_resources|length == 1 %}
                <div class="col-lg-12 col-md-12 col-sm-12 mb-4">
            {% elif featured_resources|length == 2 %}
                <div class="col-lg-6 col-md-6 col-sm-12 mb-4">
            {% elif featured_resources|length == 3 %}
                <div class="col-lg-4 col-md-6 col-sm-12 mb-4">
            {% endif %}
        {% include "resources/resource_card_featured.html" with resource=featured_resource %}
        </div>
        {% endfor %}
    </div>
    {% else %}
        <p>There are no featured resources</p>
    {% endif %}

{# standard resources #}
{% if page_obj.object_list %}
    <div class="row my-4 text-center">
        <div class="col">
            <h5 class="display-6">Standard resources</h5>
        </div>
    </div>

    <div class="d-flex flex-row flex-wrap">
        {% for resource in page_obj.object_list %}
            {% include "resources/resource_card_standard.html" with resource=resource %}
        {% endfor %}
    </div>

    {% if page_obj.has_other_pages %}
        <div class="row my-4">
            <div class="col">
                <nav aria-label="Page navigation">
                    <ul class="pagination justify-content-center">
                        {% if page_obj.has_previous %}
                            <li class="page-item">
                                <a class="page-link" href="?page={{ page_obj.previous_page_number }}">Previous</a>
                            </li>
                        {% else %}
                            <li class="page-item disabled">
                                <span class="page-link">Previous</span>
                            </li>
                        {% endif %}

                        {% for page_num in page_obj.paginator.page_range %}
                            {% if page_obj.number == page_num %}
                                <li class="page-item active">
                                    <span class="page-link">{{ page_num }}</span>
                                </li>
                            {% else %}
                                <li class="page-item">
                                    <a class="page-link" href="?page={{ page_num }}">{{ page_num }}</a>
                                </li>
                            {% endif %}
                        {% endfor %}

                        {% if page_obj.has_next %}
                            <li class="page-item">
                                <a class="page-link" href="?page={{ page_obj.next_page_number }}">Next</a>
                            </li>
                        {% else %}
                            <li class="page-item disabled">
                                <span class="page-link">Next</span>
                            </li>
                        {% endif %}
                    </ul>
                </nav>
            </div>
        </div>
    {% endif %}
{% else %}
    <p>There are no resources</p>
{% endif %}
{% endblock content %}