2020-10-05 15:22:13 +11:00

48 lines
1.6 KiB
HTML

{% extends "interface/project_base.html" %}
{% load md2 %}
{% block admin %}
<a href="{% url 'resource_create' project=project.pk %}"><i class="fas fa-plus-circle"></i> Add new</a>
{% endblock %}
{% block page %}
<div class="narrow">
<h3>Resources</h3>
<div class="list-group narrow">
{% for resource in object_list %}
{% with download=resource.presigned_url %}
<div>
{% if request.is_admin %}
<div class="admin-tools">
<a href="{% url 'resource_upload' project=project.pk pk=resource.pk %}">
<i class="fas fa-upload"></i>
</a>
<a href="{% url 'resource_edit' project=project.pk pk=resource.pk %}">
<i class="fas fa-edit"></i>
</a>
</div>
{% endif %}
<h3>
{{ resource.name }}
{% if download %}
<small><a href="{{ download }}" target="_blank" rel="noopener noreferrer">
<i class="fas fa-download"></i> Download
</a></small>
{% endif %}
</h3>
<p>
<small>{{ resource.description|markdown }}</small>
{% if not resource.visible %}
<br/>(This resource is hidden from participants)
{% endif %}
</p>
{% if download and resource.media_type == 'audio' %}
<audio class="resource-player" controls src="{{ download }}"></audio>
{% endif %}
</div>
{% endwith %}
{% endfor %}
</div>
</div>
{% endblock %}