Files
vrobbler/vrobbler/templates/books/paper_detail.html

63 lines
3.5 KiB
HTML

{% extends "base_list.html" %}
{% block title %}{{object.title}}{% endblock %}
{% block lists %}
<div class="row">
<div class="col">
<h1>{{object.title}}</h1>
{% if object.authors.all %}
<p>{{object.authors.all|join:", "}}</p>
{% endif %}
{% if object.journal %}
<p><em>{{object.journal.title}}{% if object.journal_volume %}, vol. {{object.journal_volume}}{% endif %}</em></p>
{% endif %}
{% if object.doi_id %}
<p><a href="https://doi.org/{{object.doi_id}}">doi: {{object.doi_id}}</a></p>
{% endif %}
{% if object.abstract %}
<p>{{object.abstract|linebreaks|truncatewords:200}}</p>
{% endif %}
{% if object.pdf_file %}
<button class="btn btn-outline-secondary btn-sm" onclick="togglePdf()">Show/Hide PDF</button>
<div id="pdf-embed" style="display:none; margin-top:0.5rem;">
<iframe src="{{object.pdf_file.url}}" style="width:100%;height:600px;border:1px solid #ccc;"></iframe>
</div>
<script>
function togglePdf() {
var el = document.getElementById('pdf-embed');
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
</script>
{% endif %}
{% if object.openaccess_pdf_url %}
<p><a href="{{object.openaccess_pdf_url}}">Open Access PDF</a></p>
{% endif %}
{% if object.pdf_file %}
<a href="{{object.pdf_file.url}}">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="text-danger" viewBox="0 0 16 16">
<path d="M14 14V4.5L9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2zM9.5 3A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5v2z"/>
<path d="M4.603 14.087a.81.81 0 0 1-.438-.42c-.195-.388-.13-.776.08-1.102.197-.307.526-.568.897-.707.07-.024.15-.023.222 0l.044.014a.27.27 0 0 1 .152.295.7.7 0 0 1-.128.416c-.159.206-.344.388-.544.555-.357.299-.592.527-.406.623.08.04.272.045.578-.057a.93.93 0 0 0 .363-.226.8.8 0 0 0 .194-.277.28.28 0 0 1 .414-.112.3.3 0 0 1 .065.422 1.3 1.3 0 0 1-.67.522c-.38.147-.746.103-1.04.02zM7.12 11.5c.16-.186.34-.34.486-.514.294-.35.628-.617.947-.786.204-.108.546-.206.715-.153.087.027.135.068.16.126a.6.6 0 0 1-.003.27 1 1 0 0 1-.158.354c-.163.242-.349.47-.7.769-.332.283-.598.483-.793.607a1.1 1.1 0 0 1-.582.214c-.136 0-.234-.038-.298-.11-.05-.056-.076-.134-.07-.236a.99.99 0 0 1 .098-.45c.08-.17.21-.35.378-.57zm5.09 2.013c-.135.06-.277.104-.428.116-.205.015-.39-.048-.553-.177-.104-.082-.226-.196-.317-.325a1 1 0 0 1-.17-.572c0-.15.035-.27.095-.36.04-.063.089-.098.153-.112.138-.028.316.04.477.174.074.061.145.136.228.232.174.2.302.37.397.515.108.164.153.285.121.345a.25.25 0 0 1-.003.053c0 .079-.05.147-.198.262z"/>
</svg>
</a>
{% endif %}
{% if object.scihub_url %}
<p><a href="{{object.scihub_url}}">View on Sci-Hub</a></p>
{% endif %}
</div>
</div>
<hr>
<div class="row">
<div class="col">
<form method="post" enctype="multipart/form-data" action="{% url 'books:paper_upload_pdf' slug=object.uuid %}">
{% csrf_token %}
<div class="form-group">
<label for="pdf_file">Upload PDF</label>
<input type="file" class="form-control-file" id="pdf_file" name="pdf_file" accept=".pdf,application/pdf">
</div>
<button type="submit" class="btn btn-primary btn-sm">Upload</button>
</form>
</div>
</div>
{% endblock %}