moviewyrm/bookwyrm/templates/author/author.html

161 lines
6.4 KiB
HTML
Raw Normal View History

2020-02-11 06:32:03 +00:00
{% extends 'layout.html' %}
{% load i18n %}
2021-05-11 22:14:42 +00:00
{% load markdown %}
2021-05-11 00:24:10 +00:00
{% load humanize %}
{% load utilities %}
{% block title %}{{ author.name }}{% endblock %}
2020-02-11 06:32:03 +00:00
{% block content %}
2020-09-30 23:20:50 +00:00
<div class="block">
2021-02-23 21:04:24 +00:00
<div class="columns is-mobile">
<div class="column">
<h1 class="title">{{ author.name }}</h1>
</div>
{% if request.user.is_authenticated and perms.bookwyrm.edit_book %}
<div class="column is-narrow">
2021-12-05 21:24:40 +00:00
<a href="{% url 'edit-author' author.id %}">
2021-05-18 17:45:51 +00:00
<span class="icon icon-pencil" title="{% trans 'Edit Author' %}" aria-hidden="True"></span>
<span class="is-hidden-mobile">{% trans "Edit Author" %}</span>
</a>
</div>
{% endif %}
</div>
</div>
<div class="block columns is-flex-direction-row-reverse" itemscope itemtype="https://schema.org/Person">
2021-05-23 19:17:14 +00:00
<meta itemprop="name" content="{{ author.name }}">
{% if author.bio %}
<div class="column">
{% include "snippets/trimmed_text.html" with full=author.bio trim_length=200 %}
</div>
{% endif %}
2021-05-23 19:17:14 +00:00
{% firstof author.aliases author.born author.died as details %}
{% firstof author.wikipedia_link author.openlibrary_key author.inventaire_id author.isni as links %}
{% if details or links %}
2021-05-24 10:51:18 +00:00
<div class="column is-two-fifths">
{% if details %}
<section class="block content">
<h2 class="title is-4">{% trans "Author details" %}</h2>
<dl class="box">
2021-05-11 00:24:10 +00:00
{% if author.aliases %}
<div class="is-flex is-flex-wrap-wrap mr-1">
2021-05-24 10:51:18 +00:00
<dt class="has-text-weight-bold mr-1">{% trans "Aliases:" %}</dt>
<dd>
{% include "snippets/trimmed_list.html" with items=author.aliases itemprop="alternateName" %}
</dd>
2021-05-11 00:24:10 +00:00
</div>
{% endif %}
2021-05-24 15:17:12 +00:00
2021-05-11 00:24:10 +00:00
{% if author.born %}
<div class="is-flex mt-1">
2021-05-24 10:51:18 +00:00
<dt class="has-text-weight-bold mr-1">{% trans "Born:" %}</dt>
2021-05-23 19:17:14 +00:00
<dd itemprop="birthDate">{{ author.born|naturalday }}</dd>
2021-05-11 00:24:10 +00:00
</div>
{% endif %}
2021-05-24 15:17:12 +00:00
2021-05-23 18:25:42 +00:00
{% if author.died %}
<div class="is-flex mt-1">
2021-05-24 10:51:18 +00:00
<dt class="has-text-weight-bold mr-1">{% trans "Died:" %}</dt>
2021-05-23 19:17:14 +00:00
<dd itemprop="deathDate">{{ author.died|naturalday }}</dd>
2021-05-11 00:24:10 +00:00
</div>
{% endif %}
</dl>
</section>
{% endif %}
{% if links %}
<section>
<h2 class="title is-4">{% trans "External links" %}</h2>
<div class="box">
{% if author.wikipedia_link %}
2021-12-07 20:30:21 +00:00
<div>
<a itemprop="sameAs" href="{{ author.wikipedia_link }}" rel="noopener" target="_blank">
{% trans "Wikipedia" %}
</a>
2021-12-07 20:30:21 +00:00
</div>
2021-12-05 21:02:42 +00:00
{% endif %}
{% if author.isni %}
2021-12-07 20:30:21 +00:00
<div class="mt-1">
<a itemprop="sameAs" href="{{ author.isni_link }}" rel="noopener" target="_blank">
{% trans "View ISNI record" %}
</a>
2021-12-07 20:30:21 +00:00
</div>
2021-12-05 21:02:42 +00:00
{% endif %}
2021-12-07 20:30:21 +00:00
{% trans "Load data" as button_text %}
{% if author.openlibrary_key %}
2021-12-07 20:30:21 +00:00
<div class="mt-1 is-flex">
<a class="mr-3" itemprop="sameAs" href="{{ author.openlibrary_link }}" target="_blank" rel="noopener">
{% trans "View on OpenLibrary" %}
</a>
{% if request.user.is_authenticated and perms.bookwyrm.edit_book %}
2021-12-07 20:30:21 +00:00
{% with controls_text="ol_sync" controls_uid=author.id %}
{% include 'snippets/toggle/toggle_button.html' with text=button_text focus="modal_title_ol_sync" class="is-small" icon_with_text="download" %}
2021-12-07 20:41:11 +00:00
{% include "author/sync_modal.html" with source="openlibrary.org" source_name="OpenLibrary" %}
2021-12-07 20:30:21 +00:00
{% endwith %}
{% endif %}
2021-12-07 20:30:21 +00:00
</div>
{% endif %}
{% if author.inventaire_id %}
2021-12-07 20:30:21 +00:00
<div class="mt-1 is-flex">
<a class="mr-3" itemprop="sameAs" href="{{ author.inventaire_link }}" target="_blank" rel="noopener">
{% trans "View on Inventaire" %}
</a>
2021-12-07 20:30:21 +00:00
{% if request.user.is_authenticated and perms.bookwyrm.edit_book %}
2021-12-07 20:30:21 +00:00
{% with controls_text="iv_sync" controls_uid=author.id %}
{% include 'snippets/toggle/toggle_button.html' with text=button_text focus="modal_title_iv_sync" class="is-small" icon_with_text="download" %}
{% include "author/sync_modal.html" with source="inventaire.io" source_name="Inventaire" %}
{% endwith %}
{% endif %}
2021-12-07 20:30:21 +00:00
</div>
{% endif %}
{% if author.librarything_key %}
2021-12-07 20:30:21 +00:00
<div class="mt-1">
<a itemprop="sameAs" href="https://www.librarything.com/author/{{ author.librarything_key }}" target="_blank" rel="noopener">
{% trans "View on LibraryThing" %}
</a>
2021-12-07 20:30:21 +00:00
</div>
{% endif %}
{% if author.goodreads_key %}
2021-12-07 20:30:21 +00:00
<div>
<a itemprop="sameAs" href="https://www.goodreads.com/author/show/{{ author.goodreads_key }}" target="_blank" rel="noopener">
{% trans "View on Goodreads" %}
</a>
2021-12-07 20:30:21 +00:00
</div>
{% endif %}
</div>
</section>
2021-05-11 00:24:10 +00:00
{% endif %}
</div>
{% endif %}
</div>
<hr aria-hidden="true">
2020-09-30 23:20:50 +00:00
<div class="block">
<h2 class="title is-4">{% blocktrans with name=author.name %}Books by {{ name }}{% endblocktrans %}</h2>
<div class="columns is-multiline is-mobile">
{% for book in books %}
<div class="column is-one-fifth-tablet is-half-mobile is-flex is-flex-direction-column">
<div class="is-flex-grow-1">
{% include 'landing/small-book.html' with book=book %}
</div>
{% include 'snippets/shelve_button/shelve_button.html' with book=book %}
</div>
{% endfor %}
</div>
2020-02-11 06:32:03 +00:00
</div>
2021-10-21 00:42:19 +00:00
<div>
{% include 'snippets/pagination.html' with page=books %}
</div>
2020-02-11 06:32:03 +00:00
{% endblock %}