Merge branch 'main' into i18n-second-pass

This commit is contained in:
Mouse Reeve 2021-02-28 17:22:25 -08:00
commit bd44bf0980
61 changed files with 422 additions and 346 deletions

View file

@ -1,6 +1,9 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% load bookwyrm_tags %} {% load bookwyrm_tags %}
{% block title %}{{ author.name }}{% endblock %}
{% block content %} {% block content %}
<div class="block"> <div class="block">
<div class="columns is-mobile"> <div class="columns is-mobile">

View file

@ -2,8 +2,10 @@
{% load i18n %} {% load i18n %}
{% load bookwyrm_tags %} {% load bookwyrm_tags %}
{% load humanize %} {% load humanize %}
{% block content %}
{% block title %}{{ book.title }}{% endblock %}
{% block content %}
<div class="block"> <div class="block">
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column"> <div class="column">

View file

@ -1,10 +1,10 @@
{% extends 'discover/landing_layout.html' %} {% extends 'discover/landing_layout.html' %}
{% load i18n %} {% load i18n %}
{% block panel %}
{% block panel %}
<div class="block columns mt-4"> <div class="block columns mt-4">
<nav class="menu column is-one-quarter"> <nav class="menu column is-one-quarter">
<h2 class="menu-label">About {{ site.name }}</h2> <h2 class="menu-label">{% blocktrans with site_name=site.name %}About {{ site_name }}{% endblocktrans %}</h2>
<ul class="menu-list"> <ul class="menu-list">
<li> <li>
<a href="#coc">{% trans "Code of Conduct" %}</a> <a href="#coc">{% trans "Code of Conduct" %}</a>

View file

@ -1,8 +1,10 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% load bookwyrm_tags %} {% load bookwyrm_tags %}
{% block content %}
{% block title %}{% trans "Welcome" %}{% endblock %}
{% block content %}
<header class="block has-text-centered"> <header class="block has-text-centered">
<h1 class="title">{{ site.name }}</h1> <h1 class="title">{{ site.name }}</h1>
<h2 class="subtitle">{{ site.instance_tagline }}</h2> <h2 class="subtitle">{{ site.instance_tagline }}</h2>

View file

@ -1,6 +1,9 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% load humanize %} {% load humanize %}
{% block title %}{% trans "Edit Author" %}: {{ author.name }}{% endblock %}
{% block content %} {% block content %}
<header class="block"> <header class="block">
<h1 class="title level-left"> <h1 class="title level-left">

View file

@ -1,6 +1,9 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% load humanize %} {% load humanize %}
{% block title %}{% trans "Edit Book" %}{% endblock %}
{% block content %} {% block content %}
<header class="block"> <header class="block">
<h1 class="title level-left"> <h1 class="title level-left">

View file

@ -1,6 +1,9 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% load bookwyrm_tags %} {% load bookwyrm_tags %}
{% block title %}{% blocktrans with book_title=work.title %}Editions of {{ book_title }}{% endblocktrans %}{% endblock %}
{% block content %} {% block content %}
<div class="block"> <div class="block">
<h1 class="title">{% blocktrans with path=work.local_path work_title=work.title %}Editions of <a href="{{ work_path }}">"{{ work_title }}"</a>{% endblocktrans %}</h1> <h1 class="title">{% blocktrans with path=work.local_path work_title=work.title %}Editions of <a href="{{ work_path }}">"{{ work_title }}"</a>{% endblocktrans %}</h1>

View file

@ -1,11 +1,12 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% block content %}
{% block title %}{% trans "Oops!" %}{% endblock %}
{% block content %}
<div class="block"> <div class="block">
<h1 class="title">{% trans "Server Error" %}</h1> <h1 class="title">{% trans "Server Error" %}</h1>
<p>{% trans "Something went wrong! Sorry about that." %}</p> <p>{% trans "Something went wrong! Sorry about that." %}</p>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -3,7 +3,13 @@
{% block panel %} {% block panel %}
<header class="block"> <header class="block">
<h1 class="title">Direct Messages{% if partner %} with {% include 'snippets/username.html' with user=partner %}{% endif %}</h1> <h1 class="title">
{% if partner %}
{% blocktrans with username=partner.display_name path=partner.local_path %}Direct Messages with <a href="{{ path }}">{{ username }}</a>{% endblocktrans %}
{% else %}
{% trans "Direct Messages" %}
{% endif %}
</h1>
{% if partner %}<p class="subtitle"><a href="/direct-messages"><span class="icon icon-arrow-left" aria-hidden="true"></span> {% trans "All messages" %}</a></p>{% endif %} {% if partner %}<p class="subtitle"><a href="/direct-messages"><span class="icon icon-arrow-left" aria-hidden="true"></span> {% trans "All messages" %}</a></p>{% endif %}
</header> </header>

View file

@ -1,8 +1,10 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% load bookwyrm_tags %} {% load bookwyrm_tags %}
{% block content %}
{% block title %}{% trans "Updates" %}{% endblock %}
{% block content %}
<div class="columns"> <div class="columns">
{% if user.is_authenticated %} {% if user.is_authenticated %}
<div class="column is-one-third"> <div class="column is-one-third">

View file

@ -1,5 +1,6 @@
{% extends 'feed/feed_layout.html' %} {% extends 'feed/feed_layout.html' %}
{% load i18n %} {% load i18n %}
{% block panel %} {% block panel %}
<header class="block"> <header class="block">
<a href="/#feed" class="button" data-back> <a href="/#feed" class="button" data-back>

View file

@ -23,7 +23,7 @@
<section class="card {% if goal %}hidden{% endif %}" id="show-edit-goal"> <section class="card {% if goal %}hidden{% endif %}" id="show-edit-goal">
<header class="card-header"> <header class="card-header">
<h2 class="card-header-title has-background-primary has-text-white" tabindex="0" id="edit-form-header"> <h2 class="card-header-title has-background-primary has-text-white" tabindex="0" id="edit-form-header">
<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 %}
</h2> </h2>
</header> </header>
<section class="card-content content"> <section class="card-content content">

View file

@ -1,6 +1,9 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% load humanize %} {% load humanize %}
{% block title %}{% trans "Import Books" %}{% endblock %}
{% block content %} {% block content %}
<div class="block"> <div class="block">
<h1 class="title">{% trans "Import Books" %}</h1> <h1 class="title">{% trans "Import Books" %}</h1>

View file

@ -2,6 +2,9 @@
{% load i18n %} {% load i18n %}
{% load bookwyrm_tags %} {% load bookwyrm_tags %}
{% load humanize %} {% load humanize %}
{% block title %}{% trans "Import Status" %}{% endblock %}
{% block content %} {% block content %}
<div class="block"> <div class="block">
<h1 class="title">{% trans "Import Status" %}</h1> <h1 class="title">{% trans "Import Status" %}</h1>

View file

@ -1,5 +1,8 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Create an Account" %}{% endblock %}
{% block content %} {% block content %}
<div class="columns"> <div class="columns">

View file

@ -3,7 +3,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<title>{% if title %}{{ title }} | {% endif %}{{ site.name }}</title> <title>{% block title %}BookWyrm{% endblock %} | {{ site.name }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link type="text/css" rel="stylesheet" href="/static/css/bulma.min.css"> <link type="text/css" rel="stylesheet" href="/static/css/bulma.min.css">
<link type="text/css" rel="stylesheet" href="/static/css/format.css"> <link type="text/css" rel="stylesheet" href="/static/css/format.css">

View file

@ -1,8 +1,8 @@
{% extends 'lists/list_layout.html' %} {% extends 'lists/list_layout.html' %}
{% load i18n %} {% load i18n %}
{% load bookwyrm_tags %} {% load bookwyrm_tags %}
{% block panel %}
{% block panel %}
{% if request.user == list.user and pending_count %} {% if request.user == list.user and pending_count %}
<div class="block content"> <div class="block content">
<p> <p>

View file

@ -1,8 +1,10 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% load bookwyrm_tags %} {% load bookwyrm_tags %}
{% block content %}
{% block title %}{{ list.name }}{% endblock %}
{% block content %}
<header class="columns content is-mobile"> <header class="columns content is-mobile">
<div class="column"> <div class="column">
<h1 class="title">{{ list.name }} <span class="subtitle">{% include 'snippets/privacy-icons.html' with item=list %}</span></h1> <h1 class="title">{{ list.name }} <span class="subtitle">{% include 'snippets/privacy-icons.html' with item=list %}</span></h1>

View file

@ -1,5 +1,8 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Lists" %}{% endblock %}
{% block content %} {% block content %}
<header class="block"> <header class="block">

View file

@ -1,7 +1,9 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% block content %}
{% block title %}{% trans "Login" %}{% endblock %}
{% block content %}
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<div class="box"> <div class="box">

View file

