{% extends "base.html" %}

{% block content %}
		<h1>{{ publication.title }}</h1>

		<section id="publication-meta">
			<h2>Metadata</h2>
			<table class="table table-striped table-condensed">
				<tr>
					<th>Publication year</th>
					<td>{{ publication.year }}</td>
				</tr>
				{% if publication.type is not none %}
				<tr>
					<th>Publication type</th>
					<td>{{ publication.type }}</td>
				</tr>
				{% endif %}
				{% if publication.times_cited is not none %}
				<tr>
					<th>Times cited</th>
					<td>{{ publication.times_cited }}</td>
				</tr>
				{% endif %}
			</table>
		</section>

		<section id="authors">
			<h2>Authors</h2>
			<table class="table table-striped table-condensed">
				<thead>
					<tr>
						<th>Name</th>
						<th>Affiliation</th>
					</tr>
				</thead>
				<tbody>
					{% for affiliation in publication.affiliations %}
					<tr{% if affiliation.is_corresponding %} class="corresponding"{% endif %}>
						<td><a href="{{ url_for('author', author_id=affiliation.author.id) }}">{{ affiliation.author.name }}</a></td>
						<td><a href="{{ url_for('institution', institution_id=affiliation.institution.id) }}">{{ affiliation.institution.name }}</a></td>
					</tr>
					{% endfor %}
				</tbody>
			</table>
		</section>

		<section>
			<h2>Institutions</h2>
			<table class="table table-striped table-condensed">
				<thead>
					<tr>
						<th>Name</th>
					</tr>
				</thead>
				<tbody>
					{%- for institution in publication.institutions %}
					<tr id="institution-{{ institution.id }}">
						<td><a href="{{ url_for('institution', institution_id=institution.id) }}">{{ institution.name }}</a></td>
					</tr>
					{%- endfor %}
				</tbody>
			</table>
		</section>

		<section>
			<h2>Source information</h2>
			<dl>
				<dt><acronym title="Unique Source Identifier">USID</acronym></dt>
				<dd>{{ publication.unique_source_id }}</dd>
				<dt>Record format</dt>
				<dd>{{ publication.unparsed_record_format }}</dd>
				<dt>Record content</dt>
				<dd>{{ publication|format_record }}</dd>
				<dt>Raw record</dt>
				<dd>
					<pre>{{ publication.unparsed_record_value }}</pre>
				</dd>
			</dl>
		</section>
{% endblock %}
