aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/templates
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-05-15 16:28:41 +0100
committerMatthew Lemon <y@yulqen.org>2024-05-15 16:28:41 +0100
commitcf0ceb545421c58acc9478fc376b51065f97e532 (patch)
tree26ab2b9eebd6b03febec1bdb498742c50c8b7253 /pyblackbird_cc/templates
parent8d1f465ceb2f5e357b19b6e4c8468703725b4795 (diff)
Basic form to update Resource metadata
Diffstat (limited to 'pyblackbird_cc/templates')
-rw-r--r--pyblackbird_cc/templates/resources/resource_detail.html18
-rw-r--r--pyblackbird_cc/templates/resources/resource_metadata_update.html26
2 files changed, 42 insertions, 2 deletions
diff --git a/pyblackbird_cc/templates/resources/resource_detail.html b/pyblackbird_cc/templates/resources/resource_detail.html
index 6daa42b..70c1b11 100644
--- a/pyblackbird_cc/templates/resources/resource_detail.html
+++ b/pyblackbird_cc/templates/resources/resource_detail.html
@@ -19,8 +19,22 @@
<span class="fw-bold">Number of files:</span> X NUMBER OF FILES
</div>
</div>
- <div>
- <span class="fw-bold">Created:</span> {{ resource.created|date:"D d M Y" }}
+ <div class="d-flex flex-row justify-content-between my-3 flex-wrap">
+ <div>
+ <span class="fw-bold">Created:</span> {{ resource.created|date:"D d M Y" }}
+ </div>
+ <div>
+ {% if request.user.is_authenticated and request.user.is_staff %}
+ <a href="{% url "resources:resource_update_metadata" resource.id %}"
+ class="text-danger">Edit this resource</a>
+ {% endif %}
+ </div>
+ <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="#" class="text-danger">Replace the preview images</a>{% endif %}
+ </div>
</div>
</div>
</div>
diff --git a/pyblackbird_cc/templates/resources/resource_metadata_update.html b/pyblackbird_cc/templates/resources/resource_metadata_update.html
new file mode 100644
index 0000000..bb37ea1
--- /dev/null
+++ b/pyblackbird_cc/templates/resources/resource_metadata_update.html
@@ -0,0 +1,26 @@
+{% extends "base.html" %}
+
+{% load static %}
+{% load crispy_forms_tags %}
+
+{% block title %}
+ Joanna Lemon Resources - Update Resource
+{% endblock title %}
+{# {% block extra_css %}#}
+{# <link rel="stylesheet" href="{% static 'css/forms.css' %}">#}
+{# {% endblock %}#}
+{% 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">
+ <h2>Update this resource</h2>
+ <p>{% lorem %}</p>
+ <form action="{% url 'resources:resource_update_metadata' resource.id %}"
+ method="post">
+ {% csrf_token %}
+ {{ form|crispy }}
+ {# now for the submit button #}
+ <button type="submit" class="btn btn-primary">Submit</button>
+ </form>
+ </div>
+ </div>
+{% endblock content %}