@ -1,10 +1,11 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% block content %}
{% block title %}{% trans "Not Found" %}{% endblock %}
{% block content %}
<div class="block"> <div class="block">
<h1 class="title">{% trans "Not Found" %}</h1> <h1 class="title">{% trans "Not Found" %}</h1>
<p>{% trans "The page your requested doesn't seem to exist!" %}</p> <p>{% trans "The page your requested doesn't seem to exist!" %}</p>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -2,6 +2,9 @@
{% load i18n %} {% load i18n %}
{% load humanize %} {% load humanize %}
{% load bookwyrm_tags %} {% load bookwyrm_tags %}
{% block title %}{% trans "Notifications" %}{% endblock %}
{% block content %} {% block content %}
<div class="block"> <div class="block">
<h1 class="title">{% trans "Notifications" %}</h1> <h1 class="title">{% trans "Notifications" %}</h1>

View file

@ -1,7 +1,9 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% block content %}
{% block title %}{% trans "Reset Password" %}{% endblock %}
{% block content %}
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<div class="block"> <div class="block">

View file

@ -1,7 +1,9 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% block content %}
{% block title %}{% trans "Reset Password" %}{% endblock %}
{% block content %}
<div class="columns is-centered"> <div class="columns is-centered">
<div class="column is-half"> <div class="column is-half">
<div class="block"> <div class="block">

View file

