mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-25 11:01:12 +00:00
Merge branch 'main' into i18n-second-pass
This commit is contained in:
commit
bd44bf0980
61 changed files with 422 additions and 346 deletions
|
@ -1,6 +1,9 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load bookwyrm_tags %}
|
||||
|
||||
{% block title %}{{ author.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="block">
|
||||
<div class="columns is-mobile">
|
||||
|
|
|
@ -2,8 +2,10 @@
|
|||
{% load i18n %}
|
||||
{% load bookwyrm_tags %}
|
||||
{% load humanize %}
|
||||
{% block content %}
|
||||
|
||||
{% block title %}{{ book.title }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="block">
|
||||
<div class="columns is-mobile">
|
||||
<div class="column">
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{% extends 'discover/landing_layout.html' %}
|
||||
{% load i18n %}
|
||||
{% block panel %}
|
||||
|
||||
{% block panel %}
|
||||
<div class="block columns mt-4">
|
||||
<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">
|
||||
<li>
|
||||
<a href="#coc">{% trans "Code of Conduct" %}</a>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load bookwyrm_tags %}
|
||||
{% block content %}
|
||||
|
||||
{% block title %}{% trans "Welcome" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<header class="block has-text-centered">
|
||||
<h1 class="title">{{ site.name }}</h1>
|
||||
<h2 class="subtitle">{{ site.instance_tagline }}</h2>
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load humanize %}
|
||||
|
||||
{% block title %}{% trans "Edit Author" %}: {{ author.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<header class="block">
|
||||
<h1 class="title level-left">
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load humanize %}
|
||||
|
||||
{% block title %}{% trans "Edit Book" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<header class="block">
|
||||
<h1 class="title level-left">
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load bookwyrm_tags %}
|
||||
|
||||
{% block title %}{% blocktrans with book_title=work.title %}Editions of {{ book_title }}{% endblocktrans %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<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>
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% block content %}
|
||||
|
||||
{% block title %}{% trans "Oops!" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="block">
|
||||
<h1 class="title">{% trans "Server Error" %}</h1>
|
||||
<p>{% trans "Something went wrong! Sorry about that." %}</p>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -3,7 +3,13 @@
|
|||
{% block panel %}
|
||||
|
||||
<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 %}
|
||||
</header>
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load bookwyrm_tags %}
|
||||
{% block content %}
|
||||
|
||||
{% block title %}{% trans "Updates" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="columns">
|
||||
{% if user.is_authenticated %}
|
||||
<div class="column is-one-third">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{% extends 'feed/feed_layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block panel %}
|
||||
<header class="block">
|
||||
<a href="/#feed" class="button" data-back>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<section class="card {% if goal %}hidden{% endif %}" id="show-edit-goal">
|
||||
<header class="card-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>
|
||||
</header>
|
||||
<section class="card-content content">
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load humanize %}
|
||||
|
||||
{% block title %}{% trans "Import Books" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="block">
|
||||
<h1 class="title">{% trans "Import Books" %}</h1>
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
{% load i18n %}
|
||||
{% load bookwyrm_tags %}
|
||||
{% load humanize %}
|
||||
|
||||
{% block title %}{% trans "Import Status" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="block">
|
||||
<h1 class="title">{% trans "Import Status" %}</h1>
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Create an Account" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="columns">
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<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">
|
||||
<link type="text/css" rel="stylesheet" href="/static/css/bulma.min.css">
|
||||
<link type="text/css" rel="stylesheet" href="/static/css/format.css">
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{% extends 'lists/list_layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load bookwyrm_tags %}
|
||||
{% block panel %}
|
||||
|
||||
{% block panel %}
|
||||
{% if request.user == list.user and pending_count %}
|
||||
<div class="block content">
|
||||
<p>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load bookwyrm_tags %}
|
||||
{% block content %}
|
||||
|
||||
{% block title %}{{ list.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<header class="columns content is-mobile">
|
||||
<div class="column">
|
||||
<h1 class="title">{{ list.name }} <span class="subtitle">{% include 'snippets/privacy-icons.html' with item=list %}</span></h1>
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Lists" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<header class="block">
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% block content %}
|
||||
|
||||
{% block title %}{% trans "Login" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
<div class="box">
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% block content %}
|
||||
|
||||
{% block title %}{% trans "Not Found" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="block">
|
||||
<h1 class="title">{% trans "Not Found" %}</h1>
|
||||
<p>{% trans "The page your requested doesn't seem to exist!" %}</p>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
{% load i18n %}
|
||||
{% load humanize %}
|
||||
{% load bookwyrm_tags %}
|
||||
|
||||
{% block title %}{% trans "Notifications" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="block">
|
||||
<h1 class="title">{% trans "Notifications" %}</h1>
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% block content %}
|
||||
|
||||
{% block title %}{% trans "Reset Password" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
<div class="block">
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% block content %}
|
||||
|
||||
{% block title %}{% trans "Reset Password" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="columns is-centered">
|
||||
<div class="column is-half">
|
||||
<div class="block">
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{% extends 'preferences/preferences_layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Blocked Users" %}{{ author.name }}{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
{% trans "Blocked Users" %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
{% extends 'preferences/preferences_layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Change Password" %}{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
{% trans "Change Password" %}
|
||||
{% endblock %}
|
||||
|
@ -15,6 +18,6 @@
|
|||
<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">
|
||||
</div>
|
||||
<button class="button is-primary" type="submit">{% trans "Change password" %}</button>
|
||||
<button class="button is-primary" type="submit">{% trans "Change Password" %}</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
{% extends 'preferences/preferences_layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Edit Profile" %}{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
{% trans "Edit Profile" %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -14,13 +14,13 @@
|
|||
<a href="/preferences/profile"{% if '/preferences/profile' in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Profile" %}</a>
|
||||
</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>
|
||||
</ul>
|
||||
<h2 class="menu-label">{% trans "Relationships" %}</h2>
|
||||
<ul class="menu-list">
|
||||
<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>
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Search Results" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% with book_results|first as local_results %}
|
||||
<div class="block">
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Administration" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<header class="block column is-offset-one-quarter pl-1">
|
||||
|
@ -26,7 +29,7 @@
|
|||
<ul class="menu-list">
|
||||
<li>
|
||||
{% 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 %}
|
||||
<ul class="emnu-list">
|
||||
<li><a href="{{ url }}#instance-info">{% trans "Instance Info" %}</a></li>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{% extends 'settings/admin_layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block header %}{% trans "Federated Servers" %}{% endblock %}
|
||||
|
||||
{% block panel %}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
{% extends 'settings/admin_layout.html' %}
|
||||
{% load i18n %}
|
||||
{% block header %}{% trans "Site Configuration" %}{% endblock %}
|
||||
|
||||
{% block title %}{% trans "Site Settings" %}{% endblock %}
|
||||
|
||||
{% block header %}{% trans "Site Settings" %}{% endblock %}
|
||||
|
||||
{% block panel %}
|
||||
|
||||
|
|
|
@ -7,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 }}">{% 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 }}'">
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -41,7 +41,7 @@
|
|||
</div>
|
||||
{% if type == 'quotation' %}
|
||||
<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 %}
|
||||
<textarea name="content" class="textarea is-small" id="id_content_quote-{{ book.id }}"></textarea>
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
{% 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> {% 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>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load bookwyrm_tags %}
|
||||
{% block content %}
|
||||
|
||||
{% block title %}{{ tag.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="block">
|
||||
<h1 class="title">{% blocktrans %}Books tagged "{{ tag.name }}"{% endblocktrans %}</h1>
|
||||
{% include 'snippets/book_tiles.html' with books=books.all %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
|
|
@ -4,11 +4,7 @@
|
|||
|
||||
{% block header %}
|
||||
<h1 class="title">
|
||||
{% if is_self %}Your
|
||||
{% else %}
|
||||
{% include 'snippets/username.html' with user=user possessive=True %}
|
||||
{% endif %}
|
||||
followers
|
||||
{% trans "User Profile" %}
|
||||
</h1>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -4,11 +4,7 @@
|
|||
|
||||
{% block header %}
|
||||
<h1 class="title">
|
||||
Users following
|
||||
{% if is_self %}you
|
||||
{% else %}
|
||||
{% include 'snippets/username.html' with user=user %}
|
||||
{% endif %}
|
||||
{% trans "User Profile" %}
|
||||
</h1>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
<div class="columns is-mobile">
|
||||
<div class="column">
|
||||
<h1 class="title">
|
||||
{% if is_self %}Your
|
||||
{% if is_self %}
|
||||
{% trans "Your Lists" %}
|
||||
{% else %}
|
||||
{% include 'snippets/username.html' with user=user %}'s
|
||||
{% blocktrans with username=user.display_name %}Lists: {{ username }}{% endblocktrans %}
|
||||
{% endif %}
|
||||
Lists
|
||||
</h1>
|
||||
</div>
|
||||
{% if is_self %}
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
{% block header %}
|
||||
<header class="columns">
|
||||
<h1 class="title">
|
||||
{% if is_self %}Your
|
||||
{% if is_self %}
|
||||
{% trans "Your Shelves" %}
|
||||
{% else %}
|
||||
{% include 'snippets/username.html' with user=user possessive=True %}
|
||||
{% blocktrans with username=user.display_name %}{{ username }}: Shelves{% endblocktrans %}
|
||||
{% endif %}
|
||||
shelves
|
||||
</h1>
|
||||
</header>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
{% extends 'user/user_layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{{ user.name }}{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
<div class="columns is-mobile">
|
||||
<div class="column">
|
||||
<h1 class="title">{% trans "User profile" %}</h1>
|
||||
<h1 class="title">{% trans "User Profile" %}</h1>
|
||||
</div>
|
||||
{% if is_self %}
|
||||
<div class="column is-narrow">
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
{% load humanize %}
|
||||
{% load bookwyrm_tags %}
|
||||
|
||||
{% block title %}{{ user.display_name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<header class="block">
|
||||
{% block header %}{% endblock %}
|
||||
|
|
|
@ -6,6 +6,7 @@ from django.shortcuts import get_object_or_404, redirect
|
|||
from django.template.response import TemplateResponse
|
||||
from django.utils import timezone
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
from django.views import View
|
||||
|
||||
from bookwyrm import forms, models
|
||||
|
@ -13,6 +14,7 @@ from bookwyrm.settings import DOMAIN
|
|||
|
||||
|
||||
# pylint: disable= no-self-use
|
||||
@method_decorator(csrf_exempt, name='dispatch')
|
||||
class Login(View):
|
||||
''' authenticate an existing user '''
|
||||
def get(self, request):
|
||||
|
@ -21,7 +23,6 @@ class Login(View):
|
|||
return redirect('/')
|
||||
# sene user to the login page
|
||||
data = {
|
||||
'title': 'Login',
|
||||
'login_form': forms.LoginForm(),
|
||||
'register_form': forms.RegisterForm(),
|
||||
}
|
||||
|
@ -29,6 +30,8 @@ class Login(View):
|
|||
|
||||
def post(self, request):
|
||||
''' authentication action '''
|
||||
if request.user.is_authenticated:
|
||||
return redirect('/')
|
||||
login_form = forms.LoginForm(request.POST)
|
||||
|
||||
localname = login_form.data['localname']
|
||||
|
|
|
@ -24,7 +24,6 @@ class Author(View):
|
|||
books = models.Work.objects.filter(
|
||||
Q(authors=author) | Q(editions__authors=author)).distinct()
|
||||
data = {
|
||||
'title': author.name,
|
||||
'author': author,
|
||||
'books': [b.get_default_edition() for b in books],
|
||||
}
|
||||
|
@ -41,7 +40,6 @@ class EditAuthor(View):
|
|||
''' info about a book '''
|
||||
author = get_object_or_404(models.Author, id=author_id)
|
||||
data = {
|
||||
'title': 'Edit Author',
|
||||
'author': author,
|
||||
'form': forms.AuthorForm(instance=author)
|
||||
}
|
||||
|
@ -54,7 +52,6 @@ class EditAuthor(View):
|
|||
form = forms.AuthorForm(request.POST, request.FILES, instance=author)
|
||||
if not form.is_valid():
|
||||
data = {
|
||||
'title': 'Edit Author',
|
||||
'author': author,
|
||||
'form': form
|
||||
}
|
||||
|
|
|
@ -15,8 +15,7 @@ class Block(View):
|
|||
''' blocking users '''
|
||||
def get(self, request):
|
||||
''' list of blocked users? '''
|
||||
return TemplateResponse(
|
||||
request, 'preferences/blocks.html', {'title': 'Blocked Users'})
|
||||
return TemplateResponse(request, 'preferences/blocks.html')
|
||||
|
||||
def post(self, request, user_id):
|
||||
''' block a user '''
|
||||
|
|
|
@ -82,7 +82,6 @@ class Book(View):
|
|||
)
|
||||
|
||||
data = {
|
||||
'title': book.title,
|
||||
'book': book,
|
||||
'reviews': reviews_page,
|
||||
'review_count': reviews.count(),
|
||||
|
@ -113,7 +112,6 @@ class EditBook(View):
|
|||
if not book.description:
|
||||
book.description = book.parent_work.description
|
||||
data = {
|
||||
'title': 'Edit Book',
|
||||
'book': book,
|
||||
'form': forms.EditionForm(instance=book)
|
||||
}
|
||||
|
@ -126,7 +124,6 @@ class EditBook(View):
|
|||
form = forms.EditionForm(request.POST, request.FILES, instance=book)
|
||||
if not form.is_valid():
|
||||
data = {
|
||||
'title': 'Edit Book',
|
||||
'book': book,
|
||||
'form': form
|
||||
}
|
||||
|
@ -146,7 +143,6 @@ class Editions(View):
|
|||
return ActivitypubResponse(work.to_edition_list(**request.GET))
|
||||
|
||||
data = {
|
||||
'title': 'Editions of %s' % work.title,
|
||||
'editions': work.editions.order_by('-edition_rank').all(),
|
||||
'work': work,
|
||||
}
|
||||
|
|
|
@ -3,11 +3,9 @@ from django.template.response import TemplateResponse
|
|||
|
||||
def server_error_page(request):
|
||||
''' 500 errors '''
|
||||
return TemplateResponse(
|
||||
request, 'error.html', {'title': 'Oops!'}, status=500)
|
||||
return TemplateResponse(request, 'error.html', status=500)
|
||||
|
||||
|
||||
def not_found_page(request, _):
|
||||
''' 404s '''
|
||||
return TemplateResponse(
|
||||
request, 'notfound.html', {'title': 'Not found'}, status=404)
|
||||
return TemplateResponse(request, 'notfound.html', status=404)
|
||||
|
|
|
@ -17,8 +17,5 @@ class Federation(View):
|
|||
def get(self, request):
|
||||
''' edit form '''
|
||||
servers = models.FederatedServer.objects.all()
|
||||
data = {
|
||||
'title': 'Federated Servers',
|
||||
'servers': servers
|
||||
}
|
||||
data = {'servers': servers}
|
||||
return TemplateResponse(request, 'settings/federation.html', data)
|
||||
|
|
|
@ -38,7 +38,6 @@ class Feed(View):
|
|||
paginated = Paginator(activities, PAGE_LENGTH)
|
||||
|
||||
data = {**feed_page_data(request.user), **{
|
||||
'title': 'Updates Feed',
|
||||
'user': request.user,
|
||||
'activities': paginated.page(page),
|
||||
'tab': tab,
|
||||
|
@ -75,7 +74,6 @@ class DirectMessage(View):
|
|||
paginated = Paginator(activities, PAGE_LENGTH)
|
||||
activity_page = paginated.page(page)
|
||||
data = {**feed_page_data(request.user), **{
|
||||
'title': 'Direct Messages',
|
||||
'user': request.user,
|
||||
'partner': user,
|
||||
'activities': activity_page,
|
||||
|
@ -108,7 +106,6 @@ class Status(View):
|
|||
status.to_activity(pure=not is_bookwyrm_request(request)))
|
||||
|
||||
data = {**feed_page_data(request.user), **{
|
||||
'title': 'Status by %s' % user.username,
|
||||
'status': status,
|
||||
}}
|
||||
return TemplateResponse(request, 'feed/status.html', data)
|
||||
|
|
|
@ -30,7 +30,6 @@ class Goal(View):
|
|||
return HttpResponseNotFound()
|
||||
|
||||
data = {
|
||||
'title': '%s\'s %d Reading' % (user.display_name, year),
|
||||
'goal_form': forms.GoalForm(instance=goal),
|
||||
'goal': goal,
|
||||
'user': user,
|
||||
|
@ -53,7 +52,6 @@ class Goal(View):
|
|||
form = forms.GoalForm(request.POST, instance=goal)
|
||||
if not form.is_valid():
|
||||
data = {
|
||||
'title': '%s\'s %d Reading' % (request.user.display_name, year),
|
||||
'goal_form': form,
|
||||
'goal': goal,
|
||||
'year': year,
|
||||
|
|
|
@ -19,7 +19,6 @@ class Import(View):
|
|||
def get(self, request):
|
||||
''' load import page '''
|
||||
return TemplateResponse(request, 'import.html', {
|
||||
'title': 'Import Books',
|
||||
'import_form': forms.ImportForm(),
|
||||
'jobs': models.ImportJob.
|
||||
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]
|
||||
items = [i for i in items if not i.fail_reason]
|
||||
return TemplateResponse(request, 'import_status.html', {
|
||||
'title': 'Import Status',
|
||||
'job': job,
|
||||
'items': items,
|
||||
'failed_items': failed_items,
|
||||
|
|
|
@ -30,7 +30,6 @@ class ManageInvites(View):
|
|||
).order_by('-created_date'), PAGE_LENGTH)
|
||||
|
||||
data = {
|
||||
'title': 'Invitations',
|
||||
'invites': paginated.page(page),
|
||||
'form': forms.CreateInviteForm(),
|
||||
}
|
||||
|
@ -50,7 +49,6 @@ class ManageInvites(View):
|
|||
user=request.user
|
||||
).order_by('-created_date'), PAGE_LENGTH)
|
||||
data = {
|
||||
'title': 'Invitations',
|
||||
'invites': paginated.page(1),
|
||||
'form': form
|
||||
}
|
||||
|
@ -66,7 +64,6 @@ class Invite(View):
|
|||
invite = get_object_or_404(models.SiteInvite, code=code)
|
||||
|
||||
data = {
|
||||
'title': 'Join',
|
||||
'register_form': forms.RegisterForm(),
|
||||
'invite': invite,
|
||||
'valid': invite.valid() if invite else True,
|
||||
|
|
|
@ -12,10 +12,7 @@ class About(View):
|
|||
''' create invites '''
|
||||
def get(self, request):
|
||||
''' more information about the instance '''
|
||||
data = {
|
||||
'title': 'About',
|
||||
}
|
||||
return TemplateResponse(request, 'discover/about.html', data)
|
||||
return TemplateResponse(request, 'discover/about.html')
|
||||
|
||||
class Home(View):
|
||||
''' discover page or home feed depending on auth '''
|
||||
|
@ -43,7 +40,6 @@ class Discover(View):
|
|||
).order_by('-review__published_date__max')[:6]
|
||||
|
||||
data = {
|
||||
'title': 'Discover',
|
||||
'register_form': forms.RegisterForm(),
|
||||
'books': list(set(books)),
|
||||
}
|
||||
|
|
|
@ -40,7 +40,6 @@ class Lists(View):
|
|||
|
||||
paginated = Paginator(lists, 12)
|
||||
data = {
|
||||
'title': 'Lists',
|
||||
'lists': paginated.page(page),
|
||||
'list_form': forms.ListForm(),
|
||||
'path': '/list',
|
||||
|
@ -72,7 +71,6 @@ class UserLists(View):
|
|||
paginated = Paginator(lists, 12)
|
||||
|
||||
data = {
|
||||
'title': '%s: Lists' % user.name,
|
||||
'user': user,
|
||||
'is_self': request.user.id == user.id,
|
||||
'lists': paginated.page(page),
|
||||
|
@ -114,7 +112,6 @@ class List(View):
|
|||
|
||||
|
||||
data = {
|
||||
'title': '%s | Lists' % book_list.name,
|
||||
'list': book_list,
|
||||
'items': book_list.listitem_set.filter(approved=True),
|
||||
'pending_count': book_list.listitem_set.filter(
|
||||
|
@ -149,7 +146,6 @@ class Curate(View):
|
|||
return HttpResponseNotFound()
|
||||
|
||||
data = {
|
||||
'title': 'Curate "%s" | Lists' % book_list.name,
|
||||
'list': book_list,
|
||||
'pending': book_list.listitem_set.filter(approved=False),
|
||||
'list_form': forms.ListForm(instance=book_list),
|
||||
|
|
|
@ -16,7 +16,6 @@ class Notifications(View):
|
|||
.order_by('-created_date')
|
||||
unread = [n.id for n in notifications.filter(read=False)]
|
||||
data = {
|
||||
'title': 'Notifications',
|
||||
'notifications': notifications,
|
||||
'unread': unread,
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ class PasswordResetRequest(View):
|
|||
return TemplateResponse(
|
||||
request,
|
||||
'password_reset_request.html',
|
||||
{'title': 'Reset Password'}
|
||||
)
|
||||
|
||||
def post(self, request):
|
||||
|
@ -53,11 +52,7 @@ class PasswordReset(View):
|
|||
except models.PasswordReset.DoesNotExist:
|
||||
raise PermissionDenied
|
||||
|
||||
return TemplateResponse(
|
||||
request,
|
||||
'password_reset.html',
|
||||
{'title': 'Reset Password', 'code': reset_code.code}
|
||||
)
|
||||
return TemplateResponse(request, 'password_reset.html')
|
||||
|
||||
def post(self, request, code):
|
||||
''' allow a user to change their password through an emailed token '''
|
||||
|
@ -90,10 +85,7 @@ class ChangePassword(View):
|
|||
''' change password as logged in user '''
|
||||
def get(self, request):
|
||||
''' change password page '''
|
||||
data = {
|
||||
'title': 'Change Password',
|
||||
'user': request.user,
|
||||
}
|
||||
data = {'user': request.user}
|
||||
return TemplateResponse(
|
||||
request, 'preferences/change_password.html', data)
|
||||
|
||||
|
|
|
@ -58,7 +58,6 @@ class Search(View):
|
|||
book_results = connector_manager.search(
|
||||
query, min_confidence=min_confidence)
|
||||
data = {
|
||||
'title': 'Search Results',
|
||||
'book_results': book_results,
|
||||
'user_results': user_results,
|
||||
'list_results': list_results,
|
||||
|
|
|
@ -53,7 +53,6 @@ class Shelf(View):
|
|||
).order_by('-updated_date').all()
|
||||
|
||||
data = {
|
||||
'title': '%s\'s %s shelf' % (user.display_name, shelf.name),
|
||||
'user': user,
|
||||
'is_self': is_self,
|
||||
'shelves': shelves.all(),
|
||||
|
|
|
@ -19,10 +19,7 @@ class Site(View):
|
|||
def get(self, request):
|
||||
''' edit form '''
|
||||
site = models.SiteSettings.objects.get()
|
||||
data = {
|
||||
'title': 'Site Settings',
|
||||
'site_form': forms.SiteForm(instance=site)
|
||||
}
|
||||
data = {'site_form': forms.SiteForm(instance=site)}
|
||||
return TemplateResponse(request, 'settings/site.html', data)
|
||||
|
||||
def post(self, request):
|
||||
|
@ -30,10 +27,7 @@ class Site(View):
|
|||
site = models.SiteSettings.objects.get()
|
||||
form = forms.SiteForm(request.POST, instance=site)
|
||||
if not form.is_valid():
|
||||
data = {
|
||||
'title': 'Site Settings',
|
||||
'site_form': form
|
||||
}
|
||||
data = {'site_form': form}
|
||||
return TemplateResponse(request, 'settings/site.html', data)
|
||||
form.save()
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ class Tag(View):
|
|||
usertag__tag__identifier=tag_id
|
||||
).distinct()
|
||||
data = {
|
||||
'title': tag_obj.name,
|
||||
'books': books,
|
||||
'tag': tag_obj,
|
||||
}
|
||||
|
|
|
@ -79,7 +79,6 @@ class User(View):
|
|||
if not object_visible_to_user(request.user, goal):
|
||||
goal = None
|
||||
data = {
|
||||
'title': user.name,
|
||||
'user': user,
|
||||
'is_self': is_self,
|
||||
'shelves': shelf_preview,
|
||||
|
@ -108,7 +107,6 @@ class Followers(View):
|
|||
user.to_followers_activity(**request.GET))
|
||||
|
||||
data = {
|
||||
'title': '%s: followers' % user.name,
|
||||
'user': user,
|
||||
'is_self': request.user.id == user.id,
|
||||
'followers': user.followers.all(),
|
||||
|
@ -133,7 +131,6 @@ class Following(View):
|
|||
user.to_following_activity(**request.GET))
|
||||
|
||||
data = {
|
||||
'title': '%s: following' % user.name,
|
||||
'user': user,
|
||||
'is_self': request.user.id == user.id,
|
||||
'following': user.following.all(),
|
||||
|
@ -147,7 +144,6 @@ class EditUser(View):
|
|||
def get(self, request):
|
||||
''' edit profile page for a user '''
|
||||
data = {
|
||||
'title': 'Edit profile',
|
||||
'form': forms.EditUserForm(instance=request.user),
|
||||
'user': request.user,
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue