aboutsummaryrefslogtreecommitdiffstats
path: root/alphabetlearning/templates/resources/resource_detail.html
blob: 334f4edc2e88ec200983c016382f8468b73bea89 (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
{% extends 'base.html' %}

{% load markdown_extras %}

{% block content %}

<div class="row my-4">
    <div class="col-md-7">
        {% for tn_url, tn_filename in resource.thumbnails %}
        <div>
            <img class="img-fluid rounded mx-1" src="{{ tn_url }}" alt="{{ tn_filename }}"/>
        </div>
        {% endfor %}
    </div> 
    <div class="col-md-5">
        <div class="row">
            <div class="col">
                <p class="my-1 fw-bold fs-3">{{ resource.name }}</p>
            </div> 
        </div>
        <div class="d-flex justify-content-between align-items-center">
            <div>
                <p class="boo-magenta my-1 fw-semibold fs-5">{{ resource.main_resource_category }}</p>
            </div> 
            <div>
                <p class="text-secondary my-1 fw-semibold fs-5">{{ resource.age_range }}</p>
            </div>
        </div>

        <div class="col">
            {% if resource.pdf_filenames|length > 1 %} 
                <p class="text-secondary my-1">Contains {{ resource.pdf_filenames|length }} PDF files.</p>
            {% else %}
                <p class="text-secondary my-1">Contains {{ resource.pdf_filenames|length }} PDF file.</p>
            {% endif %}
        </div>
        <div class="col">
            <p class="fs-3 fw-semibold">£{{ resource.price|floatformat:2 }} (or 1 credit)</p>
        </div>

        <hr>

        <div class="row">
            <div class="col">
                <p class="my-1 fw-semibold fs-5">Product summary</p>
                <p>{{resource.card_description}}</p>
            </div> 
        </div>
        <div class="row align-items-end">
            <div class="my-4 d-flex">
                {% if resource.in_cart %}
                    <form action="{% url 'payments:add_to_basket' resource.id  %}" method="get" accept-charset="utf-8">
                        <button class="btn btn-primary" disabled>
                            In basket
                        </button>
                    </form>
                {% else %}
                    <form action="{% url 'payments:add_to_basket' resource.id  %}" method="get" accept-charset="utf-8">
                        <button class="btn btn-primary">
                            Add to basket
                        </button>
                    </form>

                {% endif %}
            </div>
        </div>
    </div> 
</div>

<!-- Here be the carousel stuff -->
<!-- except we are doing away with the carousel in this design -->
<div class="d-flex justify-content-start">
    {% for snapshot_filename, snapshot_urls in resource.snapshot_urls.items %}
    {% for snapshot_url in snapshot_urls %}
    <div>
        <img src="{{ snapshot_url }}" class="d-block mx-auto img-thumbnail rounded" alt="{{ snapshot_name }}">
    </div>
    {% endfor %}
    {% endfor %}
</div>

<!-- detailed description row -->
<div class="row py-4">
    <div class="col-12">
        <h4>Product detail</h4>
        {{ resource.description | markdown | safe }}
    </div>
</div>

{% endblock content %}