@ -1,6 +1,8 @@
{% extends 'preferences/preferences_layout.html' %} {% extends 'preferences/preferences_layout.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Blocked Users" %}{{ author.name }}{% endblock %}
{% block header %} {% block header %}
{% trans "Blocked Users" %} {% trans "Blocked Users" %}
{% endblock %} {% endblock %}

View file

@ -1,5 +1,8 @@
{% extends 'preferences/preferences_layout.html' %} {% extends 'preferences/preferences_layout.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Change Password" %}{% endblock %}
{% block header %} {% block header %}
{% trans "Change Password" %} {% trans "Change Password" %}
{% endblock %} {% endblock %}
@ -15,6 +18,6 @@
<label class="label" for="id_confirm_password">{% trans "Confirm password:" %}</label> <label class="label" for="id_confirm_password">{% trans "Confirm password:" %}</label>
<input type="password" name="confirm-password" maxlength="128" class="input" required="" id="id_confirm_password"> <input type="password" name="confirm-password" maxlength="128" class="input" required="" id="id_confirm_password">
</div> </div>
<button class="button is-primary" type="submit">{% trans "Change password" %}</button> <button class="button is-primary" type="submit">{% trans "Change Password" %}</button>
</form> </form>
{% endblock %} {% endblock %}

View file

@ -1,5 +1,8 @@
{% extends 'preferences/preferences_layout.html' %} {% extends 'preferences/preferences_layout.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Edit Profile" %}{% endblock %}
{% block header %} {% block header %}
{% trans "Edit Profile" %} {% trans "Edit Profile" %}
{% endblock %} {% endblock %}

View file

@ -14,13 +14,13 @@
<a href="/preferences/profile"{% if '/preferences/profile' in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Profile" %}</a> <a href="/preferences/profile"{% if '/preferences/profile' in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Profile" %}</a>
</li> </li>
<li> <li>
<a href="/preferences/password"{% if '/preferences/password' in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Change password" %}</a> <a href="/preferences/password"{% if '/preferences/password' in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Change Password" %}</a>
</li> </li>
</ul> </ul>
<h2 class="menu-label">{% trans "Relationships" %}</h2> <h2 class="menu-label">{% trans "Relationships" %}</h2>
<ul class="menu-list"> <ul class="menu-list">
<li> <li>
<a href="/preferences/block"{% if '/preferences/block' in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Blocked users" %}</a> <a href="/preferences/block"{% if '/preferences/block' in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Blocked Users" %}</a>
</li> </li>
</ul> </ul>
</nav> </nav>

View file

@ -1,5 +1,8 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Search Results" %}{% endblock %}
{% block content %} {% block content %}
{% with book_results|first as local_results %} {% with book_results|first as local_results %}
<div class="block"> <div class="block">

View file

@ -1,5 +1,8 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Administration" %}{% endblock %}
{% block content %} {% block content %}
<header class="block column is-offset-one-quarter pl-1"> <header class="block column is-offset-one-quarter pl-1">
@ -26,7 +29,7 @@
<ul class="menu-list"> <ul class="menu-list">
<li> <li>
{% url 'settings-site' as url %} {% url 'settings-site' as url %}
<a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Site Configuration" %}</a> <a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Site Settings" %}</a>
{% if url in request.path %} {% if url in request.path %}
<ul class="emnu-list"> <ul class="emnu-list">
<li><a href="{{ url }}#instance-info">{% trans "Instance Info" %}</a></li> <li><a href="{{ url }}#instance-info">{% trans "Instance Info" %}</a></li>

View file

@ -1,5 +1,6 @@
{% extends 'settings/admin_layout.html' %} {% extends 'settings/admin_layout.html' %}
{% load i18n %} {% load i18n %}
{% block header %}{% trans "Federated Servers" %}{% endblock %} {% block header %}{% trans "Federated Servers" %}{% endblock %}
{% block panel %} {% block panel %}

View file

@ -1,6 +1,9 @@
{% extends 'settings/admin_layout.html' %} {% extends 'settings/admin_layout.html' %}
{% load i18n %} {% load i18n %}
{% block header %}{% trans "Site Configuration" %}{% endblock %}
{% block title %}{% trans "Site Settings" %}{% endblock %}
{% block header %}{% trans "Site Settings" %}{% endblock %}
{% block panel %} {% block panel %}

View file

@ -7,7 +7,7 @@
<input type="hidden" name="reply_parent" value="{{ reply_parent.id }}"> <input type="hidden" name="reply_parent" value="{{ reply_parent.id }}">
{% if type == 'review' %} {% if type == 'review' %}
<div class="control"> <div class="control">
<label class="label" for="id_name_{{ book.id }}_{{ type }}">{% trans "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 }}'"> <input type="text" name="name" maxlength="255" class="input" required="" id="id_name_{{ book.id }}_{{ type }}" placeholder="My {{ type }} of '{{ book.title }}'">
</div> </div>
{% endif %} {% endif %}
@ -41,7 +41,7 @@
</div> </div>
{% if type == 'quotation' %} {% if type == 'quotation' %}
<div class="control"> <div class="control">
<label class="label" for="id_content_quote-{{ book.id }}">{% trans "Comment:" %}</label> <label class="label" for="id_content_quote-{{ book.id }}">{% trans "Comment" %}:</label>
{% include 'snippets/content_warning_field.html' with parent_status=status %} {% include 'snippets/content_warning_field.html' with parent_status=status %}
<textarea name="content" class="textarea is-small" id="id_content_quote-{{ book.id }}"></textarea> <textarea name="content" class="textarea is-small" id="id_content_quote-{{ book.id }}"></textarea>
</div> </div>

View file

@ -3,7 +3,7 @@
{% block card-header %} {% block card-header %}
<h3 class="card-header-title has-background-primary has-text-white"> <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> {% blocktrans %}{{ year }} reading goal{% endblocktrans %} <span class="icon icon-book is-size-3 mr-2" aria-hidden="true"></span> {% blocktrans %}{{ year }} Reading Goal{% endblocktrans %}
</h3> </h3>
{% endblock %} {% endblock %}

View file

@ -1,13 +1,14 @@
{% extends 'layout.html' %} {% extends 'layout.html' %}
{% load i18n %} {% load i18n %}
{% load bookwyrm_tags %} {% load bookwyrm_tags %}
{% block content %}
{% block title %}{{ tag.name }}{% endblock %}
{% block content %}
<div class="block"> <div class="block">
<h1 class="title">{% blocktrans %}Books tagged "{{ tag.name }}"{% endblocktrans %}</h1> <h1 class="title">{% blocktrans %}Books tagged "{{ tag.name }}"{% endblocktrans %}</h1>
{% include 'snippets/book_tiles.html' with books=books.all %} {% include 'snippets/book_tiles.html' with books=books.all %}
</div> </div>
{% endblock %} {% endblock %}

View file

@ -4,11 +4,7 @@
{% block header %} {% block header %}
<h1 class="title"> <h1 class="title">
{% if is_self %}Your {% trans "User Profile" %}
{% else %}
{% include 'snippets/username.html' with user=user possessive=True %}
{% endif %}
followers
</h1> </h1>
{% endblock %} {% endblock %}

View file

@ -4,11 +4,7 @@
{% block header %} {% block header %}
<h1 class="title"> <h1 class="title">
Users following {% trans "User Profile" %}
{% if is_self %}you
{% else %}
{% include 'snippets/username.html' with user=user %}
{% endif %}
</h1> </h1>
{% endblock %} {% endblock %}

View file

@ -5,11 +5,11 @@
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column"> <div class="column">
<h1 class="title"> <h1 class="title">
{% if is_self %}Your {% if is_self %}
{% trans "Your Lists" %}
{% else %} {% else %}
{% include 'snippets/username.html' with user=user %}'s {% blocktrans with username=user.display_name %}Lists: {{ username }}{% endblocktrans %}
{% endif %} {% endif %}
Lists
</h1> </h1>
</div> </div>
{% if is_self %} {% if is_self %}

View file

@ -5,11 +5,11 @@
{% block header %} {% block header %}
<header class="columns"> <header class="columns">
<h1 class="title"> <h1 class="title">
{% if is_self %}Your {% if is_self %}
{% trans "Your Shelves" %}
{% else %} {% else %}
{% include 'snippets/username.html' with user=user possessive=True %} {% blocktrans with username=user.display_name %}{{ username }}: Shelves{% endblocktrans %}
{% endif %} {% endif %}
shelves
</h1> </h1>
</header> </header>
{% endblock %} {% endblock %}

View file

@ -1,10 +1,12 @@
{% extends 'user/user_layout.html' %} {% extends 'user/user_layout.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{{ user.name }}{% endblock %}
{% block header %} {% block header %}
<div class="columns is-mobile"> <div class="columns is-mobile">
<div class="column"> <div class="column">
<h1 class="title">{% trans "User profile" %}</h1> <h1 class="title">{% trans "User Profile" %}</h1>
</div> </div>
{% if is_self %} {% if is_self %}
<div class="column is-narrow"> <div class="column is-narrow">

View file

@ -3,6 +3,8 @@
{% load humanize %} {% load humanize %}
{% load bookwyrm_tags %} {% load bookwyrm_tags %}
{% block title %}{{ user.display_name }}{% endblock %}
{% block content %} {% block content %}
<header class="block"> <header class="block">
{% block header %}{% endblock %} {% block header %}{% endblock %}

View file

@ -6,6 +6,7 @@ from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse from django.template.response import TemplateResponse
from django.utils import timezone from django.utils import timezone
from django.utils.decorators import method_decorator from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from django.views import View from django.views import View
from bookwyrm import forms, models from bookwyrm import forms, models
@ -13,6 +14,7 @@ from bookwyrm.settings import DOMAIN
# pylint: disable= no-self-use # pylint: disable= no-self-use
@method_decorator(csrf_exempt, name='dispatch')
class Login(View): class Login(View):
''' authenticate an existing user ''' ''' authenticate an existing user '''
def get(self, request): def get(self, request):
@ -21,7 +23,6 @@ class Login(View):
return redirect('/') return redirect('/')
# sene user to the login page # sene user to the login page
data = { data = {
'title': 'Login',
'login_form': forms.LoginForm(), 'login_form': forms.LoginForm(),
'register_form': forms.RegisterForm(), 'register_form': forms.RegisterForm(),
} }
@ -29,6 +30,8 @@ class Login(View):
def post(self, request): def post(self, request):
''' authentication action ''' ''' authentication action '''
if request.user.is_authenticated:
return redirect('/')
login_form = forms.LoginForm(request.POST) login_form = forms.LoginForm(request.POST)
localname = login_form.data['localname'] localname = login_form.data['localname']

View file

@ -24,7 +24,6 @@ class Author(View):
books = models.Work.objects.filter( books = models.Work.objects.filter(
Q(authors=author) | Q(editions__authors=author)).distinct() Q(authors=author) | Q(editions__authors=author)).distinct()
data = { data = {
'title': author.name,
'author': author, 'author': author,
'books': [b.get_default_edition() for b in books], 'books': [b.get_default_edition() for b in books],
} }
@ -41,7 +40,6 @@ class EditAuthor(View):
''' info about a book ''' ''' info about a book '''
author = get_object_or_404(models.Author, id=author_id) author = get_object_or_404(models.Author, id=author_id)
data = { data = {
'title': 'Edit Author',
'author': author, 'author': author,
'form': forms.AuthorForm(instance=author) 'form': forms.AuthorForm(instance=author)
} }
@ -54,7 +52,6 @@ class EditAuthor(View):
form = forms.AuthorForm(request.POST, request.FILES, instance=author) form = forms.AuthorForm(request.POST, request.FILES, instance=author)
if not form.is_valid(): if not form.is_valid():
data = { data = {
'title': 'Edit Author',
'author': author, 'author': author,
'form': form 'form': form
} }

View file

@ -15,8 +15,7 @@ class Block(View):
''' blocking users ''' ''' blocking users '''
def get(self, request): def get(self, request):
''' list of blocked users? ''' ''' list of blocked users? '''
return TemplateResponse( return TemplateResponse(request, 'preferences/blocks.html')
request, 'preferences/blocks.html', {'title': 'Blocked Users'})
def post(self, request, user_id): def post(self, request, user_id):
''' block a user ''' ''' block a user '''

View file

@ -82,7 +82,6 @@ class Book(View):
) )
data = { data = {
'title': book.title,
'book': book, 'book': book,
'reviews': reviews_page, 'reviews': reviews_page,
'review_count': reviews.count(), 'review_count': reviews.count(),
@ -113,7 +112,6 @@ class EditBook(View):
if not book.description: if not book.description:
book.description = book.parent_work.description book.description = book.parent_work.description
data = { data = {
'title': 'Edit Book',
'book': book, 'book': book,
'form': forms.EditionForm(instance=book) 'form': forms.EditionForm(instance=book)
} }
@ -126,7 +124,6 @@ class EditBook(View):
form = forms.EditionForm(request.POST, request.FILES, instance=book) form = forms.EditionForm(request.POST, request.FILES, instance=book)
if not form.is_valid(): if not form.is_valid():
data = { data = {
'title': 'Edit Book',
'book': book, 'book': book,
'form': form 'form': form
} }
@ -146,7 +143,6 @@ class Editions(View):
return ActivitypubResponse(work.to_edition_list(**request.GET)) return ActivitypubResponse(work.to_edition_list(**request.GET))
data = { data = {
'title': 'Editions of %s' % work.title,
'editions': work.editions.order_by('-edition_rank').all(), 'editions': work.editions.order_by('-edition_rank').all(),
'work': work, 'work': work,
} }

View file

@ -3,11 +3,9 @@ from django.template.response import TemplateResponse
def server_error_page(request): def server_error_page(request):
''' 500 errors ''' ''' 500 errors '''
return TemplateResponse( return TemplateResponse(request, 'error.html', status=500)
request, 'error.html', {'title': 'Oops!'}, status=500)
def not_found_page(request, _): def not_found_page(request, _):
''' 404s ''' ''' 404s '''
return TemplateResponse( return TemplateResponse(request, 'notfound.html', status=404)
request, 'notfound.html', {'title': 'Not found'}, status=404)

View file

@ -17,8 +17,5 @@ class Federation(View):
def get(self, request): def get(self, request):
''' edit form ''' ''' edit form '''
servers = models.FederatedServer.objects.all() servers = models.FederatedServer.objects.all()
data = { data = {'servers': servers}
'title': 'Federated Servers',
'servers': servers
}
return TemplateResponse(request, 'settings/federation.html', data) return TemplateResponse(request, 'settings/federation.html', data)

View file

@ -38,7 +38,6 @@ class Feed(View):
paginated = Paginator(activities, PAGE_LENGTH) paginated = Paginator(activities, PAGE_LENGTH)
data = {**feed_page_data(request.user), **{ data = {**feed_page_data(request.user), **{
'title': 'Updates Feed',
'user': request.user, 'user': request.user,
'activities': paginated.page(page), 'activities': paginated.page(page),
'tab': tab, 'tab': tab,
@ -75,7 +74,6 @@ class DirectMessage(View):
paginated = Paginator(activities, PAGE_LENGTH) paginated = Paginator(activities, PAGE_LENGTH)
activity_page = paginated.page(page) activity_page = paginated.page(page)
data = {**feed_page_data(request.user), **{ data = {**feed_page_data(request.user), **{
'title': 'Direct Messages',
'user': request.user, 'user': request.user,
'partner': user, 'partner': user,
'activities': activity_page, 'activities': activity_page,
@ -108,7 +106,6 @@ class Status(View):
status.to_activity(pure=not is_bookwyrm_request(request))) status.to_activity(pure=not is_bookwyrm_request(request)))
data = {**feed_page_data(request.user), **{ data = {**feed_page_data(request.user), **{
'title': 'Status by %s' % user.username,
'status': status, 'status': status,
}} }}
return TemplateResponse(request, 'feed/status.html', data) return TemplateResponse(request, 'feed/status.html', data)

View file

@ -30,7 +30,6 @@ class Goal(View):
return HttpResponseNotFound() return HttpResponseNotFound()
data = { data = {
'title': '%s\'s %d Reading' % (user.display_name, year),
'goal_form': forms.GoalForm(instance=goal), 'goal_form': forms.GoalForm(instance=goal),
'goal': goal, 'goal': goal,
'user': user, 'user': user,
@ -53,7 +52,6 @@ class Goal(View):
form = forms.GoalForm(request.POST, instance=goal) form = forms.GoalForm(request.POST, instance=goal)
if not form.is_valid(): if not form.is_valid():
data = { data = {
'title': '%s\'s %d Reading' % (request.user.display_name, year),
'goal_form': form, 'goal_form': form,
'goal': goal, 'goal': goal,
'year': year, 'year': year,

View file

@ -19,7 +19,6 @@ class Import(View):
def get(self, request): def get(self, request):
''' load import page ''' ''' load import page '''
return TemplateResponse(request, 'import.html', { return TemplateResponse(request, 'import.html', {
'title': 'Import Books',
'import_form': forms.ImportForm(), 'import_form': forms.ImportForm(),
'jobs': models.ImportJob. 'jobs': models.ImportJob.
objects.filter(user=request.user).order_by('-created_date'), objects.filter(user=request.user).order_by('-created_date'),
@ -71,7 +70,6 @@ class ImportStatus(View):
failed_items = [i for i in items if i.fail_reason] failed_items = [i for i in items if i.fail_reason]
items = [i for i in items if not i.fail_reason] items = [i for i in items if not i.fail_reason]
return TemplateResponse(request, 'import_status.html', { return TemplateResponse(request, 'import_status.html', {
'title': 'Import Status',
'job': job, 'job': job,
'items': items, 'items': items,
'failed_items': failed_items, 'failed_items': failed_items,

View file

@ -30,7 +30,6 @@ class ManageInvites(View):
).order_by('-created_date'), PAGE_LENGTH) ).order_by('-created_date'), PAGE_LENGTH)
data = { data = {
'title': 'Invitations',
'invites': paginated.page(page), 'invites': paginated.page(page),
'form': forms.CreateInviteForm(), 'form': forms.CreateInviteForm(),
} }
@ -50,7 +49,6 @@ class ManageInvites(View):
user=request.user user=request.user
).order_by('-created_date'), PAGE_LENGTH) ).order_by('-created_date'), PAGE_LENGTH)
data = { data = {
'title': 'Invitations',
'invites': paginated.page(1), 'invites': paginated.page(1),
'form': form 'form': form
} }
@ -66,7 +64,6 @@ class Invite(View):
invite = get_object_or_404(models.SiteInvite, code=code) invite = get_object_or_404(models.SiteInvite, code=code)
data = { data = {
'title': 'Join',
'register_form': forms.RegisterForm(), 'register_form': forms.RegisterForm(),
'invite': invite, 'invite': invite,
'valid': invite.valid() if invite else True, 'valid': invite.valid() if invite else True,

View file

@ -12,10 +12,7 @@ class About(View):
''' create invites ''' ''' create invites '''
def get(self, request): def get(self, request):
''' more information about the instance ''' ''' more information about the instance '''
data = { return TemplateResponse(request, 'discover/about.html')
'title': 'About',
}
return TemplateResponse(request, 'discover/about.html', data)
class Home(View): class Home(View):
''' discover page or home feed depending on auth ''' ''' discover page or home feed depending on auth '''
@ -43,7 +40,6 @@ class Discover(View):
).order_by('-review__published_date__max')[:6] ).order_by('-review__published_date__max')[:6]
data = { data = {
'title': 'Discover',
'register_form': forms.RegisterForm(), 'register_form': forms.RegisterForm(),
'books': list(set(books)), 'books': list(set(books)),
} }

View file

@ -40,7 +40,6 @@ class Lists(View):
paginated = Paginator(lists, 12) paginated = Paginator(lists, 12)
data = { data = {
'title': 'Lists',
'lists': paginated.page(page), 'lists': paginated.page(page),
'list_form': forms.ListForm(), 'list_form': forms.ListForm(),
'path': '/list', 'path': '/list',
@ -72,7 +71,6 @@ class UserLists(View):
paginated = Paginator(lists, 12) paginated = Paginator(lists, 12)
data = { data = {
'title': '%s: Lists' % user.name,
'user': user, 'user': user,
'is_self': request.user.id == user.id, 'is_self': request.user.id == user.id,
'lists': paginated.page(page), 'lists': paginated.page(page),
@ -114,7 +112,6 @@ class List(View):
data = { data = {
'title': '%s | Lists' % book_list.name,
'list': book_list, 'list': book_list,
'items': book_list.listitem_set.filter(approved=True), 'items': book_list.listitem_set.filter(approved=True),
'pending_count': book_list.listitem_set.filter( 'pending_count': book_list.listitem_set.filter(
@ -149,7 +146,6 @@ class Curate(View):
return HttpResponseNotFound() return HttpResponseNotFound()
data = { data = {
'title': 'Curate "%s" | Lists' % book_list.name,
'list': book_list, 'list': book_list,
'pending': book_list.listitem_set.filter(approved=False), 'pending': book_list.listitem_set.filter(approved=False),
'list_form': forms.ListForm(instance=book_list), 'list_form': forms.ListForm(instance=book_list),

View file

@ -16,7 +16,6 @@ class Notifications(View):
.order_by('-created_date') .order_by('-created_date')
unread = [n.id for n in notifications.filter(read=False)] unread = [n.id for n in notifications.filter(read=False)]
data = { data = {
'title': 'Notifications',
'notifications': notifications, 'notifications': notifications,
'unread': unread, 'unread': unread,
} }

View file

@ -19,7 +19,6 @@ class PasswordResetRequest(View):
return TemplateResponse( return TemplateResponse(
request, request,
'password_reset_request.html', 'password_reset_request.html',
{'title': 'Reset Password'}
) )
def post(self, request): def post(self, request):
@ -53,11 +52,7 @@ class PasswordReset(View):
except models.PasswordReset.DoesNotExist: except models.PasswordReset.DoesNotExist:
raise PermissionDenied raise PermissionDenied
return TemplateResponse( return TemplateResponse(request, 'password_reset.html')
request,
'password_reset.html',
{'title': 'Reset Password', 'code': reset_code.code}
)
def post(self, request, code): def post(self, request, code):
''' allow a user to change their password through an emailed token ''' ''' allow a user to change their password through an emailed token '''
@ -90,10 +85,7 @@ class ChangePassword(View):
''' change password as logged in user ''' ''' change password as logged in user '''
def get(self, request): def get(self, request):
''' change password page ''' ''' change password page '''
data = { data = {'user': request.user}
'title': 'Change Password',
'user': request.user,
}
return TemplateResponse( return TemplateResponse(
request, 'preferences/change_password.html', data) request, 'preferences/change_password.html', data)

View file

@ -58,7 +58,6 @@ class Search(View):
book_results = connector_manager.search( book_results = connector_manager.search(
query, min_confidence=min_confidence) query, min_confidence=min_confidence)
data = { data = {
'title': 'Search Results',
'book_results': book_results, 'book_results': book_results,
'user_results': user_results, 'user_results': user_results,
'list_results': list_results, 'list_results': list_results,

View file

@ -53,7 +53,6 @@ class Shelf(View):
).order_by('-updated_date').all() ).order_by('-updated_date').all()
data = { data = {
'title': '%s\'s %s shelf' % (user.display_name, shelf.name),
'user': user, 'user': user,
'is_self': is_self, 'is_self': is_self,
'shelves': shelves.all(), 'shelves': shelves.all(),

View file

@ -19,10 +19,7 @@ class Site(View):
def get(self, request): def get(self, request):
''' edit form ''' ''' edit form '''
site = models.SiteSettings.objects.get() site = models.SiteSettings.objects.get()
data = { data = {'site_form': forms.SiteForm(instance=site)}
'title': 'Site Settings',
'site_form': forms.SiteForm(instance=site)
}
return TemplateResponse(request, 'settings/site.html', data) return TemplateResponse(request, 'settings/site.html', data)
def post(self, request): def post(self, request):
@ -30,10 +27,7 @@ class Site(View):
site = models.SiteSettings.objects.get() site = models.SiteSettings.objects.get()
form = forms.SiteForm(request.POST, instance=site) form = forms.SiteForm(request.POST, instance=site)
if not form.is_valid(): if not form.is_valid():
data = { data = {'site_form': form}
'title': 'Site Settings',
'site_form': form
}
return TemplateResponse(request, 'settings/site.html', data) return TemplateResponse(request, 'settings/site.html', data)
form.save() form.save()

View file

@ -25,7 +25,6 @@ class Tag(View):
usertag__tag__identifier=tag_id usertag__tag__identifier=tag_id
).distinct() ).distinct()
data = { data = {
'title': tag_obj.name,
'books': books, 'books': books,
'tag': tag_obj, 'tag': tag_obj,
} }

View file

@ -79,7 +79,6 @@ class User(View):
if not object_visible_to_user(request.user, goal): if not object_visible_to_user(request.user, goal):
goal = None goal = None
data = { data = {
'title': user.name,
'user': user, 'user': user,
'is_self': is_self, 'is_self': is_self,
'shelves': shelf_preview, 'shelves': shelf_preview,
@ -108,7 +107,6 @@ class Followers(View):
user.to_followers_activity(**request.GET)) user.to_followers_activity(**request.GET))
data = { data = {
'title': '%s: followers' % user.name,
'user': user, 'user': user,
'is_self': request.user.id == user.id, 'is_self': request.user.id == user.id,
'followers': user.followers.all(), 'followers': user.followers.all(),
@ -133,7 +131,6 @@ class Following(View):
user.to_following_activity(**request.GET)) user.to_following_activity(**request.GET))
data = { data = {
'title': '%s: following' % user.name,
'user': user, 'user': user,
'is_self': request.user.id == user.id, 'is_self': request.user.id == user.id,
'following': user.following.all(), 'following': user.following.all(),
@ -147,7 +144,6 @@ class EditUser(View):
def get(self, request): def get(self, request):
''' edit profile page for a user ''' ''' edit profile page for a user '''
data = { data = {
'title': 'Edit profile',
'form': forms.EditUserForm(instance=request.user), 'form': forms.EditUserForm(instance=request.user),
'user': request.user, 'user': request.user,
} }

File diff suppressed because it is too large Load diff