Merge branch 'upstream' into tab-keyboard-accessibility

This commit is contained in:
Ned Zimmerman
2021-02-28 12:39:56 -04:00
104 changed files with 2680 additions and 690 deletions

View File

@ -1,11 +1,12 @@
{% load i18n %}
{% if not user in request.user.blocks.all %}
<form name="blocks" method="post" action="/block/{{ user.id }}">
{% csrf_token %}
<button class="button is-danger is-light is-small {{ class }}" type="submit">Block</button>
<button class="button is-danger is-light is-small {{ class }}" type="submit">{% trans "Block" %}</button>
</form>
{% else %}
<form name="unblocks" method="post" action="/unblock/{{ user.id }}">
{% csrf_token %}
<button class="button is-small {{ class }}" type="submit">Un-block</button>
<button class="button is-small {{ class }}" type="submit">{% trans "Un-block" %}</button>
</form>
{% endif %}

View File

@ -1,19 +1,20 @@
{% load bookwyrm_tags %}
{% load i18n %}
{% with status.id|uuid as uuid %}
<form name="boost" action="/boost/{{ status.id }}" method="post" class="interaction boost-{{ status.id }}-{{ uuid }} {% if request.user|boosted:status %}hidden{% endif %}" data-id="boost-{{ status.id }}-{{ uuid }}">
{% csrf_token %}
<button class="button is-small" type="submit" {% if not status.boostable %}disabled{% endif %}>
<span class="icon icon-boost" title="Boost status">
<span class="is-sr-only">Boost status</span>
<span class="icon icon-boost" title="{% trans 'Boost status' %}">
<span class="is-sr-only">{% trans "Boost status" %}</span>
</span>
</button>
</form>
<form name="unboost" action="/unboost/{{ status.id }}" method="post" class="interaction boost-{{ status.id }}-{{ uuid }} active {% if not request.user|boosted:status %}hidden{% endif %}" data-id="boost-{{ status.id }}-{{ uuid }}">
{% csrf_token %}
<button class="button is-small is-primary" type="submit">
<span class="icon icon-boost" title="Un-boost status">
<span class="is-sr-only">Un-boost status</span>
<span class="icon icon-boost" title="{% trans 'Un-boost status' %}">
<span class="is-sr-only">{% trans "Un-boost status" %}</span>
</span>
</button>
</form>

View File

@ -1,4 +1,5 @@
{% load i18n %}
<div class="control{% if not parent_status.content_warning %} hidden{% endif %}" id="spoilers-{{ uuid }}">
<label class="is-sr-only" for="id_content_warning-{{ uuid }}">Spoiler alert:</label>
<input type="text" name="content_warning" maxlength="255" class="input" id="id_content_warning-{{ uuid }}" placeholder="Spoilers ahead!"{% if parent_status.content_warning %} value="{{ parent_status.content_warning }}"{% endif %}>
<label class="is-sr-only" for="id_content_warning-{{ uuid }}">{% trans "Spoiler alert:" %}</label>
<input type="text" name="content_warning" maxlength="255" class="input" id="id_content_warning-{{ uuid }}" placeholder="{% trans 'Spoilers ahead!' %}"{% if parent_status.content_warning %} value="{{ parent_status.content_warning }}"{% endif %}>
</div>

View File

@ -1,17 +1,18 @@
{% load humanize %}
{% load i18n %}
{% load bookwyrm_tags %}
<seven-minute-tabs>
<div class="tabs is-boxed" role="tablist">
<ul>
<li class="is-active">
<a href="#review-{{ book.id }}" id="tab-review-{{ book.id }}" role="tab" aria-selected="true" aria-controls="review-{{ book.id }}" data-category="tab-option-{{ book.id }}">Review</a>
<a href="#review-{{ book.id }}" id="tab-review-{{ book.id }}" role="tab" aria-selected="true" aria-controls="review-{{ book.id }}" data-category="tab-option-{{ book.id }}">{% trans "Review" %}</a>
</li>
<li>
<a href="#comment-{{ book.id}}" id="tab-comment-{{ book.id }}" role="tab" tabindex="-1" aria-selected="false" aria-controls="comment-{{ book.id}}" data-category="tab-option-{{ book.id }}">Comment</a>
<a href="#comment-{{ book.id}}" id="tab-comment-{{ book.id }}" role="tab" tabindex="-1" aria-selected="false" aria-controls="comment-{{ book.id}}" data-category="tab-option-{{ book.id }}">{% trans "Comment" %}</a>
</li>
<li>
<a href="#quote-{{ book.id }}" id="tab-quote-{{ book.id }}" role="tab" tabindex="-1" aria-selected="false" aria-controls="quote-{{ book.id }}" data-category="tab-option-{{ book.id }}">Quote</a>
<a href="#quote-{{ book.id }}" id="tab-quote-{{ book.id }}" role="tab" tabindex="-1" aria-selected="false" aria-controls="quote-{{ book.id }}" data-category="tab-option-{{ book.id }}">{% trans "Quote" %}</a>
</li>
</ul>
</div>

View File

