Skip to content

Commit

Permalink
Merge branch 'main' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
mouse-reeve committed Aug 5, 2022
2 parents d5980d2 + c8fc907 commit 580745b
Show file tree
Hide file tree
Showing 66 changed files with 655 additions and 433 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ EMAIL_SENDER_NAME=admin
EMAIL_SENDER_DOMAIN=

# Query timeouts
SEARCH_TIMEOUT=15
SEARCH_TIMEOUT=5
QUERY_TIMEOUT=5

# Thumbnails Generation
Expand Down
2 changes: 1 addition & 1 deletion bookwyrm/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
env = Env()
env.read_env()
DOMAIN = env("DOMAIN")
VERSION = "0.4.4"
VERSION = "0.4.5"

RELEASE_API = env(
"RELEASE_API",
Expand Down
9 changes: 7 additions & 2 deletions bookwyrm/templates/about/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ <h2>
<p class="subtitle notification has-background-primary-highlight">
{% blocktrans trimmed with site_name=site.name %}
{{ site_name }} is part of <em>BookWyrm</em>, a network of independent, self-directed communities for readers.
While you can interact seamlessly with users anywhere in the <a href="https://joinbookwyrm.com/instances/" target="_blank">BookWyrm network</a>, this community is unique.
While you can interact seamlessly with users anywhere in the
<a href="https://joinbookwyrm.com/instances/" target="_blank" rel="nofollow noopener noreferrer">BookWyrm network</a>,
this community is unique.
{% endblocktrans %}
</p>
</div>
Expand Down Expand Up @@ -88,7 +90,10 @@ <h2>
</div>

<p>
{% trans "Track your reading, talk about books, write reviews, and discover what to read next. Always ad-free, anti-corporate, and community-oriented, BookWyrm is human-scale software, designed to stay small and personal. If you have feature requests, bug reports, or grand dreams, <a href='https://joinbookwyrm.com/get-involved' target='_blank'>reach out</a> and make yourself heard." %}
{% blocktrans trimmed %}
Track your reading, talk about books, write reviews, and discover what to read next. Always ad-free, anti-corporate, and community-oriented, BookWyrm is human-scale software, designed to stay small and personal.
If you have feature requests, bug reports, or grand dreams, <a href="https://joinbookwyrm.com/get-involved" target="_blank" rel="nofollow noopener noreferrer">reach out</a> and make yourself heard.
{% endblocktrans %}
</p>

</section>
Expand Down
12 changes: 6 additions & 6 deletions bookwyrm/templates/author/author.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ <h2 class="title is-4">{% trans "External links" %}</h2>
<div class="box">
{% if author.wikipedia_link %}
<div>
<a itemprop="sameAs" href="{{ author.wikipedia_link }}" rel="noopener noreferrer" target="_blank">
<a itemprop="sameAs" href="{{ author.wikipedia_link }}" rel="nofollow noopener noreferrer" target="_blank">
{% trans "Wikipedia" %}
</a>
</div>
{% endif %}

{% if author.isni %}
<div class="mt-1">
<a itemprop="sameAs" href="{{ author.isni_link }}" rel="noopener noreferrer" target="_blank">
<a itemprop="sameAs" href="{{ author.isni_link }}" rel="nofollow noopener noreferrer" target="_blank">
{% trans "View ISNI record" %}
</a>
</div>
Expand All @@ -83,7 +83,7 @@ <h2 class="title is-4">{% trans "External links" %}</h2>
{% trans "Load data" as button_text %}
{% if author.openlibrary_key %}
<div class="mt-1 is-flex">
<a class="mr-3" itemprop="sameAs" href="{{ author.openlibrary_link }}" target="_blank" rel="noopener noreferrer">
<a class="mr-3" itemprop="sameAs" href="{{ author.openlibrary_link }}" target="_blank" rel="nofollow noopener noreferrer">
{% trans "View on OpenLibrary" %}
</a>
{% if request.user.is_authenticated and perms.bookwyrm.edit_book %}
Expand All @@ -98,7 +98,7 @@ <h2 class="title is-4">{% trans "External links" %}</h2>

{% if author.inventaire_id %}
<div class="mt-1 is-flex">
<a class="mr-3" itemprop="sameAs" href="{{ author.inventaire_link }}" target="_blank" rel="noopener noreferrer">
<a class="mr-3" itemprop="sameAs" href="{{ author.inventaire_link }}" target="_blank" rel="nofollow noopener noreferrer">
{% trans "View on Inventaire" %}
</a>

Expand All @@ -114,15 +114,15 @@ <h2 class="title is-4">{% trans "External links" %}</h2>

{% if author.librarything_key %}
<div class="mt-1">
<a itemprop="sameAs" href="https://www.librarything.com/author/{{ author.librarything_key }}" target="_blank" rel="noopener noreferrer">
<a itemprop="sameAs" href="https://www.librarything.com/author/{{ author.librarything_key }}" target="_blank" rel="nofollow noopener noreferrer">
{% trans "View on LibraryThing" %}
</a>
</div>
{% endif %}

{% if author.goodreads_key %}
<div>
<a itemprop="sameAs" href="https://www.goodreads.com/author/show/{{ author.goodreads_key }}" target="_blank" rel="noopener noreferrer">
<a itemprop="sameAs" href="https://www.goodreads.com/author/show/{{ author.goodreads_key }}" target="_blank" rel="nofollow noopener noreferrer">
{% trans "View on Goodreads" %}
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions bookwyrm/templates/book/book.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ <h1 class="title" itemprop="name">
{% trans "Load data" as button_text %}
{% if book.openlibrary_key %}
<p>
<a href="{{ book.openlibrary_link }}" target="_blank" rel="noopener noreferrer">
<a href="{{ book.openlibrary_link }}" target="_blank" rel="nofollow noopener noreferrer">
{% trans "View on OpenLibrary" %}
</a>
{% if request.user.is_authenticated and perms.bookwyrm.edit_book %}
Expand All @@ -145,7 +145,7 @@ <h1 class="title" itemprop="name">
{% endif %}
{% if book.inventaire_id %}
<p>
<a href="{{ book.inventaire_link }}" target="_blank" rel="noopener noreferrer">
<a href="{{ book.inventaire_link }}" target="_blank" rel="nofollow noopener noreferrer">
{% trans "View on Inventaire" %}
</a>

Expand Down
10 changes: 7 additions & 3 deletions bookwyrm/templates/book/edit/edit_book.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,13 @@ <h2 class="title is-4">{% trans "Confirm Book Info" %}</h2>
<p class="help ml-5 mb-2">
{% with book_title=match.book_set.first.title alt_title=match.bio %}
{% if book_title %}
<a href="{{ match.local_path }}" target="_blank">{% trans "Author of " %}<em>{{ book_title }}</em></a>
{% else %}
<a href="{{ match.id }}" target="_blank">{% if alt_title %}{% trans "Author of " %}<em>{{ alt_title }}</em>{% else %} {% trans "Find more information at isni.org" %}{% endif %}</a>
<a href="{{ match.local_path }}" target="_blank" rel="nofollow noopener noreferrer">{% blocktrans trimmed %}
Author of <em>{{ book_title }}</em>
{% endblocktrans %}</a>
{% else %}
<a href="{{ match.id }}" target="_blank" rel="nofollow noopener noreferrer">{% if alt_title %}{% blocktrans trimmed %}
Author of <em>{{ alt_title }}</em>
{% endblocktrans %}{% else %}{% trans "Find more information at isni.org" %}{% endif %}</a>
{% endif %}
{% endwith %}
</p>
Expand Down
2 changes: 1 addition & 1 deletion bookwyrm/templates/book/file_links/edit_links.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h1 class="title">
{% for link in links %}
<tr>
<td class="overflow-wrap-anywhere">
<a href="{{ link.url }}" target="_blank" rel="noopener noreferrer">{{ link.url }}</a>
<a href="{{ link.url }}" target="_blank" rel="nofollow noopener noreferrer">{{ link.url }}</a>
</td>
<td>
{% if link.added_by %}
Expand Down
2 changes: 1 addition & 1 deletion bookwyrm/templates/book/file_links/links.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h2 class="title is-5">{% trans "Get a copy" %}</h2>
{% for link in links.all %}
{% join "verify" link.id as verify_modal %}
<li>
<a href="{{ link.url }}" rel="noopener noreferrer" target="_blank" title="{{ link.url }}" data-modal-open="{{ verify_modal }}">{{ link.name }}</a>
<a href="{{ link.url }}" rel="nofollow noopener noreferrer" target="_blank" title="{{ link.url }}" data-modal-open="{{ verify_modal }}">{{ link.name }}</a>
({{ link.filetype }})

{% if link.availability != "free" %}
Expand Down
2 changes: 1 addition & 1 deletion bookwyrm/templates/book/file_links/verification_modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</div>

<button type="button" class="button" data-modal-close>{% trans "Cancel" %}</button>
<a href="{{ link.url }}" target="_blank" rel="noopener noreferrer" class="button is-primary">{% trans "Continue" %}</a>
<a href="{{ link.url }}" target="_blank" rel="nofollow noopener noreferrer" noreferrer" class="button is-primary">{% trans "Continue" %}</a>
{% endif %}

{% endblock %}
6 changes: 5 additions & 1 deletion bookwyrm/templates/import/import.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ <h1 class="title">{% trans "Import Books" %}</h1>
</div>

<p class="help" id="desc_source">
{% trans 'You can download your Goodreads data from the <a href="https://www.goodreads.com/review/import" target="_blank" rel="noopener noreferrer">Import/Export page</a> of your Goodreads account.' %}
{% blocktrans trimmed %}
You can download your Goodreads data from the
<a href="https://www.goodreads.com/review/import" target="_blank" rel="nofollow noopener noreferrer">Import/Export page</a>
of your Goodreads account.
{% endblocktrans %}
</p>
</div>

Expand Down
2 changes: 1 addition & 1 deletion bookwyrm/templates/import/import_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ <h1 class="title">
<p>{{ item.review|truncatechars:100 }}</p>
{% endif %}
{% if item.linked_review %}
<a href="{{ item.linked_review.remote_id }}" target="_blank">{% trans "View imported review" %}</a>
<a href="{{ item.linked_review.remote_id }}" target="_blank" rel="nofollow noopener noreferrer">{% trans "View imported review" %}</a>
{% endif %}
</td>
{% block import_cols %}
Expand Down
2 changes: 1 addition & 1 deletion bookwyrm/templates/import/manual_review.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<div class="columns is-mobile">
{% with guess=item.book_guess %}
<div class="column is-narrow">
<a href="{{ item.book.local_path }}" target="_blank">
<a href="{{ item.book.local_path }}" target="_blank" rel="nofollow noopener noreferrer">
{% include 'snippets/book_cover.html' with book=guess cover_class='is-h-s' size='small' %}
</a>
</div>
Expand Down
34 changes: 29 additions & 5 deletions bookwyrm/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,27 @@
</form>
{% include "search/barcode_modal.html" with id="barcode-scanner-modal" %}

<button type="button" tabindex="0" class="navbar-burger pulldown-menu my-4" data-controls="main_nav" aria-expanded="false">
<i class="icon icon-dots-three-vertical" aria-hidden="true"></i>
<span class="is-sr-only">{% trans "Main navigation menu" %}</span>
<button
type="button"
tabindex="0"
class="navbar-burger pulldown-menu my-4 is-flex-touch is-align-items-center is-justify-content-center"
data-controls="main_nav"
aria-expanded="false"
aria-label="{% trans 'Main navigation menu' %}"
>
<i class="icon-dots-three-vertical" aria-hidden="true"></i>

{% with request.user.unread_notification_count as notification_count %}
<strong
class="{% if not notification_count %}is-hidden {% elif request.user.has_unread_mentions %}is-danger {% else %}is-primary {% endif %} tag is-small px-1"
data-poll-wrapper
>
<span class="is-sr-only">{% trans "Notifications" %}</span>
<strong data-poll="notifications" class="has-text-white">
{{ notification_count }}
</strong>
</strong>
{% endwith %}
</button>
</div>

Expand Down Expand Up @@ -200,11 +218,17 @@
{% if site.support_link %}
<p>
<span class="icon icon-heart"></span>
{% blocktrans with site_name=site.name support_link=site.support_link support_title=site.support_title %}Support {{ site_name }} on <a href="{{ support_link }}" target="_blank">{{ support_title }}</a>{% endblocktrans %}
{% blocktrans trimmed with site_name=site.name support_link=site.support_link support_title=site.support_title %}
Support {{ site_name }} on
<a href="{{ support_link }}" target="_blank" rel="nofollow noopener noreferrer">{{ support_title }}</a>
{% endblocktrans %}
</p>
{% endif %}
<p>
{% blocktrans %}BookWyrm's source code is freely available. You can contribute or report issues on <a href="https://github.com/mouse-reeve/bookwyrm">GitHub</a>.{% endblocktrans %}
{% blocktrans trimmed %}
BookWyrm's source code is freely available. You can contribute or report issues on
<a href="https://github.com/bookwyrm-social/bookwyrm" target="_blank" rel="nofollow noopener noreferrer">GitHub</a>.
{% endblocktrans %}
</p>
</div>
{% if site.footer_item %}
Expand Down
9 changes: 8 additions & 1 deletion bookwyrm/templates/ostatus/remote_follow_button.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@

<div class="field mb-0">
<div class="control">
<a class="button is-small is-link" href="{% url 'remote-follow-page' %}?user={{ user.username }}" target="_blank" rel="noopener noreferrer" onclick="BookWyrm.displayPopUp(`{% url 'remote-follow-page' %}?user={{ user.username }}`, `remoteFollow`); return false;" aria-describedby="remote_follow_warning">
<a
class="button is-small is-link"
href="{% url 'remote-follow-page' %}?user={{ user.username }}"
target="_blank"
rel="nofollow noopener noreferrer"
onclick="BookWyrm.displayPopUp(`{% url 'remote-follow-page' %}?user={{ user.username }}`, `remoteFollow`); return false;"
aria-describedby="remote_follow_warning"
>
{% blocktrans with username=user.localname %}Follow on Fediverse{% endblocktrans %}
</a>
</div>
Expand Down
26 changes: 11 additions & 15 deletions bookwyrm/templates/search/book.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

{% block panel %}

{% if results %}
{% with results|first as local_results %}
{% if results or remote_results %}
<ul class="block">
{% for result in local_results.results %}
{% for result in results %}
<li class="pd-4 mb-5 local-book-search-result" id="tour-local-book-search-result">
<div class="columns is-mobile is-gapless mb-0">
<div class="column is-cover">
Expand All @@ -29,25 +28,24 @@
</li>
{% endfor %}
</ul>
{% endwith %}

<div class="block">
{% for result_set in results|slice:"1:" %}
{% for result_set in remote_results %}
{% if result_set.results %}
<section class="mb-5">
{% if not result_set.connector.local %}
<details class="details-panel box" open>
{% endif %}
{% if not result_set.connector.local %}
<summary class="is-flex is-align-items-center is-flex-wrap-wrap is-gap-2 remote-book-search-result" id="tour-remote-search-result">
<span class="mb-0 title is-5">
{% trans 'Results from' %}
<a href="{{ result_set.connector.base_url }}" target="_blank">{{ result_set.connector.name|default:result_set.connector.identifier }}</a>
<a
href="{{ result_set.connector.base_url }}"
target="_blank"
rel="nofollow noopener noreferrer"
>{{ result_set.connector.name|default:result_set.connector.identifier }}</a>
</span>

<span class="details-close icon icon-x" aria-hidden="true"></span>
</summary>
{% endif %}

<div class="mt-5">
<div class="is-flex is-flex-direction-row-reverse">
Expand All @@ -63,7 +61,7 @@
<strong>
<a
href="{{ result.view_link|default:result.key }}"
rel="noopener noreferrer"
rel="nofollow noopener noreferrer"
target="_blank"
>{{ result.title }}</a>
</strong>
Expand All @@ -88,17 +86,15 @@
</ul>
</div>
</div>
{% if not result_set.connector.local %}
</details>
{% endif %}
</section>
{% endif %}
{% endfor %}
</div>


{% endif %}
{% endblock %}

{% block search_footer %}
<p class="block">
{% if request.user.is_authenticated %}
{% if not remote %}
Expand Down
16 changes: 12 additions & 4 deletions bookwyrm/templates/search/layout.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends 'layout.html' %}
{% load i18n %}
{% load humanize %}

{% block title %}{% trans "Search" %}{% endblock %}

Expand Down Expand Up @@ -53,17 +54,24 @@ <h1 class="title">
</nav>

<section class="block" id="search-results-block">
{% if not results %}
<p>
<p class="block">
{% if not results %}
<em>{% blocktrans %}No results found for "{{ query }}"{% endblocktrans %}</em>
{% else %}
<em>{% blocktrans trimmed count counter=results.paginator.count with result_count=results.paginator.count|intcomma %}
{{ result_count }} result found
{% plural %}
{{ result_count }} results found
{% endblocktrans %}</em>
{% endif %}
</p>
{% endif %}
{% block panel %}
{% endblock %}

<div>
<div class="block">
{% include 'snippets/pagination.html' with page=results path=request.path %}
</div>
{% block search_footer %}{% endblock %}
</section>
{% endif %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
<div class="field">
<label class="label" for="id_file">JSON data:</label>
<aside class="help">
Expects a json file in the format provided by <a href="https://fediblock.org/" target="_blank" rel="noopener noreferrer">FediBlock</a>, with a list of entries that have <code>instance</code> and <code>url</code> fields. For example:
{% blocktrans trimmed %}
Expects a json file in the format provided by <a href="https://fediblock.org/" target="_blank" rel="nofollow noopener noreferrer">FediBlock</a>, with a list of entries that have <code>instance</code> and <code>url</code> fields. For example:
{% endblocktrans %}
<pre>
[
{
Expand Down
2 changes: 1 addition & 1 deletion bookwyrm/templates/settings/link_domains/link_domains.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<header class="column">
<h2 class="title is-5">
{{ domain.name }}
(<a href="http://{{ domain.domain }}" target="_blank" rel="noopener noreferrer">{{ domain.domain }}</a>)
(<a href="http://{{ domain.domain }}" target="_blank" rel="nofollow noopener noreferrer">{{ domain.domain }}</a>)
</h2>
</header>
<div class="column is-narrow">
Expand Down
2 changes: 1 addition & 1 deletion bookwyrm/templates/settings/link_domains/link_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{% for link in links %}
<tr>
<td class="overflow-wrap-anywhere">
<a href="{{ link.url }}" target="_blank" rel="noopener noreferrer">{{ link.url }}</a>
<a href="{{ link.url }}" target="_blank" rel="nofollow noopener noreferrer">{{ link.url }}</a>
</td>
<td>
{% if link.added_by %}
Expand Down
Loading

0 comments on commit 580745b

Please sign in to comment.