{% extends "index.html" %} 
{% block content %}
{% load url from future %}
<h2>Edit bibliography item</h2>
<h4>Citation text:</h4>
<div id="citationText" class="citationText">
	{{ pub.getHtml|safe }}
</div>
<div id="deletePublication">
	<form action="{% url 'deletePublication' pub.id %}" method="post">
		{% csrf_token %}
		<input type="submit" value="Delete publication" />
	</form>
</div>
<h4>PDF upload:</h4>
<div id="pdfUpload">
	{% if pdf_url %} 
		<a href="{{ pdf_url }}">Current PDF file</a> 
	{% endif %}
	{% if uploaded %}
        <p>New PDF file uploaded.</p>
    {% endif %}
	<form action="{% url 'upload' pub.id %}" method="post" enctype="multipart/form-data">
		{% csrf_token %}
		{{ upload_form.as_p }}
		<input type="submit" value="Upload"/>
	</form>
	{% if pdf_url %}
	<form action="{% url 'deletePdf' pub.id %}" method="post">
		{% csrf_token %}
		<input type="submit" value="Delete file" />
	</form>
	{% endif %}
</div>
<h4>Bibtex:</h4>
<div id="bibtexEdit">
	<textarea rows="20" cols="120" readonly="true">{{ pub.bibtex }}</textarea>
</div>
{% endblock %}