@ -1,4 +1,5 @@
{% load bookwyrm_tags %}
{% load i18n %}
<form class="is-flex-grow-1" name="{{ type }}" action="/post/{% if type == 'direct' %}status{% else %}{{ type }}{% endif %}" method="post" id="tab-{{ type }}-{{ book.id }}{{ reply_parent.id }}">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
@ -6,7 +7,7 @@
<input type="hidden" name="reply_parent" value="{{ reply_parent.id }}">
{% if type == 'review' %}
<div class="control">
<label class="label" for="id_name_{{ book.id }}_{{ type }}">Title:</label>
<label class="label" for="id_name_{{ book.id }}_{{ type }}">{% trans "Title:" %}</label>
<input type="text" name="name" maxlength="255" class="input" required="" id="id_name_{{ book.id }}_{{ type }}" placeholder="My {{ type }} of '{{ book.title }}'">
</div>
{% endif %}
@ -17,9 +18,9 @@
{% if type == 'review' %}
<fieldset>
<legend class="is-sr-only">Rating</legend>
<legend class="is-sr-only">{% trans "Rating" %}</legend>
<div class="field is-grouped stars form-rate-stars">
<label class="is-sr-only" for="no-rating-{{ book.id }}">No rating</label>
<label class="is-sr-only" for="no-rating-{{ book.id }}">{% trans "No rating" %}</label>
<input class="is-sr-only" type="radio" name="rating" value="" id="no-rating-{{ book.id }}" checked>
{% for i in '12345'|make_list %}
<input class="is-sr-only" id="book{{book.id}}-star-{{ forloop.counter }}" type="radio" name="rating" value="{{ forloop.counter }}">
@ -40,7 +41,7 @@
</div>
{% if type == 'quotation' %}
<div class="control">
<label class="label" for="id_content_quote-{{ book.id }}">Comment:</label>
<label class="label" for="id_content_quote-{{ book.id }}">{% trans "Comment:" %}</label>
{% include 'snippets/content_warning_field.html' with parent_status=status %}
<textarea name="content" class="textarea is-small" id="id_content_quote-{{ book.id }}"></textarea>
</div>
@ -55,14 +56,14 @@
<div class="control">
{% if type == 'direct' %}
<input type="hidden" name="privacy" value="direct">
<button type="button" class="button" aria-label="Privacy" disabled>Private</button>
<button type="button" class="button" aria-label="Privacy" disabled>{% trans "Private" %}</button>
{% else %}
{% include 'snippets/privacy_select.html' with current=reply_parent.privacy %}
{% endif %}
</div>
</div>
<div class="column is-narrow">
<button class="button is-link" type="submit">Post</button>
<button class="button is-link" type="submit">{% trans "Post" %}</button>
</div>
</div>
</form>

View File

