diff options
author | Matthew Lemon <y@yulqen.org> | 2024-05-14 12:53:28 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-05-14 12:53:28 +0100 |
commit | 46f11648d902b22a177b878e35d6049a7a127ce7 (patch) | |
tree | f59f6630717bc9097c988a6d8d3eebe4ad548f1d /pyblackbird_cc/templates/resources/resource_list.html | |
parent | b5e2c4b9a7aab20db6dd6072a01abd114e8e55de (diff) |
Can now upload to Spaces
Diffstat (limited to 'pyblackbird_cc/templates/resources/resource_list.html')
-rw-r--r-- | pyblackbird_cc/templates/resources/resource_list.html | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/pyblackbird_cc/templates/resources/resource_list.html b/pyblackbird_cc/templates/resources/resource_list.html new file mode 100644 index 0000000..5b11ff6 --- /dev/null +++ b/pyblackbird_cc/templates/resources/resource_list.html @@ -0,0 +1,61 @@ +{% extends "base.html" %} + +{% block title %} + Joanna Lemon Resources - Resource List +{% endblock title %} +{% block content %} + <div class="cella"> + {% if request.user.is_authenticated %} + <div class="admin-links"> + <div> + <a href="{% url 'resources:create_resource' %} ">Add a new resource</a> + </div> + <div> + <form action="{% url 'account_logout' %}" method="post"> + {% csrf_token %} + <button type="submit">Log out</button> + </form> + </div> + </div> + {% endif %} + {% if resource_list %} + {% for resource in resource_list %} + <div class="resource-metadata-panel"> + <div> + <a class="no-underline" + href="{% url 'resources:resource_detail' resource_id=resource.id %}"> + <h1 class="resource-title">{{ resource.name }}</h1> + </a> + </div> + <div> + <div>Main category: {{ resource.main_resource_category_name }}</div> + {% if resource.additional_resource_category_name %} + <div>Additional category: {{ resource.additional_resource_category_name }}</div> + {% endif %} + </div> + </div> + <div> + <div class="resource-img-detail"> + {% for img in resource.thumbnail_urls %} + <img style="max-height: 400px; + width: auto" + src="{{ img }}" + alt="{{ resource.thumbnail_filename }}" /> + {% endfor %} + </div> + <div> + Click + <button hx-get="/hx-download-btn?rn={{ resource.pdf_filename }}" + hx-target="next #download-reveal">here</button> + to download the resource + </div> + <div id="download-reveal"></div> + <hr /> + </div> + {% endfor %} + {% else %} + <p>There are no resources</p> + {% endif %} + </div> + <div>Logged in as {{ request.user.username }}</div> +{% endblock content %} |