aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/templates
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-08-03 17:24:35 +0100
committerMatthew Lemon <y@yulqen.org>2024-08-03 17:24:35 +0100
commit1afd527efe4e2a1a481b9cf52cdd915356b1d58a (patch)
tree059374a13ce3fec6979e34a3645a5f48b2a13eb8 /pyblackbird_cc/templates
parent7b757fcd38ca560139aa3c4c86ae57b4c6afe2dd (diff)
Adds ability to update the thumbnail/feature images
Diffstat (limited to 'pyblackbird_cc/templates')
-rw-r--r--pyblackbird_cc/templates/resources/resource_card.html2
-rw-r--r--pyblackbird_cc/templates/resources/resource_detail.html3
-rw-r--r--pyblackbird_cc/templates/resources/update_thumbnails.html29
3 files changed, 31 insertions, 3 deletions
diff --git a/pyblackbird_cc/templates/resources/resource_card.html b/pyblackbird_cc/templates/resources/resource_card.html
index 67807cc..687438c 100644
--- a/pyblackbird_cc/templates/resources/resource_card.html
+++ b/pyblackbird_cc/templates/resources/resource_card.html
@@ -37,6 +37,8 @@
<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>
</div>
{% endif %}
</div> \ No newline at end of file
diff --git a/pyblackbird_cc/templates/resources/resource_detail.html b/pyblackbird_cc/templates/resources/resource_detail.html
index f520340..4a513af 100644
--- a/pyblackbird_cc/templates/resources/resource_detail.html
+++ b/pyblackbird_cc/templates/resources/resource_detail.html
@@ -34,9 +34,6 @@
<div>
{% if request.user.is_authenticated %}<a href="#" class="text-danger">Replace the PDFs</a>{% endif %}
</div>
- <div>
- {% if request.user.is_authenticated %}<a href="{% url "resources:resource_update_thumbnails" resource.id %}" class="text-danger">Replace the preview images</a>{% endif %}
- </div>
</div>
</div>
</div>
diff --git a/pyblackbird_cc/templates/resources/update_thumbnails.html b/pyblackbird_cc/templates/resources/update_thumbnails.html
new file mode 100644
index 0000000..e473a00
--- /dev/null
+++ b/pyblackbird_cc/templates/resources/update_thumbnails.html
@@ -0,0 +1,29 @@
+{% extends "base.html" %}
+{% load static %}
+{% load crispy_forms_tags %}
+
+{% block content %}
+ <div class="row d-flex justify-content-center">
+ <div class="col bg-light mt-lg-4 p-4 border border-success border-opacity-25 rounded">
+ <h1>Update feature images for <strong>{{ resource.name }}</strong> resource</h1>
+
+ <p>The current thumbnails for this resource are:</p>
+
+ <ul>
+ {% for t in resource.thumbnail_filenames %}
+ <li><em>{{ t }}</em></li>
+ {% endfor %}
+ </ul>
+
+ <form action="{% url "resources:resource_update_thumbnails" resource.id %}"
+ method="post" enctype="multipart/form-data">
+ {% csrf_token %}
+ {% crispy form form.helper %}
+ </form>
+
+ <button class="btn btn-danger" onclick="location.href='{{ resource.get_absolute_url }}';">Cancel</button>
+ </div>
+ </div>
+
+
+{% endblock %}