@ -1,8 +1,10 @@
{% extends 'components/modal.html' %}
{% block modal-title %}Delete these read dates?{% endblock %}
{% load i18n %}
{% block modal-title %}{% trans "Delete these read dates?" %}{% endblock %}
{% block modal-body %}
{% if readthrough.progress_updates|length > 0 %}
You are deleting this readthrough and its {{ readthrough.progress_updates|length }} associated progress updates.
{% blocktrans with count=readthrough.progress_updates|length %}You are deleting this readthrough and its {{ count }} associated progress updates.{% endblocktrans %}
{% endif %}
{% endblock %}
{% block modal-footer %}
@ -10,7 +12,7 @@ You are deleting this readthrough and its {{ readthrough.progress_updates|length
{% csrf_token %}
<input type="hidden" name="id" value="{{ readthrough.id }}">
<button class="button is-danger" type="submit">
Delete
{% trans "Delete" %}
</button>
{% include 'snippets/toggle/toggle_button.html' with text="Cancel" controls_text="delete-readthrough" controls_uid=readthrough.id %}
</form>

View File

@ -1,18 +1,19 @@
{% load bookwyrm_tags %}
{% load i18n %}
{% with status.id|uuid as uuid %}
<form name="favorite" action="/favorite/{{ status.id }}" method="POST" class="interaction fav-{{ status.id }}-{{ uuid }} {% if request.user|liked:status %}hidden{% endif %}" data-id="fav-{{ status.id }}-{{ uuid }}">
{% csrf_token %}
<button class="button is-small" type="submit">
<span class="icon icon-heart" title="Like status">
<span class="is-sr-only">Like status</span>
<span class="icon icon-heart" title="{% trans 'Like status' %}">
<span class="is-sr-only">{% trans "Like status" %}</span>
</span>
</button>
</form>
<form name="unfavorite" action="/unfavorite/{{ status.id }}" method="POST" class="interaction fav-{{ status.id }}-{{ uuid }} active {% if not request.user|liked:status %}hidden{% endif %}" data-id="fav-{{ status.id }}-{{ uuid }}">
{% csrf_token %}
<button class="button is-primary is-small" type="submit">
<span class="icon icon-heart" title="Un-like status">
<span class="is-sr-only">Un-like status</span>
<span class="icon icon-heart" title="{% trans 'Un-like status' %}">
<span class="is-sr-only">{% trans "Un-like status" %}</span>
</span>
</button>
</form>

View File

@ -1,8 +1,9 @@
{% load i18n %}
{% if request.user == user or not request.user.is_authenticated %}
{% elif request.user in user.follower_requests.all %}
<div>
Follow request already sent.
{% trans "Follow request already sent." %}
</div>
{% elif user in request.user.blocks.all %}
@ -15,15 +16,15 @@ Follow request already sent.
{% csrf_token %}
<input type="hidden" name="user" value="{{ user.username }}">
{% if user.manually_approves_followers %}
<button class="button is-small is-link" type="submit">Send follow request</button>
<button class="button is-small is-link" type="submit">{% trans "Send follow request" %}</button>
{% else %}
<button class="button is-small is-link" type="submit">Follow</button>
<button class="button is-small is-link" type="submit">{% trans "Follow" %}</button>
{% endif %}
</form>
<form action="/unfollow/" method="POST" class="interaction follow-{{ user.id }} {% if not request.user in user.followers.all %}hidden{%endif %}" data-id="follow-{{ user.id }}">
{% csrf_token %}
<input type="hidden" name="user" value="{{ user.username }}">
<button class="button is-small is-danger is-light" type="submit">Unfollow</button>
<button class="button is-small is-danger is-light" type="submit">{% trans "Unfollow" %}</button>
</form>
</div>
<div class="control">

View File

@ -1,15 +1,16 @@
{% load i18n %}
{% load bookwyrm_tags %}
{% if request.user|follow_request_exists:user %}
<div class="field is-grouped">
<form action="/accept-follow-request/" method="POST">
{% csrf_token %}
<input type="hidden" name="user" value="{{ user.username }}">
<button class="button is-link is-small" type="submit">Accept</button>
<button class="button is-link is-small" type="submit">{% trans "Accept" %}</button>
</form>
<form action="/delete-follow-request/" method="POST">
{% csrf_token %}
<input type="hidden" name="user" value="{{ user.username }}">
<button class="button is-danger is-light is-small" type="submit" class="warning">Delete</button>
<button class="button is-danger is-light is-small" type="submit" class="warning">{% trans "Delete" %}</button>
</form>
</div>
{% endif %}

View File

@ -1,15 +1,16 @@
{% extends 'components/card.html' %}
{% load i18n %}
{% block card-header %}
<h3 class="card-header-title has-background-primary has-text-white">
<span class="icon icon-book is-size-3 mr-2" aria-hidden="true"></span> {{ year }} reading goal
<span class="icon icon-book is-size-3 mr-2" aria-hidden="true"></span> {% blocktrans %}{{ year }} reading goal{% endblocktrans %}
</h3>
{% endblock %}
{% block card-content %}
<div class="content">
<p>Set a goal for how many books you'll finish reading in {{ year }}, and track your progress throughout the year.</p>
<p>{% blocktrans %}Set a goal for how many books you'll finish reading in {{ year }}, and track your progress throughout the year.{% endblocktrans %}</p>
{% include 'snippets/goal_form.html' %}
</div>
@ -17,7 +18,7 @@
{% block card-footer %}
<div class="card-footer-item is-flex-direction-column">
<button class="button is-danger is-light is-block set-display" data-id="hide-{{ year }}-reading-goal" data-value="true">Dismiss message</button>
<p class="help">You can set or change your reading goal any time from your <a href="{{ request.user.local_path }}">profile page</a></p>
<button class="button is-danger is-light is-block set-display" data-id="hide-{{ year }}-reading-goal" data-value="true">{% trans "Dismiss message" %}</button>
<p class="help">{% blocktrans with path=request.user.local_path %}You can set or change your reading goal any time from your <a href="{{ path }}">profile page</a>{% endblocktrans %}</p>
</div>
{% endblock %}

View File

@ -1,3 +1,4 @@
{% load i18n %}
<form method="post" name="goal" action="{{ request.user.local_path }}/goal/{{ year }}">
{% csrf_token %}
<input type="hidden" name="year" value="{% if goal %}{{ goal.year }}{% else %}{{ year }}{% endif %}">
@ -5,28 +6,28 @@
<div class="columns">
<div class="column">
<label class="label" for="id_goal">Reading goal:</label>
<label class="label" for="id_goal">{% trans "Reading goal:" %}</label>
<div class="field has-addons">
<div class="control">
<input type="number" class="input" name="goal" min="1" id="id_goal" value="{% if goal %}{{ goal.goal }}{% else %}12{% endif %}">
</div>
<p class="button is-static" aria-hidden="true">books</p>
<p class="button is-static" aria-hidden="true">{% trans "books" %}</p>
</div>
</div>
<div class="column">
<label class="label"><p class="mb-2">Goal privacy:</p>
<label class="label"><p class="mb-2">{% trans "Goal privacy:" %}</p>
{% include 'snippets/privacy_select.html' with no_label=True current=goal.privacy %}
</label>
</div>
</div>
<label for="post_status" class="label">
<input type="checkbox" name="post-status" id="post_status" class="checkbox" checked>
Post to feed
{% trans "Post to feed" %}
</label>
<p>
<button type="submit" class="button is-link">Set goal</button>
<button type="submit" class="button is-link">{% trans "Set goal" %}</button>
{% if goal %}
{% include 'snippets/toggle/close_button.html' with text="Cancel" controls_text="show-edit-goal" %}
{% endif %}

View File

@ -1,9 +1,10 @@
{% load i18n %}
{% load humanize %}
<p>
{% if goal.progress_percent >= 100 %}
Success!
{% trans "Success!" %}
{% elif goal.progress_percent %}
{{ goal.progress_percent }}% complete!
{% blocktrans with percent=goal.percent %}{{ percent }}% complete!{% endblocktrans %}
{% endif %}
{% if goal.user == request.user %}You've{% else %}{{ goal.user.display_name }} has{% endif %} read {% if request.path != goal.local_path %}<a href="{{ goal.local_path }}">{% endif %}{{ goal.book_count }} of {{ goal.goal | intcomma }} books{% if request.path != goal.local_path %}</a>{% endif %}.
</p>

View File

@ -1,9 +1,10 @@
{% load i18n %}
<nav class="pagination" role="navigation" aria-label="pagination">
{% if page.has_previous %}
<p class="pagination-previous">
<a href="{{ path }}?page={{ page.previous_page_number }}{{ anchor }}">
<span class="icon icon-arrow-left"></span>
Previous
{% trans "Previous" %}
</a>
</p>
{% endif %}
@ -11,7 +12,7 @@
{% if page.has_next %}
<p class="pagination-next">
<a href="{{ path }}?page={{ page.next_page_number }}{{ anchor }}">
Next
{% trans "Next" %}
<span class="icon icon-arrow-right"></span>
</a>
</p>

View File

@ -1,18 +1,19 @@
{% load i18n %}
{% if item.privacy == 'public' %}
<span class="icon icon-globe" title="Public">
<span class="is-sr-only">Public</span>
<span class="icon icon-globe" title="{% trans 'Public' %}">
<span class="is-sr-only">{% trans "Public" %}</span>
</span>
{% elif item.privacy == 'unlisted' %}
<span class="icon icon-unlock" title="Unlisted">
<span class="is-sr-only">Unlisted</span>
<span class="icon icon-unlock" title="{% trans 'Unlisted' %}">
<span class="is-sr-only">{% trans "Unlisted" %}</span>
</span>
{% elif item.privacy == 'followers' %}
<span class="icon icon-lock" title="Followers-only">
<span class="is-sr-only">Followers-only</span>
<span class="is-sr-only">{% trans "Followers-only" %}</span>
</span>
{% else %}
<span class="icon icon-envelope" title="Private">
<span class="is-sr-only">Private</span>
<span class="icon icon-envelope" title="{% trans 'Private' %}">
<span class="is-sr-only">{% trans "Private" %}</span>
</span>
{% endif %}

View File

@ -1,21 +1,22 @@
{% load i18n %}
{% load bookwyrm_tags %}
<div class="select {{ class }}">
{% with 0|uuid as uuid %}
{% if not no_label %}
<label class="is-sr-only" for="privacy-{{ uuid }}">Post privacy</label>
<label class="is-sr-only" for="privacy-{{ uuid }}">{% trans "Post privacy" %}</label>
{% endif %}
<select name="privacy" id="privacy-{{ uuid }}">
<option value="public" {% if not current or current == 'public' %}selected{% endif %}>
Public
{% trans "Public" %}
</option>
<option value="unlisted" {% if current == 'unlisted' %}selected{% endif %}>
Unlisted
{% trans "Unlisted" %}
</option>
<option value="followers" {% if current == 'followers' %}selected{% endif %}>
Followers
{% trans "Followers" %}
</option>
<option value="direct" {% if current == 'direct' %}selected{% endif %}>
Private
{% trans "Private" %}
</option>
</select>
{% endwith %}

View File

@ -1,8 +1,9 @@
{% load i18n %}
<form class="field is-grouped is-small" action="/edit-readthrough" method="POST">
{% csrf_token %}
<input type="hidden" name="id" value="{{ readthrough.id }}"/>
<div class="field">
<label class="label is-align-self-center mb-0 pr-2" for="progress">Progress:</label>
<label class="label is-align-self-center mb-0 pr-2" for="progress">{% trans "Progress:" %}</label>
<div class="field has-addons mb-0">
<div class="control">
<input
@ -12,16 +13,16 @@
</div>
<div class="control select is-small">
<select name="progress_mode" aria-label="Progress mode">
<option value="PG" {% if readthrough.progress_mode == 'PG' %}selected{% endif %}>pages</option>
<option value="PCT" {% if readthrough.progress_mode == 'PCT' %}selected{% endif %}>percent</option>
<option value="PG" {% if readthrough.progress_mode == 'PG' %}selected{% endif %}>{% trans "pages" %}</option>
<option value="PCT" {% if readthrough.progress_mode == 'PCT' %}selected{% endif %}>{% trans "percent" %}</option>
</select>
</div>
<div class="control">
<button class="button is-small px-2 is-primary" type="submit">Save</button>
<button class="button is-small px-2 is-primary" type="submit">{% trans "Save" %}</button>
</div>
</div>
{% if readthrough.progress_mode == 'PG' and book.pages %}
<p class="help">of {{ book.pages }} pages</p>
<p class="help">{% blocktrans %}of {{ book.pages }} pages{% endblocktrans %}</p>
{% endif %}
</div>
</form>

View File

@ -1,6 +1,7 @@
{% load i18n %}
{% load bookwyrm_tags %}
{% if request.user.is_authenticated %}
<span class="is-sr-only">Leave a rating</span>
<span class="is-sr-only">{% trans "Leave a rating" %}</span>
<div class="block">
<form class="hidden-form" name="rate" action="/post/rating" method="POST">
{% csrf_token %}
@ -10,7 +11,7 @@
<input type="hidden" name="rating" value="{{ forloop.counter }}">
<div class="field is-grouped stars form-rate-stars mb-1 has-text-warning-dark">
<label class="is-sr-only" for="rating-no-rating-{{ book.id }}">No rating</label>
<label class="is-sr-only" for="rating-no-rating-{{ book.id }}">{% trans "No rating" %}</label>
<input class="is-sr-only" type="radio" name="rating" value="" id="rating-no-rating-{{ book.id }}" checked>
{% for i in '12345'|make_list %}
<input class="is-sr-only" id="rating-book{{book.id}}-star-{{ forloop.counter }}" type="radio" name="rating" value="{{ forloop.counter }}" {% if book|user_rating:user == forloop.counter %}checked{% endif %}>
@ -25,7 +26,7 @@
{% include 'snippets/privacy_select.html' with class="is-small" %}
</div>
<div class="control">
<button class="button is-small is-primary" type="submit">Rate</button>
<button class="button is-small is-primary" type="submit">{% trans "Rate" %}</button>
</div>
</div>
</form>

View File

@ -1,13 +1,14 @@
{% load i18n %}
{% load humanize %}
<div class="content block">
<div id="hide-edit-readthrough-{{ readthrough.id }}">
<div class="columns">
<div class="column">
Progress Updates:
{% trans "Progress Updates:" %}
</dl>
<ul>
{% if readthrough.finish_date or readthrough.progress %}
<li>{% if readthrough.finish_date %} {{ readthrough.finish_date | naturalday }}: finished {% else %}{% if readthrough.progress_mode == 'PG' %}on page {{ readthrough.progress }}{% if book.pages %} of {{ book.pages }}{% endif %}
<li>{% if readthrough.finish_date %} {{ readthrough.finish_date | naturalday }}: {% trans "finished" %} {% else %}{% if readthrough.progress_mode == 'PG' %}on page {{ readthrough.progress }}{% if book.pages %} of {{ book.pages }}{% endif %}
{% else %}{{ readthrough.progress }}%{% endif %}{% endif %}
{% if readthrough.progress %}
{% include 'snippets/toggle/toggle_button.html' with text="Show all updates" controls_text="updates" controls_uid=readthrough.id class="is-small" %}
@ -25,7 +26,7 @@
<input type="hidden" name="id" value="{{ progress_update.id }}"/>
<button type="submit" class="button is-small" for="delete-progressupdate-{{ progress_update.id }}" role="button" tabindex="0">
<span class="icon icon-x" title="Delete this progress update">
<span class="is-sr-only">Delete this progress update</span>
<span class="is-sr-only">{% trans "Delete this progress update" %}</span>
</span>
</button>
</form>
@ -35,7 +36,7 @@
{% endif %}
</li>
{% endif %}
<li>{{ readthrough.start_date | naturalday }}: started</li>
<li>{{ readthrough.start_date | naturalday }}: {% trans "started" %}</li>
</ul>
</div>
<div class="column is-narrow">
@ -53,11 +54,11 @@
</div>
<div class="box hidden" id="edit-readthrough-{{ readthrough.id }}" tabindex="0">
<h3 class="title is-5">Edit read dates</h3>
<h3 class="title is-5">{% trans "Edit read dates" %}</h3>
<form name="edit-readthrough" action="/edit-readthrough" method="post">
{% include 'snippets/readthrough_form.html' with readthrough=readthrough %}
<div class="field is-grouped">
<button class="button is-primary" type="submit">Save</button>
<button class="button is-primary" type="submit">{% trans "Save" %}</button>
{% include 'snippets/toggle/close_button.html' with text="Cancel" controls_text="edit-readthrough" controls_uid=readthrough.id %}
</div>
</form>

View File

@ -1,16 +1,17 @@
{% load i18n %}
{% csrf_token %}
<input type="hidden" name="id" value="{{ readthrough.id }}">
<input type="hidden" name="book" value="{{ book.id }}">
<div class="field">
<label class="label">
Started reading
{% trans "Started reading" %}
<input type="date" name="start_date" class="input" id="id_start_date-{{ readthrough.id }}" value="{{ readthrough.start_date | date:"Y-m-d" }}">
</label>
</div>
{# Only show progress for editing existing readthroughs #}
{% if readthrough.id and not readthrough.finish_date %}
<label class="label" for="id_progress-{{ readthrough.id }}">
Progress
{% trans "Progress" %}
</label>
<div class="field has-addons">
<div class="control">
@ -18,15 +19,15 @@
</div>
<div class="control select">
<select name="progress_mode" aria-label="Progress mode">
<option value="PG" {% if readthrough.progress_mode == 'PG' %}selected{% endif %}>pages</option>
<option value="PCT" {% if readthrough.progress_mode == 'PCT' %}selected{% endif %}>percent</option>
<option value="PG" {% if readthrough.progress_mode == 'PG' %}selected{% endif %}>{% trans "pages" %}</option>
<option value="PCT" {% if readthrough.progress_mode == 'PCT' %}selected{% endif %}>{% trans "percent" %}</option>
</select>
</div>
</div>
{% endif %}
<div class="field">
<label class="label">
Finished reading
{% trans "Finished reading" %}
<input type="date" name="finish_date" class="input" id="id_finish_date-{{ readthrough.id }}" value="{{ readthrough.finish_date | date:"Y-m-d" }}">
</label>
</div>

View File

@ -1,6 +1,7 @@
{% load i18n %}
{% csrf_token %}
<div class="field">
<label class="label" for="id_localname_register">Username:</label>
<label class="label" for="id_localname_register">{% trans "Username:" %}</label>
<div class="control">
<input type="text" name="localname" maxlength="150" class="input" required="" id="id_localname_register" value="{% if register_form.localname.value %}{{ register_form.localname.value }}{% endif %}">
</div>
@ -9,7 +10,7 @@
{% endfor %}
</div>
<div class="field">
<label class="label" for="id_email_register">Email address:</label>
<label class="label" for="id_email_register">{% trans "Email address:" %}</label>
<div class="control">
<input type="email" name="email" maxlength="254" class="input" id="id_email_register" value="{% if register_form.email.value %}{{ register_form.email.value }}{% endif %}">
{% for error in register_form.email.errors %}
@ -18,7 +19,7 @@
</div>
</div>
<div class="field">
<label class="label" for="id_password_register">Password:</label>
<label class="label" for="id_password_register">{% trans "Password:" %}</label>
<div class="control">
<input type="password" name="password" maxlength="128" class="input" required="" id="id_password_register">
{% for error in register_form.password.errors %}
@ -28,6 +29,6 @@
</div>
<div class="field is-grouped">
<div class="control">
<button class="button is-primary" type="submit">Sign Up</button>
<button class="button is-primary" type="submit">{% trans "Sign Up" %}</button>
</div>
</div>

View File

@ -1,15 +1,16 @@
{% load i18n %}
{{ obj.user.display_name }}{% if obj.status_type == 'GeneratedNote' %}
{{ obj.content | safe }}
{% elif obj.status_type == 'Review' and not obj.name and not obj.content%}
rated
{% trans "rated" %}
{% elif obj.status_type == 'Review' %}
reviewed
{% trans "reviewed" %}
{% elif obj.status_type == 'Comment' %}
commented on
{% trans "commented on" %}
{% elif obj.status_type == 'Quotation' %}
quoted
{% trans "quoted" %}
{% endif %}
{% if obj.book %}{{ obj.book.title | safe}}
{% elif obj.mention_books %}
{{ obj.mention_books.first.title }}
{% endif %}
{% endif %}

View File

@ -1,2 +1,3 @@
{% load i18n %}
<strong>{% if link %}<a href="{{ result.key }}">{{ result.title }}</a>{% else %}{{ result.title }}{% endif %}</strong>
{% if result.author %} by {{ result.author }}{% endif %}{% if result.year %} ({{ result.year }}){% endif %}
{% if result.author %} {% blocktrans with author=result.author %}by {{ author }}{% endblocktrans %}{% endif %}{% if result.year %} ({{ result.year }}){% endif %}

View File

@ -1,39 +1,20 @@
{% load humanize %}
{% load i18n %}
{% load bookwyrm_tags %}
{% if books|length > 0 %}
<div class="table-container">
<table class="table is-striped is-fullwidth">
<tr class="book-preview">
<th>
Cover
</th>
<th>
Title
</th>
<th>
Author
</th>
<th>
Published
</th>
<th>
Shelved
</th>
<th>
Started
</th>
<th>
Finished
</th>
<th>
External links
</th>
{% if ratings %}
<th>
Rating
</th>
{% endif %}
<th>{% trans "Cover" %}</th>
<th>{% trans "Title" %}</th>
<th>{% trans "Author" %}</th>
<th>{% trans "Published" %}</th>
<th>{% trans "Shelved" %}</th>
<th>{% trans "Started" %}</th>
<th>{% trans "Finished" %}</th>
<th>{% trans "External links" %}</th>{% if ratings %}
<th>{% trans "Rating" %}</th>{% endif %}
</tr>
{% for book in books %}
<tr class="book-preview">
@ -60,7 +41,7 @@
{{ read_through.finish_date | naturalday |default_if_none:""}}
</td>
<td>
<a href="https://openlibrary.org/book/{{ book.openlibrary_key }}" target="_blank">OpenLibrary</a>
<a href="https://openlibrary.org/book/{{ book.openlibrary_key }}" target="_blank">{% trans "OpenLibrary" %}</a>
</td>
{% if ratings %}
<td>
@ -77,13 +58,13 @@
</table>
</div>
{% else %}
<p>This shelf is empty.</p>
<p>{% trans "This shelf is empty." %}</p>
{% if shelf.editable %}
<form name="delete-shelf" action="/delete-shelf/{{ shelf.id }}" method="post">
{% csrf_token %}
<input type="hidden" name="user" value="{{ request.user.id }}">
<button class="button is-danger is-light" type="submit">
Delete shelf
{% trans "Delete shelf" %}
</button>
</form>
{% endif %}

View File

@ -1,6 +1,7 @@
{% extends 'components/dropdown.html' %}
{% load i18n %}
{% block dropdown-trigger %}
<span>Change shelf</span>
<span>{% trans "Change shelf" %}</span>
<span class="icon icon-arrow-down" aria-hidden="true"></span>
{% endblock %}
@ -23,7 +24,7 @@
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="shelf" value="{{ current.id }}">
<button class="button is-fullwidth is-small is-danger is-light" type="submit">Unshelve</button>
<button class="button is-fullwidth is-small is-danger is-light" type="submit">{% trans "Unshelve" %}</button>
</form>
</li>
{% endblock %}

View File

@ -1,7 +1,8 @@
{% extends 'components/modal.html' %}
{% load i18n %}
{% block modal-title %}
Finish "<em>{{ book.title }}</em>"
{% blocktrans with book_title=book.title %}Finish "<em>{{ book_title }}</em>"{% endblocktrans %}
{% endblock %}
@ -15,13 +16,13 @@ Finish "<em>{{ book.title }}</em>"
<input type="hidden" name="id" value="{{ readthrough.id }}">
<div class="field">
<label class="label">
Started reading
{% trans "Started reading" %}
<input type="date" name="start_date" class="input" id="finish_id_start_date-{{ uuid }}" value="{{ readthrough.start_date | date:"Y-m-d" }}">
</label>
</div>
<div class="field">
<label class="label">
Finished reading
{% trans "Finished reading" %}
<input type="date" name="finish_date" class="input" id="id_finish_date-{{ uuid }}" value="{% now "Y-m-d" %}">
</label>
</div>
@ -33,12 +34,12 @@ Finish "<em>{{ book.title }}</em>"
<div class="column field">
<label for="post_status-{{ uuid }}">
<input type="checkbox" name="post-status" class="checkbox" id="post_status-{{ uuid }}" checked>
Post to feed
{% trans "Post to feed" %}
</label>
{% include 'snippets/privacy_select.html' %}
</div>
<div class="column">
<button type="submit" class="button is-success">Save</button>
<button type="submit" class="button is-success">{% trans "Save" %}</button>
{% include 'snippets/toggle/close_button.html' with text="Cancel" controls_text="finish-reading" controls_uid=uuid %}
</div>
</div>

View File

@ -1,7 +1,8 @@
{% extends 'components/dropdown.html' %}
{% load i18n %}
{% block dropdown-trigger %}
<span class="icon icon-arrow-down">
<span class="is-sr-only">More shelves</span>
<span class="is-sr-only">{% trans "More shelves" %}</span>
</span>
{% endblock %}

View File

@ -1,4 +1,5 @@
{% load bookwyrm_tags %}
{% load i18n %}
{% for shelf in shelves %}
{% comparison_bool shelf.identifier active_shelf.shelf.identifier as is_current %}
{% if dropdown %}<li role="menuitem">{% endif %}
@ -6,7 +7,7 @@
{% if shelf.identifier == 'reading' %}{% if not dropdown or active_shelf.shelf.identifier|next_shelf != shelf.identifier %}
{% include 'snippets/toggle/toggle_button.html' with class=class text="Start reading" controls_text="start-reading" controls_uid=button_uuid focus="modal-title-start-reading" disabled=is_current %}
{% endif %}{% elif shelf.identifier == 'read' and active_shelf.shelf.identifier == 'read' %}{% if not dropdown or active_shelf.shelf.identifier|next_shelf != shelf.identifier %}
<button type="button" class="button {{ class }}" disabled><span>Read</span>
<button type="button" class="button {{ class }}" disabled><span>{% trans "Read" %}</span>
{% endif %}{% elif shelf.identifier == 'read' %}{% if not dropdown or active_shelf.shelf.identifier|next_shelf != shelf.identifier %}
{% include 'snippets/toggle/toggle_button.html' with class=class text="Finish reading" controls_text="finish-reading" controls_uid=button_uuid focus="modal-title-finish-reading" disabled=is_current %}
{% endif %}{% elif shelf.identifier == 'to-read' %}{% if not dropdown or active_shelf.shelf.identifier|next_shelf != shelf.identifier %}

View File

@ -1,7 +1,8 @@
{% extends 'components/modal.html' %}
{% load i18n %}
{% block modal-title %}
Start "<em>{{ book.title }}</em>"
{% blocktrans with book_title=book.title %}Start "<em>{{ book_title }}</em>"{% endblocktrans %}
{% endblock %}
{% block modal-form-open %}
@ -13,7 +14,7 @@ Start "<em>{{ book.title }}</em>"
{% csrf_token %}
<div class="field">
<label class="label">
Started reading
{% trans "Started reading" %}
<input type="date" name="start_date" class="input" id="start_id_start_date-{{ uuid }}" value="{% now "Y-m-d" %}">
</label>
</div>
@ -25,12 +26,12 @@ Start "<em>{{ book.title }}</em>"
<div class="column field">
<label for="post_status_start-{{ uuid }}">
<input type="checkbox" name="post-status" class="checkbox" id="post_status_start-{{ uuid }}" checked>
Post to feed
{% trans "Post to feed" %}
</label>
{% include 'snippets/privacy_select.html' %}
</div>
<div class="column">
<button class="button is-success" type="submit">Save</button>
<button class="button is-success" type="submit">{% trans "Save" %}</button>
{% include 'snippets/toggle/toggle_button.html' with text="Cancel" controls_text="start-reading" controls_uid=uuid %}
</div>
</div>

View File

@ -1,7 +1,8 @@
{% extends 'components/modal.html' %}
{% load i18n %}
{% block modal-title %}
Want to Read "<em>{{ book.title }}</em>"
{% blocktrans with book_title=book.title %}Want to Read "<em>{{ book_title }}</em>"{% endblocktrans %}
{% endblock %}
{% block modal-form-open %}
@ -16,13 +17,13 @@ Want to Read "<em>{{ book.title }}</em>"
<div class="column field">
<label for="post_status_want-{{ uuid }}">
<input type="checkbox" name="post-status" class="checkbox" id="post_status_want-{{ uuid }}" checked>
Post to feed
{% trans "Post to feed" %}
</label>
{% include 'snippets/privacy_select.html' %}
</div>
<div class="column">
<button class="button is-success" type="submit">
<span>Want to read</span>
<span>{% trans "Want to read" %}</span>
</button>
{% include 'snippets/toggle/toggle_button.html' with text="Cancel" controls_text="want-to-read" controls_uid=uuid %}
</div>

View File

@ -1,5 +1,6 @@
{% load i18n %}
<p class="stars">
<span class="is-sr-only">{% if rating %}{{ rating|floatformat }} star{{ rating|floatformat | pluralize }}{% else %}No rating{% endif %}</span>
<span class="is-sr-only">{% if rating %}{{ rating|floatformat }} star{{ rating|floatformat | pluralize }}{% else %}{% trans "No rating" %}{% endif %}</span>
{% for i in '12345'|make_list %}
<span class="icon is-small mr-1 icon-star-{% if rating >= forloop.counter %}full{% elif rating|floatformat:0 >= forloop.counter|floatformat:0 %}half{% else %}empty{% endif %}" aria-hidden="true">
</span>

View File

@ -1,9 +1,10 @@
{% load bookwyrm_tags %}
{% load i18n %}
{% if not status.deleted %}
{% if status.status_type == 'Boost' %}
{% include 'snippets/avatar.html' with user=status.user %}
{% include 'snippets/username.html' with user=status.user %}
boosted
{% trans "boosted" %}
{% include 'snippets/status/status_body.html' with status=status|boosted_status %}
{% else %}
{% include 'snippets/status/status_body.html' with status=status %}

View File

@ -1,4 +1,5 @@
{% extends 'components/card.html' %}
{% load i18n %}
{% load bookwyrm_tags %}
{% load humanize %}
@ -32,16 +33,16 @@
{% else %}
<a href="/login">
<span class="icon icon-comment" title="Reply">
<span class="is-sr-only">Reply</span>
<span class="icon icon-comment" title="{% trans 'Reply' %}">
<span class="is-sr-only">{% trans "Reply" %}</span>
</span>
<span class="icon icon-boost" title="Boost status">
<span class="is-sr-only">Boost status</span>
<span class="icon icon-boost" title="{% trans 'Boost status' %}">
<span class="is-sr-only">{% trans "Boost status" %}</span>
</span>
<span class="icon icon-heart" title="Like status">
<span class="is-sr-only">Like status</span>
<span class="icon icon-heart" title="{% trans 'Like status' %}">
<span class="is-sr-only">{% trans "Like status" %}</span>
</span>
</a>
{% endif %}

View File

@ -1,4 +1,5 @@
{% load bookwyrm_tags %}
{% load i18n %}
<div class="block">
{% if status.status_type == 'Review' %}
<div>
@ -38,7 +39,7 @@
{% for attachment in status.attachments.all %}
<div class="column is-narrow">
<figure class="image is-128x128">
<a href="/images/{{ attachment.image }}" target="_blank" aria-label="open image in new window">
<a href="/images/{{ attachment.image }}" target="_blank" aria-label="{% trans 'Open image in new window' %}">
<img src="/images/{{ attachment.image }}"{% if attachment.caption %} alt="{{ attachment.caption }}" title="{{ attachment.caption }}"{% endif %}>
</a>
</figure>

View File

@ -1,17 +1,18 @@
{% load bookwyrm_tags %}
{% load i18n %}
{% include 'snippets/avatar.html' with user=status.user %}
{% include 'snippets/username.html' with user=status.user %}
{% if status.status_type == 'GeneratedNote' %}
{{ status.content | safe }}
{% elif status.status_type == 'Review' and not status.name and not status.content%}
rated
{% trans "rated" %}
{% elif status.status_type == 'Review' %}
reviewed
{% trans "reviewed" %}
{% elif status.status_type == 'Comment' %}
commented on
{% trans "commented on" %}
{% elif status.status_type == 'Quotation' %}
quoted
{% trans "quoted" %}
{% elif status.reply_parent %}
{% with parent_status=status|parent %}
replied to {% include 'snippets/username.html' with user=parent_status.user possessive=True %} <a href="{{parent_status.remote_id }}">{% if parent_status.status_type == 'GeneratedNote' %}update{% else %}{{ parent_status.status_type | lower }}{% endif %}</a>

View File

@ -1,9 +1,10 @@
{% extends 'components/dropdown.html' %}
{% load i18n %}
{% load bookwyrm_tags %}
{% block dropdown-trigger %}
<span class="icon icon-dots-three">
<span class="is-sr-only">More options</span>
<span class="is-sr-only">{% trans "More options" %}</span>
</span>
{% endblock %}
@ -13,13 +14,13 @@
<form class="dropdown-item pt-0 pb-0" name="delete-{{status.id}}" action="/delete-status/{{ status.id }}" method="post">
{% csrf_token %}
<button class="button is-danger is-light is-fullwidth is-small" type="submit">
Delete post
{% trans "Delete post" %}
</button>
</form>
</li>
{% else %}
<li role="menuitem">
<a href="/direct-messages/{{ status.user|username }}" class="button is-fullwidth is-small">Send direct message</a>
<a href="/direct-messages/{{ status.user|username }}" class="button is-fullwidth is-small">{% trans "Send direct message" %}</a>
</li>
<li role="menuitem">
{% include 'snippets/block_button.html' with user=status.user class="is-fullwidth" %}

View File

@ -1,5 +1,6 @@
{% load i18n %}
<form name="switch-edition" action="/switch-edition" method="POST">
{% csrf_token %}
<input type="hidden" name="edition" value="{{ edition.id }}">
<button type="submit" class="button {{ size }}">Switch to this edition</button>
<button type="submit" class="button {{ size }}">{% trans "Switch to this edition" %}</button>
</form>

View File

@ -1,3 +1,4 @@
{% load i18n %}
<div class="control">
<form name="tag" action="/{% if tag.tag.identifier in user_tags %}untag{% else %}tag{% endif %}/" method="post">
{% csrf_token %}
@ -10,11 +11,11 @@
</a>
{% if tag.tag.identifier in user_tags %}
<button class="tag is-delete" type="submit">
<span class="is-sr-only">remove tag</span>
<span class="is-sr-only">{% trans "Remove tag" %}</span>
</button>
{% else %}
<button class="tag" type="submit">+
<span class="is-sr-only">add tag</span>
<span class="is-sr-only">{% trans "Add tag" %}</span>
</button>
{% endif %}
</div>

View File

@ -1,15 +1,16 @@
{% extends 'components/dropdown.html' %}
{% load i18n %}
{% load bookwyrm_tags %}
{% block dropdown-trigger %}
<span class="icon icon-dots-three">
<span class="is-sr-only">More options</span>
<span class="is-sr-only">{% trans "More options" %}</span>
</span>
{% endblock %}
{% block dropdown-list %}
<li role="menuitem">
<a href="/direct-messages/{{ user|username }}" class="button is-fullwidth is-small">Send direct message</a>
<a href="/direct-messages/{{ user|username }}" class="button is-fullwidth is-small">{% trans "Send direct message" %}</a>
</li>
<li role="menuitem">
{% include 'snippets/block_button.html' with user=user class="is-fullwidth" %}