aboutsummaryrefslogtreecommitdiffstats
path: root/alphabetlearning/templates/resources/resource_card_featured.html
diff options
context:
space:
mode:
Diffstat (limited to 'alphabetlearning/templates/resources/resource_card_featured.html')
-rw-r--r--alphabetlearning/templates/resources/resource_card_featured.html73
1 files changed, 31 insertions, 42 deletions
diff --git a/alphabetlearning/templates/resources/resource_card_featured.html b/alphabetlearning/templates/resources/resource_card_featured.html
index 0782b0c..2145eb4 100644
--- a/alphabetlearning/templates/resources/resource_card_featured.html
+++ b/alphabetlearning/templates/resources/resource_card_featured.html
@@ -1,59 +1,48 @@
{% load static %}
{% load markdown_extras %}
-<div class="card mx-2 mt-2 my-card-shadow-sm" style="border-color: {{ resource.main_resource_category_colour_css_class }}; border-width: 1px;" onmouseover="this.classList.add('my-card-shadow-lg')" onmouseout="this.classList.remove('my-card-shadow-lg')">
- <img class="card-img-top"
- src="{{ resource.thumbnail_urls|first }}"
- alt="{{ resource.thumbnail_filename }}">
- <div class="card-body">
- <div class="d-flex flex-row justify-content-start align-content-center">
- <h5 class="card-title"><a
- href="{% url 'resources:resource_detail' resource_id=resource.id %}">{{ resource.name }}</a></h5>
+<div class="featured-card" style="border-color: {{ resource.main_resource_category_colour_css_class }};">
+ <img class="featured-img" src="{{ resource.thumbnail_urls|first }}" alt="{{ resource.thumbnail_filename }}">
+ <div>
+ <div>
+ <h5><a href="{% url 'resources:resource_detail' resource_id=resource.id %}">{{ resource.name }}</a></h5>
</div>
- <div class="d-flex flex-row justify-content-start align-items-center mt-2">
- <span class="badge bg-secondary me-2">{{ resource.age_range }}</span>
+ <div>
+ <span>{{ resource.age_range }}</span>
{% if resource.main_resource_category_name == "English as a Foreign Language (EFL)" %}
- <span class="badge me-2"
- style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">EFL</span>
+ <span style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">EFL</span>
{% else %}
- <span class="badge me-2"
- style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">{{ resource.main_resource_category_name }}</span>
+ <span style="background-color: {{ resource.main_resource_category_colour_css_class }}; color: {{ resource.main_resource_badge_foreground_colour }}">{{ resource.main_resource_category_name }}</span>
{% endif %}
{% if request.user.is_authenticated and request.user.is_staff %}
- <span class="badge bg-info me-2">Feature slot: {{ resource.feature_slot }}</span>
+ <span>Feature slot: {{ resource.feature_slot }}</span>
{% endif %}
</div>
- {% if resource.card_description %}
- <div class="text-body-secondary my-2">
- <p>{{ resource.card_description | markdown | safe }}</p>
- </div>
- {% else %}
- <p class="card-text my-2">{{ resource.description | markdown | safe }}</p>
- {% endif %}
- <div class="d-flex flex-row justify-content-between align-items-end mt-2">
- <p class="card-text m-1"><small class="text-muted">1 credit</small></p>
- {% if resource.in_cart %}
- <form action="{% url 'payments:add_to_basket' resource.id %}" method="POST">
- {% csrf_token %}
- <button type="submit" class="btn btn-success fs-6 px-2 py-0" disabled>In basket</button>
- </form>
- {% else %}
- <form action="{% url 'payments:add_to_basket' resource.id %}" method="POST">
- {% csrf_token %}
- <button type="submit" class="btn btn-success fs-6 px-2 py-0">Add to basket</button>
- </form>
- {% endif %}
+ <div>
+ <p class="featured-card-description">{{ resource.card_description }}</p>
+ </div>
+ <div>
+ <p class="card-credit">1 credit</p>
+ <p>{{ resource.price }}</p>
+ {% if resource.in_cart %}
+ <form action="{% url 'payments:add_to_basket' resource.id %}" method="POST">
+ {% csrf_token %}
+ <button type="submit" class="add-to-basket-button-disabled" disabled>In basket</button>
+ </form>
+ {% else %}
+ <form action="{% url 'payments:add_to_basket' resource.id %}" method="POST">
+ {% csrf_token %}
+ <button type="submit" class="add-to-basket-button">Add to basket</button>
+ </form>
+ {% endif %}
</div>
</div>
{% if request.user.is_authenticated and request.user.is_staff %}
- <div class="card-footer">
- <a href="{% url 'resources:resource_update_metadata' resource.id %}"
- class="btn btn-outline-primary btn-sm">Edit</a>
- <a href="{% url 'resources:resource_update_thumbnails' resource.id %}"
- class="btn btn-outline-primary btn-sm">Edit Feature Images</a>
- <a href="{% url 'resources:resource_update_pdfs' resource.id %}"
- class="btn btn-outline-primary btn-sm">Add PDFs</a>
+ <div>
+ <a href="{% url 'resources:resource_update_metadata' resource.id %}">Edit</a>
+ <a href="{% url 'resources:resource_update_thumbnails' resource.id %}">Edit Feature Images</a>
+ <a href="{% url 'resources:resource_update_pdfs' resource.id %}">Add PDFs</a>
</div>
{% endif %}
</div>