{% extends 'main/header.html' %}

{% block content %}
	<h2>Booklist</h2>
	<p>
		<a href="{% url 'chemie-video-upload' %}" class="btn btn-primary">Upload Videos</a>
	</p>
	<table class="table">
		<thead>
			<tr>
				<th>Title</th>
				<th>Tags</th>
				<th>Download</th>
				<th>Delete</th>
			</tr>
		</thead>
		<tbody>
			{% for video in videos %}
				<tr>
					<td>{{ video.title }}</td>
					<td>{{ video.tags }}</td>
					<td>
						<a href="{{ video.media.url }}" class="btn btn-primary btn-small" target="_blank">
						Download pdf</a>
					</td>
					<td> 
						<form method="post" action="{% url 'chemie-video-delete' video.pk %}">
							{% csrf_token %}
							<button type="submit" class="btn btn-danger btn-small red darken-1">Delete</button>
						</form>
					</td>
				</tr>
			{% endfor %}
		</tbody>
	</table>
{% endblock %}