blob: 8391cca5877dd830d7216d54ee9319c2b32eb817 (
plain) (
tree)
|
|
{% extends 'base.html' %}
{% load markdown_extras %}
{% block content %}
<div class="container">
<div class="row my-4">
<div class="col bg-white pt-3 border border-success border-opacity-25 rounded">
<h1 class="mb-4">{{ resource.name }}</h1>
<div class="d-flex flex-row justify-content-between my-3">
<div>
<span class="fw-bold">Subject:</span> {{ resource.main_resource_category }}
</div>
<div class="px-2">
<span class="fw-bold">Age range:</span> {{ resource.age_range }}
</div>
<div class="px-2">
<span class="fw-bold">Resource type:</span> {{ resource.resource_type }}
</div>
<div class="px-2">
<span class="fw-bold">Number of files:</span> X NUMBER OF FILES
</div>
</div>
<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>
<div class="row my-4">
<div class="col bg-white pt-3 border border-success border-opacity-25 rounded">
<h4>Feature images</h4>
<div class="d-flex flex-row justify-content-between">
{% for tn_url, tn_filename in resource.thumbnails %}
<div class="m-2">
<img class="img-fluid rounded" src="{{ tn_url }}" alt="{{ tn_filename }}" />
</div>
{% endfor %}
</div>
</div>
</div>
{% for snapshot_filename, snapshot_urls in resource.snapshot_urls.items %}
<div class="row my-4">
<div class="col bg-white pt-3 border border-success border-opacity-25 rounded">
<h4>File preview:</h4>
<p>{{ snapshot_filename|cut:".pdf" }}</p>
<div>
<div class="d-flex flex-row justify-content-center flex-wrap">
{% for snapshot_url in snapshot_urls %}
<div class="m-4">
<img class="img-thumbnail rounded"
src="{{ snapshot_url }}"
alt="{{ snapshot_filename }}" />
</div>
{% endfor %}
</div>
</div>
</div>
</div>
{% endfor %}
<div class="row my-5">
<div class="col bg-white pt-3 border border-success border-opacity-25 rounded">
<div>{{ resource.description | markdown | safe }}</div>
</div>
</div>
<div class="row">
<div class="col bg-white pt-3 border border-success border-opacity-25 rounded">
<div class="resource-download-panel">
<h4>Download the resource</h4>
<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>
</div>
</div>
<div>Logged in as {{ request.user.username }}</div>
</div>
</div>
{% endblock content %}
|