moviewyrm/bookwyrm/templates/author/author.html

160 lines
6.5 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>
2022-01-17 03:38:21 +00:00
<div class="block columns" itemscope itemtype="https://schema.org/Person">
2021-05-23 19:17:14 +00:00
<meta itemprop="name" content="{{ author.name }}">
{% 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 %}
2022-01-17 03:38:21 +00:00
<div class="column is-3">
{% 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>
2022-01-17 19:25:41 +00:00
<a itemprop="sameAs" href="{{ author.wikipedia_link }}" rel="noopener noreferrer" 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">
2022-01-17 19:25:41 +00:00
<a itemprop="sameAs" href="{{ author.isni_link }}" rel="noopener noreferrer" 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">
2022-01-17 19:25:41 +00:00
<a class="mr-3" itemprop="sameAs" href="{{ author.openlibrary_link }}" target="_blank" rel="noopener noreferrer">
{% trans "View on OpenLibrary" %}
</a>
{% if request.user.is_authenticated and perms.bookwyrm.edit_book %}
2021-12-30 21:37:07 +00:00
<button class="button is-small" type="button" data-modal-open="openlibrary_sync">
<span class="icon icon-download" title="{{ button_text }}"></span>
<span class="is-sr-only-mobile">{{ button_text }}</span>
</button>
{% include "author/sync_modal.html" with source="openlibrary.org" source_name="OpenLibrary" id="openlibrary_sync" %}
{% 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">
2022-01-17 19:25:41 +00:00
<a class="mr-3" itemprop="sameAs" href="{{ author.inventaire_link }}" target="_blank" rel="noopener noreferrer">
{% 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-30 21:38:35 +00:00
<button class="button is-small" type="button" data-modal-open="inventaire_sync">
<span class="icon icon-download" title="{{ button_text }}"></span>
<span class="is-sr-only-mobile">{{ button_text }}</span>
</button>
{% include "author/sync_modal.html" with source="inventaire.io" source_name="Inventaire" id="inventaire_sync" %}
{% 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">
2022-01-17 19:25:41 +00:00
<a itemprop="sameAs" href="https://www.librarything.com/author/{{ author.librarything_key }}" target="_blank" rel="noopener noreferrer">
{% 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>
2022-01-17 19:25:41 +00:00
<a itemprop="sameAs" href="https://www.goodreads.com/author/show/{{ author.goodreads_key }}" target="_blank" rel="noopener noreferrer">
{% 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 %}
2022-01-17 03:38:21 +00:00
<div class="column">
{% if author.bio %}
{% include "snippets/trimmed_text.html" with full=author.bio trim_length=200 %}
{% endif %}
2022-01-17 03:38:21 +00:00
<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>
2022-01-17 03:38:21 +00:00
{% endfor %}
</div>
2021-10-21 00:42:19 +00:00
2022-01-17 03:38:21 +00:00
<div>
{% include 'snippets/pagination.html' with page=books %}
</div>
</div>
2021-10-21 00:42:19 +00:00
</div>
2020-02-11 06:32:03 +00:00
{% endblock %}