aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/templates/resources/update_pdfs.html
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-08-03 21:39:57 +0100
committerMatthew Lemon <y@yulqen.org>2024-08-03 21:39:57 +0100
commitfd1bc6777df5b4c85c899e3bcdd1293a6bead630 (patch)
treef4fbb16bfdb6c5883df64d01e8bd4ea20a2875c5 /pyblackbird_cc/templates/resources/update_pdfs.html
parenta06c426edc3bb33deab2e55c2dcd5f5c3b2f3504 (diff)
Add feature to add PDFs to resources
Implemented the ability to upload and manage PDFs for resources. Added the necessary form, view, and templates to support this functionality. Updated routes and UI elements to integrate the new feature seamlessly.
Diffstat (limited to '')
-rw-r--r--pyblackbird_cc/templates/resources/update_pdfs.html29
1 files changed, 29 insertions, 0 deletions
diff --git a/pyblackbird_cc/templates/resources/update_pdfs.html b/pyblackbird_cc/templates/resources/update_pdfs.html
new file mode 100644
index 0000000..f5dab72
--- /dev/null
+++ b/pyblackbird_cc/templates/resources/update_pdfs.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 PDFs for <strong>{{ resource.name }}</strong> resource</h1>
+
+ <p>The current PDFs for this resource are:</p>
+
+ <ul>
+ {% for pdf in resource.get_pdf_file_names %}
+ <li><em>{{ pdf }}</em></li>
+ {% endfor %}
+ </ul>
+
+ <form action="{% url "resources:resource_update_pdfs" 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 %}