Merge branch 'main' into ci
This commit is contained in:
@ -35,42 +35,37 @@
|
||||
</div>
|
||||
|
||||
<div class="columns">
|
||||
<div class="column is-narrow">
|
||||
<div class="column is-one-fifth is-clipped">
|
||||
{% include 'snippets/book_cover.html' with book=book size=large %}
|
||||
{% include 'snippets/rate_action.html' with user=request.user book=book %}
|
||||
{% include 'snippets/shelve_button/shelve_button.html' %}
|
||||
|
||||
{% if request.user.is_authenticated and not book.cover %}
|
||||
<div class="box p-2">
|
||||
<h3 class="title is-6 mb-1">{% trans "Add cover" %}</h3>
|
||||
<form name="add-cover" method="POST" action="/upload-cover/{{ book.id }}" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
<label class="label">
|
||||
<input type="file" name="cover" accept="image/*" enctype="multipart/form-data" id="id_cover" required>
|
||||
</label>
|
||||
<button class="button is-small is-primary" type="submit">{% trans "Add" %}</button>
|
||||
</form>
|
||||
<div class="block">
|
||||
{% trans "Add cover" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text=button_text controls_text="add-cover" controls_uid=book.id focus="modal-title-add-cover" class="is-small" %}
|
||||
{% include 'book/cover_modal.html' with book=book controls_text="add-cover" controls_uid=book.id %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<section class="content">
|
||||
<dl>
|
||||
{% if book.isbn_13 %}
|
||||
<div class="is-flex is-justify-content-space-between">
|
||||
<div class="is-flex is-justify-content-space-between is-align-items-center">
|
||||
<dt>{% trans "ISBN:" %}</dt>
|
||||
<dd>{{ book.isbn_13 }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if book.oclc_number %}
|
||||
<div class="is-flex is-justify-content-space-between">
|
||||
<div class="is-flex is-justify-content-space-between is-align-items-center">
|
||||
<dt>{% trans "OCLC Number:" %}</dt>
|
||||
<dd>{{ book.oclc_number }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if book.asin %}
|
||||
<div class="is-flex is-justify-content-space-between">
|
||||
<div class="is-flex is-justify-content-space-between is-align-items-center">
|
||||
<dt>{% trans "ASIN:" %}</dt>
|
||||
<dd>{{ book.asin }}</dd>
|
||||
</div>
|
||||
@ -78,13 +73,22 @@
|
||||
</dl>
|
||||
|
||||
<p>
|
||||
{% if book.physical_format and not book.pages %}
|
||||
{{ book.physical_format | title }}
|
||||
{% elif book.physical_format and book.pages %}
|
||||
{% blocktrans with format=book.physical_format|title pages=book.pages %}{{ format }}, {{ pages }} pages{% endblocktrans %}
|
||||
{% elif book.pages %}
|
||||
{% blocktrans with pages=book.pages %}{{ pages }} pages{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% if book.physical_format and not book.pages %}
|
||||
{{ book.physical_format | title }}
|
||||
{% elif book.physical_format and book.pages %}
|
||||
{% blocktrans with format=book.physical_format|title pages=book.pages %}{{ format }}, {{ pages }} pages{% endblocktrans %}
|
||||
{% elif book.pages %}
|
||||
{% blocktrans with pages=book.pages %}{{ pages }} pages{% endblocktrans %}
|
||||
{% endif %}
|
||||
</p>
|
||||
<p>
|
||||
{% if book.published_date and book.publishers %}
|
||||
{% blocktrans with date=book.published_date|date:'M jS Y' publisher=book.publishers|join:', ' %}Published {{ date }} by {{ publisher }}.{% endblocktrans %}
|
||||
{% elif book.published_date %}
|
||||
{% blocktrans with date=book.published_date|date:'M jS Y' %}Published {{ date }}{% endblocktrans %}
|
||||
{% elif book.publishers %}
|
||||
{% blocktrans with publisher=book.publishers|join:', ' %}Published by {{ publisher }}.{% endblocktrans %}
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
{% if book.openlibrary_key %}
|
||||
@ -93,7 +97,7 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="column">
|
||||
<div class="column is-three-fifths">
|
||||
<div class="block">
|
||||
<h3 class="field is-grouped">
|
||||
{% include 'snippets/stars.html' with rating=rating %}
|
||||
@ -201,7 +205,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="column is-narrow">
|
||||
<div class="column is-one-fifth">
|
||||
{% if book.subjects %}
|
||||
<section class="content block">
|
||||
<h2 class="title is-5">{% trans "Subjects" %}</h2>
|
||||
@ -217,14 +221,14 @@
|
||||
<section class="content block">
|
||||
<h2 class="title is-5">{% trans "Places" %}</h2>
|
||||
<ul>
|
||||
{% for place in book.subject_placess %}
|
||||
{% for place in book.subject_places %}
|
||||
<li>{{ place }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% if lists.exists %}
|
||||
{% if lists.exists or request.user.list_set.exists %}
|
||||
<section class="content block">
|
||||
<h2 class="title is-5">{% trans "Lists" %}</h2>
|
||||
<ul>
|
||||
@ -232,6 +236,26 @@
|
||||
<li><a href="{{ list.local_path }}">{{ list.name }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% if request.user.list_set.exists %}
|
||||
<form name="list-add" method="post" action="{% url 'list-add-book' %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<label class="label" for="id_list">{% trans "Add to list" %}</label>
|
||||
<div class="field has-addons">
|
||||
<div class="select control">
|
||||
<select name="list" id="id_list">
|
||||
{% for list in user.list_set.all %}
|
||||
<option value="{{ list.id }}">{{ list.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button type="submit" class="button is-link">{% trans "Add" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endif %}
|
||||
</div>
|
||||
@ -252,10 +276,10 @@
|
||||
<div class="media-left">{% include 'snippets/avatar.html' with user=rating.user %}</div>
|
||||
<div class="media-content">
|
||||
<div>
|
||||
{% include 'snippets/username.html' with user=rating.user %}
|
||||
<a href="{{ rating.user.local_path }}">{{ rating.user.display_name }}</a>
|
||||
</div>
|
||||
<div class="field is-grouped mb-0">
|
||||
<div>{% trans "rated it" %}</div>
|
||||
<div class="is-flex">
|
||||
<p class="mr-1">{% trans "rated it" %}</p>
|
||||
{% include 'snippets/stars.html' with rating=rating.rating %}
|
||||
</div>
|
||||
<div>
|
36
bookwyrm/templates/book/cover_modal.html
Normal file
36
bookwyrm/templates/book/cover_modal.html
Normal file
@ -0,0 +1,36 @@
|
||||
{% extends 'components/modal.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block modal-title %}
|
||||
{% trans "Add cover" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="add-cover" method="POST" action="{% url 'upload-cover' book.id %}" enctype="multipart/form-data">
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-body %}
|
||||
<section class="modal-card-body columns">
|
||||
{% csrf_token %}
|
||||
<div class="column">
|
||||
<label class="label" for="id_cover">
|
||||
{% trans "Upload cover:" %}
|
||||
</label>
|
||||
<input type="file" name="cover" accept="image/*" enctype="multipart/form-data" id="id_cover">
|
||||
</div>
|
||||
<div class="column">
|
||||
<label class="label" for="id_cover_url">
|
||||
{% trans "Load cover from url:" %}
|
||||
</label>
|
||||
<input class="input" name="cover-url" id="id_cover_url">
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-footer %}
|
||||
<button class="button is-primary" type="submit">{% trans "Add" %}</button>
|
||||
{% trans "Cancel" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text=button_text %}
|
||||
{% endblock %}
|
||||
{% block modal-form-close %}</form>{% endblock %}
|
||||
|
231
bookwyrm/templates/book/edit_book.html
Normal file
231
bookwyrm/templates/book/edit_book.html
Normal file
@ -0,0 +1,231 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load humanize %}
|
||||
|
||||
{% block title %}{% if book %}{% blocktrans with book_title=book.title %}Edit "{{ book_title }}"{% endblocktrans %}{% else %}{% trans "Add Book" %}{% endif %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<header class="block">
|
||||
<h1 class="title level-left">
|
||||
{% if book %}
|
||||
{% blocktrans with book_title=book.title %}Edit "{{ book_title }}"{% endblocktrans %}
|
||||
{% else %}
|
||||
{% trans "Add Book" %}
|
||||
{% endif %}
|
||||
</h1>
|
||||
{% if book %}
|
||||
<div>
|
||||
<p>{% trans "Added:" %} {{ book.created_date | naturaltime }}</p>
|
||||
<p>{% trans "Updated:" %} {{ book.updated_date | naturaltime }}</p>
|
||||
<p>{% trans "Last edited by:" %} <a href="{{ book.last_edited_by.remote_id }}">{{ book.last_edited_by.display_name }}</a></p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</header>
|
||||
|
||||
{% if form.non_field_errors %}
|
||||
<div class="block">
|
||||
<p class="notification is-danger">{{ form.non_field_errors }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if book %}
|
||||
<form class="block" name="edit-book" action="{{ book.local_path }}/{% if confirm_mode %}confirm{% else %}edit{% endif %}" method="post" enctype="multipart/form-data">
|
||||
{% else %}
|
||||
<form class="block" name="create-book" action="/create-book{% if confirm_mode %}/confirm{% endif %}" method="post" enctype="multipart/form-data">
|
||||
{% endif %}
|
||||
|
||||
{% csrf_token %}
|
||||
{% if confirm_mode %}
|
||||
<div class="box">
|
||||
<h2 class="title is-4">{% trans "Confirm Book Info" %}</h2>
|
||||
<div class="columns">
|
||||
{% if author_matches %}
|
||||
<input type="hidden" name="author-match-count" value="{{ author_matches|length }}">
|
||||
<div class="column is-half">
|
||||
{% for author in author_matches %}
|
||||
<fieldset class="mb-4">
|
||||
<legend class="title is-5 mb-1">{% blocktrans with name=author.name %}Is "{{ name }}" an existing author?{% endblocktrans %}</legend>
|
||||
{% with forloop.counter0 as counter %}
|
||||
{% for match in author.matches %}
|
||||
<label><input type="radio" name="author_match-{{ counter }}" value="{{ match.id }}" required> {{ match.name }}</label>
|
||||
<p class="help">
|
||||
<a href="{{ match.local_path }}" target="_blank">{% blocktrans with book_title=match.book_set.first.title %}Author of <em>{{ book_title }}</em>{% endblocktrans %}</a>
|
||||
</p>
|
||||
{% endfor %}
|
||||
<label><input type="radio" name="author_match-{{ counter }}" value="{{ author.name }}" required> {% trans "This is a new author" %}</label>
|
||||
{% endwith %}
|
||||
</fieldset>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="column is-half">{% blocktrans with name=add_author %}Creating a new author: {{ name }}{% endblocktrans %}</p>
|
||||
{% endif %}
|
||||
|
||||
{% if not book %}
|
||||
<div class="column is-half">
|
||||
<fieldset>
|
||||
<legend class="title is-5 mb-1">{% trans "Is this an edition of an existing work?" %}</legend>
|
||||
{% for match in book_matches %}
|
||||
<label class="label"><input type="radio" name="parent_work" value="{{ match.parent_work.id }}"> {{ match.parent_work.title }}</label>
|
||||
{% endfor %}
|
||||
<label><input type="radio" name="parent_work" value="0" required> {% trans "This is a new work" %}</label>
|
||||
</fieldset>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<button class="button is-primary" type="submit">{% trans "Confirm" %}</button>
|
||||
<a href="#" class="button" data-back>
|
||||
<span>{% trans "Back" %}</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<hr class="block">
|
||||
{% endif %}
|
||||
|
||||
<input type="hidden" name="last_edited_by" value="{{ request.user.id }}">
|
||||
<div class="columns">
|
||||
<div class="column is-half">
|
||||
<section class="block">
|
||||
<h2 class="title is-4">{% trans "Metadata" %}</h2>
|
||||
<p class="mb-2"><label class="label" for="id_title">{% trans "Title:" %}</label> {{ form.title }} </p>
|
||||
{% for error in form.title.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
|
||||
<p class="mb-2"><label class="label" for="id_subtitle">{% trans "Subtitle:" %}</label> {{ form.subtitle }} </p>
|
||||
{% for error in form.subtitle.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
|
||||
<p class="mb-2"><label class="label" for="id_description">{% trans "Description:" %}</label> {{ form.description }} </p>
|
||||
{% for error in form.description.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
|
||||
<p class="mb-2"><label class="label" for="id_series">{% trans "Series:" %}</label> {{ form.series }} </p>
|
||||
{% for error in form.series.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
|
||||
<p class="mb-2"><label class="label" for="id_series_number">{% trans "Series number:" %}</label> {{ form.series_number }} </p>
|
||||
{% for error in form.series_number.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
|
||||
<p class="mb-2">
|
||||
<label class="label" for="id_publishers">{% trans "Publisher:" %}</label>
|
||||
{{ form.publishers }}
|
||||
<span class="help">{% trans "Separate multiple publishers with commas." %}</span>
|
||||
</p>
|
||||
{% for error in form.publishers.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
|
||||
<p class="mb-2"><label class="label" for="id_first_published_date">{% trans "First published date:" %}</label> {{ form.first_published_date }} </p>
|
||||
{% for error in form.first_published_date.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
|
||||
<p class="mb-2"><label class="label" for="id_published_date">{% trans "Published date:" %}</label> {{ form.published_date }} </p>
|
||||
{% for error in form.published_date.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
</section>
|
||||
|
||||
<section class="block">
|
||||
<h2 class="title is-4">{% trans "Authors" %}</h2>
|
||||
{% if book.authors.exists %}
|
||||
<fieldset>
|
||||
{% for author in book.authors.all %}
|
||||
<label class="label mb-2">
|
||||
<input type="checkbox" name="remove_authors" value="{{ author.id }}" {% if author.id|stringformat:"i" in remove_authors %}checked{% endif %}>
|
||||
{% blocktrans with name=author.name path=author.local_path %}Remove <a href="{{ path }}">{{ name }}</a>{% endblocktrans %}
|
||||
</label>
|
||||
{% endfor %}
|
||||
</fieldset>
|
||||
{% endif %}
|
||||
<label class="label" for="id_add_author">{% trans "Add Authors:" %}</label>
|
||||
<input class="input" type="text" name="add_author" id="id_add_author" placeholder="{% trans 'John Doe, Jane Smith' %}" value="{{ add_author }}" {% if confirm_mode %}readonly{% endif %}>
|
||||
<p class="help">Separate multiple author names with commas.</p>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="column is-half">
|
||||
<h2 class="title is-4">{% trans "Cover" %}</h2>
|
||||
<div class="columns">
|
||||
<div class="column is-narrow">
|
||||
{% include 'snippets/book_cover.html' with book=book size="small" %}
|
||||
</div>
|
||||
<div class="column is-narrow">
|
||||
<div class="block">
|
||||
<p>
|
||||
<label class="label" for="id_cover">{% trans "Upload cover:" %}</label>
|
||||
{{ form.cover }}
|
||||
</p>
|
||||
{% if book %}
|
||||
<p>
|
||||
<label class="label" for="id_cover_url">
|
||||
{% trans "Load cover from url:" %}
|
||||
</label>
|
||||
<input class="input" name="cover-url" id="id_cover_url">
|
||||
</p>
|
||||
{% endif %}
|
||||
{% for error in form.cover.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block">
|
||||
<h2 class="title is-4">{% trans "Physical Properties" %}</h2>
|
||||
<p class="mb-2"><label class="label" for="id_physical_format">{% trans "Format:" %}</label> {{ form.physical_format }} </p>
|
||||
{% for error in form.physical_format.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
{% for error in form.physical_format.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
|
||||
<p class="mb-2"><label class="label" for="id_pages">{% trans "Pages:" %}</label> {{ form.pages }} </p>
|
||||
{% for error in form.pages.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="block">
|
||||
<h2 class="title is-4">{% trans "Book Identifiers" %}</h2>
|
||||
<p class="mb-2"><label class="label" for="id_isbn_13">{% trans "ISBN 13:" %}</label> {{ form.isbn_13 }} </p>
|
||||
{% for error in form.isbn_13.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
<p class="mb-2"><label class="label" for="id_isbn_10">{% trans "ISBN 10:" %}</label> {{ form.isbn_10 }} </p>
|
||||
{% for error in form.isbn_10.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
<p class="mb-2"><label class="label" for="id_openlibrary_key">{% trans "Openlibrary key:" %}</label> {{ form.openlibrary_key }} </p>
|
||||
{% for error in form.openlibrary_key.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
<p class="mb-2"><label class="label" for="id_oclc_number">{% trans "OCLC Number:" %}</label> {{ form.oclc_number }} </p>
|
||||
{% for error in form.oclc_number.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
<p class="mb-2"><label class="label" for="id_asin">{% trans "ASIN:" %}</label> {{ form.asin }} </p>
|
||||
{% for error in form.ASIN.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if not confirm_mode %}
|
||||
<div class="block">
|
||||
<button class="button is-primary" type="submit">{% trans "Save" %}</button>
|
||||
<a class="button" href="/book/{{ book.id }}">{% trans "Cancel" %}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
@ -5,7 +5,7 @@
|
||||
{% block dropdown-trigger %}{% endblock %}
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
<ul class="dropdown-content" role="menu" id="menu-options-{{ book.id }}">
|
||||
<ul class="dropdown-content" role="menu" id="menu-options-{{ uuid }}">
|
||||
{% block dropdown-list %}{% endblock %}
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -1,8 +1,15 @@
|
||||
<div class="modal hidden" id="{{ controls_text }}-{{ controls_uid }}">
|
||||
<div
|
||||
role="dialog"
|
||||
class="modal hidden"
|
||||
id="{{ controls_text }}-{{ controls_uid }}"
|
||||
aria-labelledby="modal-card-title-{{ controls_text }}-{{ controls_uid }}"
|
||||
aria-modal="true"
|
||||
>
|
||||
{# @todo Implement focus traps to prevent tabbing out of the modal. #}
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head" tabindex="0" id="modal-title-{{ controls_text }}-{{ controls_uid }}">
|
||||
<h2 class="modal-card-title">
|
||||
<h2 class="modal-card-title" id="modal-card-title-{{ controls_text }}-{{ controls_uid }}">
|
||||
{% block modal-title %}{% endblock %}
|
||||
</h2>
|
||||
{% include 'snippets/toggle/toggle_button.html' with label="close" class="delete" nonbutton=True %}
|
||||
@ -18,7 +25,6 @@
|
||||
</footer>
|
||||
{% block modal-form-close %}{% endblock %}
|
||||
</div>
|
||||
<label class="modal-close is-large" for="{{ controls_text }}-{{ controls_uid }}" aria-label="close"></label>
|
||||
{% include 'snippets/toggle/toggle_button.html' with label="close" class="modal-close is-large" nonbutton=True %}
|
||||
</div>
|
||||
|
||||
|
@ -54,11 +54,11 @@
|
||||
<div class="tile is-child box has-background-white-bis">
|
||||
<h2 class="title is-4">{% trans "Your Account" %}</h2>
|
||||
{% include 'user/user_preview.html' with user=request.user %}
|
||||
{% if request.user.summary %}
|
||||
<div class="box content">
|
||||
{% if request.user.summary %}
|
||||
{{ request.user.summary | to_markdown | safe }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@ -1,4 +1,5 @@
|
||||
{% load bookwyrm_tags %}
|
||||
{% load i18n %}
|
||||
{% if book %}
|
||||
<div class="columns">
|
||||
<div class="column is-narrow">
|
||||
@ -8,7 +9,7 @@
|
||||
<div class="column">
|
||||
<h3 class="title is-5"><a href="/book/{{ book.id }}">{{ book.title }}</a></h3>
|
||||
{% if book.authors %}
|
||||
<p class="subtitle is-5">by {% include 'snippets/authors.html' with book=book %}</p>
|
||||
<p class="subtitle is-5">{% trans "by" %} {% include 'snippets/authors.html' with book=book %}</p>
|
||||
{% endif %}
|
||||
{% if book|book_description %}
|
||||
<blockquote class="content">{{ book|book_description|to_markdown|safe|truncatewords_html:50 }}</blockquote>
|
||||
|
@ -1,11 +1,12 @@
|
||||
{% load bookwyrm_tags %}
|
||||
{% load i18n %}
|
||||
{% if book %}
|
||||
<a href="{{ book.local_path }}">{% include 'snippets/book_cover.html' with book=book %}</a>
|
||||
{% include 'snippets/stars.html' with rating=book|rating:request.user %}
|
||||
|
||||
<h3 class="title is-6"><a href="/book/{{ book.id }}">{{ book.title }}</a></h3>
|
||||
{% if book.authors %}
|
||||
<p class="subtitle is-6">by {% include 'snippets/authors.html' with book=book %}</p>
|
||||
<p class="subtitle is-6">{% trans "by" %} {% include 'snippets/authors.html' with book=book %}</p>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
@ -1,125 +0,0 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load humanize %}
|
||||
|
||||
{% block title %}{% trans "Edit Book" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<header class="block">
|
||||
<h1 class="title level-left">
|
||||
Edit "{{ book.title }}"
|
||||
</h1>
|
||||
<div>
|
||||
<p>{% trans "Added:" %} {{ book.created_date | naturaltime }}</p>
|
||||
<p>{% trans "Updated:" %} {{ book.updated_date | naturaltime }}</p>
|
||||
<p>{% trans "Last edited by:" %} <a href="{{ book.last_edited_by.remote_id }}">{{ book.last_edited_by.display_name }}</a></p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{% if form.non_field_errors %}
|
||||
<div class="block">
|
||||
<p class="notification is-danger">{{ form.non_field_errors }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form class="block" name="edit-book" action="{{ book.local_path }}/edit" method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="last_edited_by" value="{{ request.user.id }}">
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
<h2 class="title is-4">{% trans "Metadata" %}</h2>
|
||||
<p class="fields is-grouped"><label class="label" for="id_title">{% trans "Title:" %}</label> {{ form.title }} </p>
|
||||
{% for error in form.title.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
<p class="fields is-grouped"><label class="label" for="id_subtitle">{% trans "Subtitle:" %}</label> {{ form.subtitle }} </p>
|
||||
{% for error in form.subtitle.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
<p class="fields is-grouped"><label class="label" for="id_description">{% trans "Description:" %}</label> {{ form.description }} </p>
|
||||
{% for error in form.description.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
<p class="fields is-grouped"><label class="label" for="id_series">{% trans "Series:" %}</label> {{ form.series }} </p>
|
||||
{% for error in form.series.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
<p class="fields is-grouped"><label class="label" for="id_series_number">{% trans "Series number:" %}</label> {{ form.series_number }} </p>
|
||||
{% for error in form.series_number.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
<p class="fields is-grouped"><label class="label" for="id_first_published_date">{% trans "First published date:" %}</label> {{ form.first_published_date }} </p>
|
||||
{% for error in form.first_published_date.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
<p class="fields is-grouped"><label class="label" for="id_published_date">{% trans "Published date:" %}</label> {{ form.published_date }} </p>
|
||||
{% for error in form.published_date.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="column">
|
||||
<div class="columns">
|
||||
<div class="column is-narrow">
|
||||
{% include 'snippets/book_cover.html' with book=book size="small" %}
|
||||
</div>
|
||||
<div class="column is-narrow">
|
||||
<div class="block">
|
||||
<h2 class="title is-4">{% trans "Cover" %}</h2>
|
||||
<p>{{ form.cover }}</p>
|
||||
{% for error in form.cover.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block">
|
||||
<h2 class="title is-4">{% trans "Physical Properties" %}</h2>
|
||||
<p class="fields is-grouped"><label class="label" for="id_physical_format">{% trans "Format:" %}</label> {{ form.physical_format }} </p>
|
||||
{% for error in form.physical_format.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
{% for error in form.physical_format.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
|
||||
<p class="fields is-grouped"><label class="label" for="id_pages">{% trans "Pages:" %}</label> {{ form.pages }} </p>
|
||||
{% for error in form.pages.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="block">
|
||||
<h2 class="title is-4">{% trans "Book Identifiers" %}</h2>
|
||||
<p class="fields is-grouped"><label class="label" for="id_isbn_13">{% trans "ISBN 13:" %}</label> {{ form.isbn_13 }} </p>
|
||||
{% for error in form.isbn_13.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
<p class="fields is-grouped"><label class="label" for="id_isbn_10">{% trans "ISBN 10:" %}</label> {{ form.isbn_10 }} </p>
|
||||
{% for error in form.isbn_10.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
<p class="fields is-grouped"><label class="label" for="id_openlibrary_key">{% trans "Openlibrary key:" %}</label> {{ form.openlibrary_key }} </p>
|
||||
{% for error in form.openlibrary_key.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
<p class="fields is-grouped"><label class="label" for="id_librarything_key">{% trans "OCLC Number:" %}</label> {{ form.oclc_number }} </p>
|
||||
{% for error in form.oclc_number.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
<p class="fields is-grouped"><label class="label" for="id_asin">{% trans "ASIN:" %}</label> {{ form.asin }} </p>
|
||||
{% for error in form.ASIN.errors %}
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block">
|
||||
<button class="button is-primary" type="submit">{% trans "Save" %}</button>
|
||||
<a class="button" href="/book/{{ book.id }}">{% trans "Cancel" %}</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
@ -6,7 +6,7 @@
|
||||
|
||||
{% 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>
|
||||
<h1 class="title">{% blocktrans with work_path=work.local_path work_title=work.title %}Editions of <a href="{{ work_path }}">"{{ work_title }}"</a>{% endblocktrans %}</h1>
|
||||
|
||||
{% include 'snippets/book_tiles.html' with books=editions %}
|
||||
</div>
|
||||
|
@ -6,22 +6,22 @@
|
||||
<h1 class="title">{% blocktrans %}{{ tab_title }} Timeline{% endblocktrans %}</h1>
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li class="{% if tab == 'home' %}is-active{% endif %}">
|
||||
<li class="{% if tab == 'home' %}is-active{% endif %}"{% if tab == 'home' %} aria-current="page"{% endif %}>
|
||||
<a href="/#feed">{% trans "Home" %}</a>
|
||||
</li>
|
||||
<li class="{% if tab == 'local' %}is-active{% endif %}">
|
||||
<li class="{% if tab == 'local' %}is-active{% endif %}"{% if tab == 'local' %} aria-current="page"{% endif %}>
|
||||
<a href="/local#feed">{% trans "Local" %}</a>
|
||||
</li>
|
||||
<li class="{% if tab == 'federated' %}is-active{% endif %}">
|
||||
<li class="{% if tab == 'federated' %}is-active{% endif %}"{% if tab == 'federated' %} aria-current="page"{% endif %}>
|
||||
<a href="/federated#feed">{% trans "Federated" %}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{# announcements and system messages #}
|
||||
{% if not goal and tab == 'home' %}
|
||||
{% if request.user.show_goal and not goal and tab == 'home' %}
|
||||
{% now 'Y' as year %}
|
||||
<section class="block hidden" aria-title="{% trans 'Announcements' %}" data-hide="hide-{{ year }}-reading-goal">
|
||||
<section class="block">
|
||||
{% include 'snippets/goal_card.html' with year=year %}
|
||||
<hr>
|
||||
</section>
|
||||
|
@ -91,3 +91,6 @@
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script src="/static/js/tabs.js"></script>
|
||||
{% endblock %}
|
||||
|
@ -4,7 +4,7 @@
|
||||
{% block panel %}
|
||||
<header class="block">
|
||||
<a href="/#feed" class="button" data-back>
|
||||
<span class="icon icon-arrow-left" aira-hidden="true"></span>
|
||||
<span class="icon icon-arrow-left" aria-hidden="true"></span>
|
||||
<span>{% trans "Back" %}</span>
|
||||
</a>
|
||||
</header>
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
{% block title %}{% trans "Import Status" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% block content %}{% spaceless %}
|
||||
<div class="block">
|
||||
<h1 class="title">{% trans "Import Status" %}</h1>
|
||||
|
||||
@ -36,8 +36,19 @@
|
||||
{% if not job.retry %}
|
||||
<form name="retry" action="/import/{{ job.id }}" method="post">
|
||||
{% csrf_token %}
|
||||
<ul>
|
||||
<fieldset>
|
||||
|
||||
{% with failed_count=failed_items|length %}
|
||||
{% if failed_count > 10 %}
|
||||
<p class="block">
|
||||
<a href="#select-all-failed-imports">
|
||||
{% blocktrans %}Jump to the bottom of the list to select the {{ failed_count }} items which failed to import.{% endblocktrans %}
|
||||
</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<fieldset id="failed-imports">
|
||||
<ul>
|
||||
{% for item in failed_items %}
|
||||
<li class="pb-1">
|
||||
<input class="checkbox" type="checkbox" name="import_item" value="{{ item.id }}" id="import-item-{{ item.id }}">
|
||||
@ -51,15 +62,28 @@
|
||||
</p>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</fieldset>
|
||||
</ul>
|
||||
<div class="block pt-1 select-all">
|
||||
<label class="label">
|
||||
<input type="checkbox" class="checkbox">
|
||||
</ul>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="mt-3">
|
||||
<a name="select-all-failed-imports"></a>
|
||||
|
||||
<label class="label is-inline">
|
||||
<input
|
||||
id="toggle-all-checkboxes-failed-imports"
|
||||
class="checkbox"
|
||||
type="checkbox"
|
||||
data-action="toggle-all"
|
||||
data-target="failed-imports"
|
||||
/>
|
||||
{% trans "Select all" %}
|
||||
</label>
|
||||
</div>
|
||||
<button class="button" type="submit">{% trans "Retry items" %}</button>
|
||||
|
||||
<button class="button is-block mt-3" type="submit">{% trans "Retry items" %}</button>
|
||||
</fieldset>
|
||||
|
||||
<hr>
|
||||
|
||||
{% else %}
|
||||
<ul>
|
||||
{% for item in failed_items %}
|
||||
@ -123,4 +147,8 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endspaceless %}{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script src="/static/js/check_all.js"></script>
|
||||
{% endblock %}
|
||||
|
33
bookwyrm/templates/isbn_search_results.html
Normal file
33
bookwyrm/templates/isbn_search_results.html
Normal file
@ -0,0 +1,33 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Search Results" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% with book_results|first as local_results %}
|
||||
<div class="block">
|
||||
<h1 class="title">{% blocktrans %}Search Results for "{{ query }}"{% endblocktrans %}</h1>
|
||||
</div>
|
||||
|
||||
<div class="block columns">
|
||||
<div class="column">
|
||||
<h2 class="title">{% trans "Matching Books" %}</h2>
|
||||
<section class="block">
|
||||
{% if not results %}
|
||||
<p>{% blocktrans %}No books found for "{{ query }}"{% endblocktrans %}</p>
|
||||
{% else %}
|
||||
<ul>
|
||||
{% for result in results %}
|
||||
<li class="pd-4">
|
||||
<a href="{{ result.key }}">{% include 'snippets/search_result_text.html' with result=result link=True %}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
<div class="column">
|
||||
</div>
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endblock %}
|
@ -22,7 +22,7 @@
|
||||
<meta name="twitter:image:alt" content="BookWyrm Logo">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar container" role="navigation" aria-label="main navigation">
|
||||
<nav class="navbar container" aria-label="main navigation">
|
||||
<div class="navbar-brand">
|
||||
<a class="navbar-item" href="/">
|
||||
<img class="image logo" src="{% if site.logo_small %}/images/{{ site.logo_small }}{% else %}/static/images/logo-small.png{% endif %}" alt="Home page">
|
||||
@ -69,10 +69,18 @@
|
||||
<div class="navbar-end">
|
||||
{% if request.user.is_authenticated %}
|
||||
<div class="navbar-item has-dropdown is-hoverable">
|
||||
<div class="navbar-link pulldown-menu" role="button" aria-expanded="false" tabindex="0" aria-haspopup="true" aria-controls="navbar-dropdown"><p>
|
||||
<a
|
||||
href="{{ user.local_path }}"
|
||||
class="navbar-link pulldown-menu"
|
||||
role="button"
|
||||
aria-expanded="false"
|
||||
tabindex="0"
|
||||
aria-haspopup="true"
|
||||
aria-controls="navbar-dropdown"
|
||||
>
|
||||
{% include 'snippets/avatar.html' with user=request.user %}
|
||||
{% include 'snippets/username.html' with user=request.user %}
|
||||
</p></div>
|
||||
<span class="ml-2">{{ request.user.display_name }}</span>
|
||||
</a>
|
||||
<ul class="navbar-dropdown" id="navbar-dropdown">
|
||||
<li>
|
||||
<a href="/direct-messages" class="navbar-item">
|
||||
@ -95,7 +103,7 @@
|
||||
</a>
|
||||
</li>
|
||||
{% if perms.bookwyrm.create_invites or perms.bookwyrm.edit_instance_settings%}
|
||||
<hr class="navbar-divider">
|
||||
<li class="navbar-divider" role="presentation"></li>
|
||||
{% endif %}
|
||||
{% if perms.bookwyrm.create_invites %}
|
||||
<li>
|
||||
@ -106,12 +114,12 @@
|
||||
{% endif %}
|
||||
{% if perms.bookwyrm.edit_instance_settings %}
|
||||
<li>
|
||||
<a href="{% url 'settings-site' %}" class="navbar-item">
|
||||
{% trans 'Site Configuration' %}
|
||||
<a href="{% url 'settings-reports' %}" class="navbar-item">
|
||||
{% trans 'Admin' %}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<hr class="navbar-divider">
|
||||
<li class="navbar-divider" role="presentation"></li>
|
||||
<li>
|
||||
<a href="/logout" class="navbar-item">
|
||||
{% trans 'Log out' %}
|
||||
@ -141,12 +149,12 @@
|
||||
<div class="columns is-variable is-1">
|
||||
<div class="column">
|
||||
<label class="is-sr-only" for="id_localname">{% trans "Username:" %}</label>
|
||||
<input type="text" name="localname" maxlength="150" class="input" required="" id="id_localname" placeholder="username">
|
||||
<input type="text" name="localname" maxlength="150" class="input" required="" id="id_localname" placeholder="{% trans 'username' %}">
|
||||
</div>
|
||||
<div class="column">
|
||||
<label class="is-sr-only" for="id_password">{% trans "Username:" %}</label>
|
||||
<input type="password" name="password" maxlength="128" class="input" required="" id="id_password" placeholder="password">
|
||||
<p class="help"><a href="/password-reset">Forgot your password?</a></p>
|
||||
<input type="password" name="password" maxlength="128" class="input" required="" id="id_password" placeholder="{% trans 'password' %}">
|
||||
<p class="help"><a href="/password-reset">{% trans "Forgot your password?" %}</a></p>
|
||||
</div>
|
||||
<div class="column is-narrow">
|
||||
<button class="button is-primary" type="submit">{% trans "Log in" %}</button>
|
||||
@ -157,7 +165,7 @@
|
||||
{% if site.allow_registration and request.path != '' and request.path != '/' %}
|
||||
<div class="column is-narrow">
|
||||
<a href="/" class="button is-link">
|
||||
Join
|
||||
{% trans "Join" %}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
@ -191,7 +199,7 @@
|
||||
{% if site.support_link %}
|
||||
<div class="column">
|
||||
<span class="icon icon-heart"></span>
|
||||
Support {{ site.name }} on <a href="{{ site.support_link }}" target="_blank">{{ site.support_title }}</a>
|
||||
{% blocktrans with site_name=site.name support_link=site.support_link support_title=site.support_title %}Support {{ site_name }} on <a href="{{ support_link }}" target="_blank">{{ support_title }}</a>{% endblocktrans %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="column">
|
||||
@ -205,5 +213,6 @@
|
||||
var csrf_token = '{{ csrf_token }}';
|
||||
</script>
|
||||
<script src="/static/js/shared.js"></script>
|
||||
{% block scripts %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
10
bookwyrm/templates/lists/created_text.html
Normal file
10
bookwyrm/templates/lists/created_text.html
Normal file
@ -0,0 +1,10 @@
|
||||
{% load i18n %}
|
||||
{% spaceless %}
|
||||
|
||||
{% if list.curation != 'open' %}
|
||||
{% blocktrans with username=list.user.display_name path=list.user.local_path %}Created and curated by <a href="{{ path }}">{{ username }}</a>{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans with username=list.user.display_name path=list.user.local_path %}Created by <a href="{{ path }}">{{ username }}</a>{% endblocktrans %}
|
||||
{% endif %}
|
||||
|
||||
{% endspaceless %}
|
@ -24,7 +24,7 @@
|
||||
{% include 'snippets/book_titleby.html' with book=item.book %}
|
||||
</td>
|
||||
<td>
|
||||
{% include 'snippets/username.html' with user=item.user %}
|
||||
<a href="{{ item.user.local_path }}">{{ item.user.display_name }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<div class="field has-addons">
|
||||
|
@ -20,7 +20,7 @@
|
||||
{% for item in items %}
|
||||
<li class="block pb-3">
|
||||
<div class="card">
|
||||
<div class="card-content columns p-0 mb-0 is-mobile">
|
||||
<div class="card-content columns p-0 pr-2 mb-0 is-mobile">
|
||||
<div class="column is-narrow pt-0 pb-0">
|
||||
<a href="{{ item.book.local_path }}">{% include 'snippets/book_cover.html' with book=item.book size="medium" %}</a>
|
||||
</div>
|
||||
@ -83,9 +83,10 @@
|
||||
</div>
|
||||
<div class="column">
|
||||
<p>{% include 'snippets/book_titleby.html' with book=book %}</p>
|
||||
<form name="add-book" method="post" action="{% url 'list-add-book' list.id %}">
|
||||
<form name="add-book" method="post" action="{% url 'list-add-book' %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="list" value="{{ list.id }}">
|
||||
<button type="submit" class="button is-small is-link">{% if list.curation == 'open' or request.user == list.user %}{% trans "Add" %}{% else %}{% trans "Suggest" %}{% endif %}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -1,5 +1,4 @@
|
||||
{% load bookwyrm_tags %}
|
||||
{% load i18n %}
|
||||
<div class="columns is-multiline">
|
||||
{% for list in lists %}
|
||||
<div class="column is-one-quarter">
|
||||
@ -16,7 +15,9 @@
|
||||
</div>
|
||||
<div class="card-content is-flex-grow-0">
|
||||
{% if list.description %}{{ list.description | to_markdown | safe | truncatewords_html:20 }}{% endif %}
|
||||
<p class="subtitle help">{% if list.curation != 'open' %}{% trans "Created and curated by" %}{% else %}{% trans "Created by" %}{% endif %} {% include 'snippets/username.html' with user=list.user %}</p>
|
||||
<p class="subtitle help">
|
||||
{% include 'lists/created_text.html' with list=list %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -8,8 +8,9 @@
|
||||
<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>
|
||||
<p class="subtitle help">{% if list.curation != 'open' %}{% trans "Created and curated by" %}{% else %}{% trans "Created by" %} {% include 'snippets/username.html' with user=list.user %}</p>
|
||||
{% endif %}
|
||||
<p class="subtitle help">
|
||||
{% include 'lists/created_text.html' with list=list %}
|
||||
</p>
|
||||
{% include 'snippets/trimmed_text.html' with full=list.description %}
|
||||
</div>
|
||||
{% if request.user == list.user %}
|
||||
|
76
bookwyrm/templates/moderation/report.html
Normal file
76
bookwyrm/templates/moderation/report.html
Normal file
@ -0,0 +1,76 @@
|
||||
{% extends 'settings/admin_layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load humanize %}
|
||||
|
||||
{% block title %}{% blocktrans with report_id=report.id username=report.user.username %}Report #{{ report_id }}: {{ username }}{% endblocktrans %}{% endblock %}
|
||||
{% block header %}{% blocktrans with report_id=report.id username=report.user.username %}Report #{{ report_id }}: {{ username }}{% endblocktrans %}{% endblock %}
|
||||
|
||||
{% block panel %}
|
||||
<div class="block">
|
||||
<a href="{% url 'settings-reports' %}">{% trans "Back to reports" %}</a>
|
||||
</div>
|
||||
|
||||
<div class="block">
|
||||
{% include 'moderation/report_preview.html' with report=report %}
|
||||
</div>
|
||||
|
||||
<div class="block content">
|
||||
<h3>{% trans "Actions" %}</h3>
|
||||
<p><a href="{{ report.user.local_path }}">{% trans "View user profile" %}</a></p>
|
||||
<div class="is-flex">
|
||||
<p class="mr-1">
|
||||
<a class="button" href="{% url 'direct-messages-user' report.user.username %}">{% trans "Send direct message" %}</a>
|
||||
</p>
|
||||
<form name="deactivate" method="post" action="{% url 'settings-report-deactivate' report.id %}">
|
||||
{% csrf_token %}
|
||||
{% if report.user.is_active %}
|
||||
<button type="submit" class="button is-danger is-light">{% trans "Deactivate user" %}</button>
|
||||
{% else %}
|
||||
<button class="button">{% trans "Reactivate user" %}</button>
|
||||
{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block">
|
||||
<h3 class="title is-4">{% trans "Moderator Comments" %}</h3>
|
||||
{% for comment in report.reportcomment_set.all %}
|
||||
<div class="card block">
|
||||
<p class="card-content">{{ comment.note }}</p>
|
||||
<div class="card-footer">
|
||||
<div class="card-footer-item">
|
||||
<a href="{{ comment.user.local_path }}">{{ comment.user.display_name }}</a>
|
||||
</div>
|
||||
<div class="card-footer-item">
|
||||
{{ comment.created_date | naturaltime }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<form class="block" name="report-comment" method="post" action="{% url 'settings-report' report.id %}">
|
||||
{% csrf_token %}
|
||||
<label for="report_comment" class="label">Comment on report</label>
|
||||
<textarea name="note" id="report_comment" class="textarea"></textarea>
|
||||
<button class="button">{% trans "Comment" %}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="block">
|
||||
<h3 class="title is-4">{% trans "Reported statuses" %}</h3>
|
||||
{% if not report.statuses.exists %}
|
||||
<em>{% trans "No statuses reported" %}</em>
|
||||
{% else %}
|
||||
<ul>
|
||||
{% for status in report.statuses.select_subclasses.all %}
|
||||
<li>
|
||||
{% if status.deleted %}
|
||||
<em>{% trans "Statuses has been deleted" %}</em>
|
||||
{% else %}
|
||||
{% include 'snippets/status/status.html' with status=status moderation_mode=True %}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
37
bookwyrm/templates/moderation/report_modal.html
Normal file
37
bookwyrm/templates/moderation/report_modal.html
Normal file
@ -0,0 +1,37 @@
|
||||
{% extends 'components/modal.html' %}
|
||||
{% load i18n %}
|
||||
{% load humanize %}
|
||||
|
||||
{% block modal-title %}
|
||||
{% blocktrans with username=user.username %}Report @{{ username }}{% endblocktrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="report" method="post" action="{% url 'report' %}">
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-body %}
|
||||
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="reporter" value="{{ reporter.id }}">
|
||||
<input type="hidden" name="user" value="{{ user.id }}">
|
||||
<input type="hidden" name="statuses" value="{{ status.id }}">
|
||||
|
||||
<section class="content">
|
||||
<p>{% blocktrans with site_name=site.name %}This report will be sent to {{ site_name }}'s moderators for review.{% endblocktrans %}</p>
|
||||
<label class="label" for="id_{{ controls_uid }}_report_note">{% trans "More info about this report:" %}</label>
|
||||
<textarea class="textarea" name="note" id="id_{{ controls_uid }}_report_note"></textarea>
|
||||
</section>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block modal-footer %}
|
||||
|
||||
<button class="button is-success" type="submit">{% trans "Submit" %}</button>
|
||||
{% trans "Cancel" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text=button_text controls_text="report" controls_uid=report_uuid class="" %}
|
||||
|
||||
{% endblock %}
|
||||
{% block modal-form-close %}</form>{% endblock %}
|
||||
|
37
bookwyrm/templates/moderation/report_preview.html
Normal file
37
bookwyrm/templates/moderation/report_preview.html
Normal file
@ -0,0 +1,37 @@
|
||||
{% extends 'components/card.html' %}
|
||||
{% load i18n %}
|
||||
{% load humanize %}
|
||||
{% block card-header %}
|
||||
<h2 class="card-header-title has-background-white-ter is-block">
|
||||
<a href="{% url 'settings-report' report.id %}">{% blocktrans with report_id=report.id username=report.user.username %}Report #{{ report_id }}: {{ username }}{% endblocktrans %}</a>
|
||||
</h2>
|
||||
{% endblock %}
|
||||
|
||||
{% block card-content %}
|
||||
<div class="block content">
|
||||
<p>
|
||||
{% if report.note %}{{ report.note }}{% else %}<em>{% trans "No notes provided" %}</em>{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block card-footer %}
|
||||
<div class="card-footer-item">
|
||||
<p>{% blocktrans with username=report.reporter.display_name path=report.reporter.local_path %}Reported by <a href="{{ path }}">{{ username }}</a>{% endblocktrans %}</p>
|
||||
</div>
|
||||
<div class="card-footer-item">
|
||||
{{ report.created_date | naturaltime }}
|
||||
</div>
|
||||
<div class="card-footer-item">
|
||||
<form name="resolve" method="post" action="{% url 'settings-report-resolve' report.id %}">
|
||||
{% csrf_token %}
|
||||
<button class="button" type="submit">
|
||||
{% if report.resolved %}
|
||||
{% trans "Re-open" %}
|
||||
{% else %}
|
||||
{% trans "Resolve" %}
|
||||
{% endif %}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
28
bookwyrm/templates/moderation/reports.html
Normal file
28
bookwyrm/templates/moderation/reports.html
Normal file
@ -0,0 +1,28 @@
|
||||
{% extends 'settings/admin_layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Reports" %}{% endblock %}
|
||||
{% block header %}{% trans "Reports" %}{% endblock %}
|
||||
|
||||
{% block panel %}
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li class="{% if not resolved %}is-active{% endif %}"{% if not resolved == 'open' %} aria-current="page"{% endif %}>
|
||||
<a href="{% url 'settings-reports' %}?resolved=false">{% trans "Open" %}</a>
|
||||
</li>
|
||||
<li class="{% if resolved %}is-active{% endif %}"{% if resolved %} aria-current="page"{% endif %}>
|
||||
<a href="{% url 'settings-reports' %}?resolved=true">{% trans "Resolved" %}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="block">
|
||||
{% for report in reports %}
|
||||
<div class="block">
|
||||
{% include 'moderation/report_preview.html' with report=report %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
@ -6,6 +6,6 @@
|
||||
{% block content %}
|
||||
<div class="block">
|
||||
<h1 class="title">{% trans "Not Found" %}</h1>
|
||||
<p>{% trans "The page your requested doesn't seem to exist!" %}</p>
|
||||
<p>{% trans "The page you requested doesn't seem to exist!" %}</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -35,6 +35,8 @@
|
||||
<span class="icon icon-list"></span>
|
||||
{% elif notification.notification_type == 'ADD' %}
|
||||
<span class="icon icon-plus"></span>
|
||||
{% elif notification.notification_type == 'REPORT' %}
|
||||
<span class="icon icon-warning"></span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="column">
|
||||
@ -42,8 +44,10 @@
|
||||
<p>
|
||||
{# DESCRIPTION #}
|
||||
{% if notification.related_user %}
|
||||
{% include 'snippets/avatar.html' with user=notification.related_user %}
|
||||
{% include 'snippets/username.html' with user=notification.related_user %}
|
||||
<a href="{{ notification.related_user.local_path }}">
|
||||
{% include 'snippets/avatar.html' with user=notification.related_user %}
|
||||
{{ notification.related_user.display_name }}
|
||||
</a>
|
||||
{% if notification.notification_type == 'FAVORITE' %}
|
||||
{% if related_status.status_type == 'Review' %}
|
||||
{% blocktrans with book_title=related_status.book.title related_path=related_status.local_path %}favorited your <a href="{{ related_path }}">review of <em>{{ book_title }}</em></a>{% endblocktrans %}
|
||||
@ -87,11 +91,11 @@
|
||||
</div>
|
||||
{% elif notification.notification_type == 'BOOST' %}
|
||||
{% if related_status.status_type == 'Review' %}
|
||||
{% blocktrans with related_path=related_status.local_path book_title=related_status.book.title %}boosted your <a href="{{ related_path }}">review of <em>{{ book.title }}</em></a>{% endblocktrans %}
|
||||
{% blocktrans with related_path=related_status.local_path book_title=related_status.book.title %}boosted your <a href="{{ related_path }}">review of <em>{{ book_title }}</em></a>{% endblocktrans %}
|
||||
{% elif related_status.status_type == 'Comment' %}
|
||||
{% blocktrans with related_path=related_status.local_path book_title=related_status.book.title %}boosted your <a href="{{ related_path }}">comment on<em>{{ book.title }}</em></a>{% endblocktrans %}
|
||||
{% blocktrans with related_path=related_status.local_path book_title=related_status.book.title %}boosted your <a href="{{ related_path }}">comment on<em>{{ book_title }}</em></a>{% endblocktrans %}
|
||||
{% elif related_status.status_type == 'Quotation' %}
|
||||
{% blocktrans with related_path=related_status.local_path book_title=related_status.book.title %}boosted your <a href="{{ related_path }}">quote from <em>{{ book.title }}</em></a>{% endblocktrans %}
|
||||
{% blocktrans with related_path=related_status.local_path book_title=related_status.book.title %}boosted your <a href="{{ related_path }}">quote from <em>{{ book_title }}</em></a>{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans with related_path=related_status.local_path %}boosted your <a href="{{ related_path }}">status</a>{% endblocktrans %}
|
||||
{% endif %}
|
||||
@ -103,7 +107,10 @@
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% elif notification.related_import %}
|
||||
{% blocktrans with related_id=notification.related_import.id %} your <a href="/import/{{ related_id }}">import</a> completed.{% endblocktrans %}
|
||||
{% blocktrans with related_id=notification.related_import.id %}Your <a href="/import/{{ related_id }}">import</a> completed.{% endblocktrans %}
|
||||
{% elif notification.related_report %}
|
||||
{% url 'settings-report' notification.related_report.id as path %}
|
||||
{% blocktrans with related_id=path %}A new <a href="{{ path }}">report</a> needs moderation.{% endblocktrans %}
|
||||
{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
@ -113,13 +120,7 @@
|
||||
<div class="notification py-2 {% if notification.id in unread %}is-primary is-light{% else %}has-background-white{% if notification.notification_type == 'REPLY' or notification.notification_type == 'MENTION' %} has-text-black{% else %}-bis has-text-grey-dark{% endif %}{% endif %}">
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
{% if related_status.content %}
|
||||
<a href="{{ related_status.local_path }}">{{ related_status.content | safe | truncatewords_html:10 }}</a>
|
||||
{% elif related_status.quote %}
|
||||
<a href="{{ related_status.local_path }}">{{ related_status.quote | safe | truncatewords_html:10 }}</a>
|
||||
{% elif related_status.rating %}
|
||||
{% include 'snippets/stars.html' with rating=related_status.rating %}
|
||||
{% endif %}
|
||||
{% include 'snippets/status_preview.html' with status=related_status %}
|
||||
</div>
|
||||
<div class="column is-narrow {% if notification.notification_type == 'REPLY' or notification.notification_type == 'MENTION' %}has-text-black{% else %}has-text-grey-dark{% endif %}">
|
||||
{{ related_status.published_date | post_date }}
|
||||
|
@ -15,7 +15,7 @@
|
||||
{% for user in request.user.blocks.all %}
|
||||
<li class="is-flex">
|
||||
<p>
|
||||
{% include 'snippets/avatar.html' with user=user %} {% include 'snippets/username.html' with user=user %}
|
||||
<a href="{{ user.local_path }}">{% include 'snippets/avatar.html' with user=user %} {{ user.display_name }}</a>
|
||||
</p>
|
||||
<p class="mr-2">
|
||||
{% include 'snippets/block_button.html' with user=user %}
|
||||
|
@ -41,6 +41,12 @@
|
||||
<p class="help is-danger">{{ error | escape }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="block">
|
||||
<label class="checkbox label" for="id_show_goal">
|
||||
{% trans "Show set reading goal prompt in feed:" %}
|
||||
{{ form.show_goal }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="block">
|
||||
<label class="checkbox label" for="id_manually_approves_followers">
|
||||
{% trans "Manually approve followers:" %}
|
||||
|
@ -19,7 +19,7 @@
|
||||
<ul>
|
||||
{% for result in local_results.results %}
|
||||
<li class="pd-4">
|
||||
<a href="{{ result.key }}">{% include 'snippets/search_result_text.html' with result=result link=True %}</a>
|
||||
{% include 'snippets/search_result_text.html' with result=result %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@ -50,12 +50,7 @@
|
||||
<ul>
|
||||
{% for result in result_set.results %}
|
||||
<li class="pb-4">
|
||||
<form action="/resolve-book" method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="remote_id" value="{{ result.key }}">
|
||||
<div>{% include 'snippets/search_result_text.html' with result=result link=False %}</div>
|
||||
<button type="submit" class="button is-small is-link">{% trans "Import book" %}</button>
|
||||
</form>
|
||||
{% include 'snippets/search_result_text.html' with result=result remote_result=True %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
@ -68,6 +63,10 @@
|
||||
{% include 'snippets/toggle/close_button.html' with text=button_text small=True controls_text="more-results" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="block">
|
||||
<a href="/create-book">Manually add book</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="column">
|
||||
@ -79,8 +78,10 @@
|
||||
<ul>
|
||||
{% for result in user_results %}
|
||||
<li class="block">
|
||||
{% include 'snippets/avatar.html' with user=result %}</h2>
|
||||
{% include 'snippets/username.html' with user=result show_full=True %}</h2>
|
||||
<a href="{{ result.local_path }}">
|
||||
{% include 'snippets/avatar.html' with user=result %}
|
||||
{{ result.display_name }}
|
||||
</a> ({{ result.username }})
|
||||
{% include 'snippets/follow_button.html' with user=result %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
@ -18,6 +18,10 @@
|
||||
{% url 'settings-invites' as url %}
|
||||
<a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Invites" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
{% url 'settings-reports' as url %}
|
||||
<a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Reports" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
{% url 'settings-federation' as url %}
|
||||
<a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Federated Servers" %}</a>
|
||||
@ -42,7 +46,7 @@
|
||||
</ul>
|
||||
{% endif %}
|
||||
</nav>
|
||||
<div class="column content">
|
||||
<div class="column">
|
||||
{% block panel %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
{% block panel %}
|
||||
|
||||
<form action="{% url 'settings-site' %}" method="POST" class="content">
|
||||
<form action="{% url 'settings-site' %}" method="POST" class="content" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
<section class="block" id="instance-info">
|
||||
<h2 class="title is-4">{% trans "Instance Info" %}</h2>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<div class="columns">
|
||||
<div class="column is-narrow is-hidden-mobile">
|
||||
<figure class="block">
|
||||
<img src="{% if site.logo_small %}/images/{{ site.logo }}{% else %}/static/images/logo.png{% endif %}" alt="BookWyrm logo">
|
||||
<img src="{% if site.logo %}/images/{{ site.logo }}{% else %}/static/images/logo.png{% endif %}" alt="BookWyrm logo">
|
||||
</figure>
|
||||
</div>
|
||||
<div class="content">
|
||||
|
@ -1,3 +1,3 @@
|
||||
{% load bookwyrm_tags %}
|
||||
<img class="avatar image {% if large %}is-96x96{% else %}is-32x32{% endif %}" src="{% if user.avatar %}/images/{{ user.avatar }}{% else %}/static/images/default_avi.jpg{% endif %}" alt="{{ user.alt_text }}">
|
||||
<img class="avatar image {% if large %}is-96x96{% else %}is-32x32{% endif %}" src="{% if user.avatar %}/images/{{ user.avatar }}{% else %}/static/images/default_avi.jpg{% endif %}" {% if ariaHide %}aria-hidden="true"{% endif %} alt="{{ user.alt_text }}">
|
||||
|
||||
|
@ -6,8 +6,7 @@
|
||||
<div class="no-cover book-cover">
|
||||
<img class="book-cover" src="/static/images/no_cover.jpg" alt="No cover">
|
||||
<div>
|
||||
<p>{{ book.title }}</p>
|
||||
<p>({{ book.edition_info }})</p>
|
||||
<p>{{ book.alt_text }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -1,18 +1,12 @@
|
||||
{% load i18n %}
|
||||
{% if request.user == user or not request.user.is_authenticated %}
|
||||
{% elif request.user in user.follower_requests.all %}
|
||||
|
||||
<div>
|
||||
{% trans "Follow request already sent." %}
|
||||
</div>
|
||||
|
||||
{% elif user in request.user.blocks.all %}
|
||||
{% include 'snippets/block_button.html' %}
|
||||
{% else %}
|
||||
|
||||
<div class="field has-addons">
|
||||
<div class="control">
|
||||
<form action="/follow/" method="POST" class="interaction follow-{{ user.id }} {% if request.user in user.followers.all %}hidden{%endif %}" data-id="follow-{{ user.id }}">
|
||||
<form action="{% url 'follow' %}" method="POST" class="interaction follow-{{ user.id }} {% if request.user in user.followers.all or request.user in user.follower_requests.all %}hidden{%endif %}" data-id="follow-{{ user.id }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="user" value="{{ user.username }}">
|
||||
{% if user.manually_approves_followers %}
|
||||
@ -21,10 +15,14 @@
|
||||
<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 }}">
|
||||
<form action="{% url 'unfollow' %}" method="POST" class="interaction follow-{{ user.id }} {% if not request.user in user.followers.all and not request.user in user.follower_requests.all %}hidden{%endif %}" data-id="follow-{{ user.id }}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="user" value="{{ user.username }}">
|
||||
{% if user.manually_approves_followers and request.user not in user.followers.all %}
|
||||
<button class="button is-small is-danger is-light" type="submit">{% trans "Undo follow request" %}</button>
|
||||
{% else %}
|
||||
<button class="button is-small is-danger is-light" type="submit">{% trans "Unfollow" %}</button>
|
||||
{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
<div class="control">
|
||||
|
3
bookwyrm/templates/snippets/generated_status/rating.html
Normal file
3
bookwyrm/templates/snippets/generated_status/rating.html
Normal file
@ -0,0 +1,3 @@
|
||||
{% load i18n %}{% load humanize %}
|
||||
|
||||
{% blocktrans with title=book.title path=book.remote_id rating=rating count counter=rating %}Rated <em><a href="{{ path }}">{{ title }}</a></em>: {{ rating }} star{% plural %}Rated <em><a href="{{ path }}">{{ title }}</a></em>: {{ rating }} stars{% endblocktrans %}
|
@ -17,8 +17,9 @@
|
||||
{% endblock %}
|
||||
|
||||
{% 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">{% trans "Dismiss message" %}</button>
|
||||
<form class="card-footer-item is-flex-direction-column" method="post" action="{% url 'hide-goal' %}">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="button is-danger is-light is-block set-display" >{% 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>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% load i18n %}
|
||||
<nav class="pagination" role="navigation" aria-label="pagination">
|
||||
<nav class="pagination" aria-label="pagination">
|
||||
{% if page.has_previous %}
|
||||
<p class="pagination-previous">
|
||||
<a href="{{ path }}?page={{ page.previous_page_number }}{{ anchor }}">
|
||||
|
@ -27,7 +27,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{% if readthrough.progress_mode == 'PG' and book.pages %}
|
||||
<p class="help">{% blocktrans %}of {{ book.pages }} pages{% endblocktrans %}</p>
|
||||
<p class="help">{% blocktrans with pages=book.pages %}of {{ pages }} pages{% endblocktrans %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</form>
|
||||
|
@ -67,4 +67,4 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% include 'snippets/delete_readthrough_modal.html' with controls_text="delete-readthrough" controls_uid=readthrough.id %}
|
||||
{% include 'snippets/delete_readthrough_modal.html' with controls_text="delete-readthrough" controls_uid=readthrough.id no_body=True %}
|
||||
|
10
bookwyrm/templates/snippets/report_button.html
Normal file
10
bookwyrm/templates/snippets/report_button.html
Normal file
@ -0,0 +1,10 @@
|
||||
{% load i18n %}
|
||||
{% load bookwyrm_tags %}
|
||||
{% with 0|uuid as report_uuid %}
|
||||
|
||||
{% trans "Report" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with class="is-danger is-light is-small is-fullwidth" text=button_text controls_text="report" controls_uid=report_uuid focus="modal-title-report" disabled=is_current %}
|
||||
|
||||
{% include 'moderation/report_modal.html' with user=user reporter=request.user controls_text="report" controls_uid=report_uuid %}
|
||||
|
||||
{% endwith %}
|
@ -1,3 +1,34 @@
|
||||
{% load i18n %}
|
||||
<strong>{% if link %}<a href="{{ result.key }}">{{ result.title }}</a>{% else %}{{ result.title }}{% endif %}</strong>
|
||||
{% if result.author %} {% blocktrans with author=result.author %}by {{ author }}{% endblocktrans %}{% endif %}{% if result.year %} ({{ result.year }}){% endif %}
|
||||
<div class="columns is-mobile">
|
||||
<div class="cover-container is-small column is-2">
|
||||
{% if result.cover %}
|
||||
<img src="{{ result.cover }}" class="book-cover" aria-hidden="true">
|
||||
{% else %}
|
||||
<div class="no-cover book-cover">
|
||||
<img class="book-cover" src="/static/images/no_cover.jpg" aria-hidden="true">
|
||||
<div>
|
||||
<p>{% trans "No cover" %}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="column">
|
||||
<p>
|
||||
<strong>
|
||||
<a href="{{ result.key }}"{% if remote_result %} rel=”noopener” target="_blank"{% endif %}>{{ result.title }}</a>
|
||||
</strong>
|
||||
{% if result.author %}
|
||||
{% blocktrans with author=result.author %}by {{ author }}{% endblocktrans %}{% endif %}{% if result.year %} ({{ result.year }})
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
{% if remote_result %}
|
||||
<form action="/resolve-book" method="POST">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="remote_id" value="{{ result.key }}">
|
||||
<button type="submit" class="button is-small is-link">{% trans "Import book" %}</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -18,7 +18,7 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<hr class="navbar-divider">
|
||||
<li class="navbar-divider" role="presentation"></li>
|
||||
<li>
|
||||
<form class="dropdown-item pt-0 pb-0" name="shelve" action="/unshelve/" method="post">
|
||||
{% csrf_token %}
|
||||
|
@ -2,8 +2,10 @@
|
||||
{% load i18n %}
|
||||
{% if not status.deleted %}
|
||||
{% if status.status_type == 'Announce' %}
|
||||
{% include 'snippets/avatar.html' with user=status.user %}
|
||||
{% include 'snippets/username.html' with user=status.user %}
|
||||
<a href="{{ status.user.local_path }}">
|
||||
{% include 'snippets/avatar.html' with user=status.user %}
|
||||
{{ status.user.display_name }}
|
||||
</a>
|
||||
{% trans "boosted" %}
|
||||
{% include 'snippets/status/status_body.html' with status=status|boosted_status %}
|
||||
{% else %}
|
||||
|
@ -18,7 +18,17 @@
|
||||
|
||||
{% block card-footer %}
|
||||
<div class="card-footer-item">
|
||||
{% if request.user.is_authenticated %}
|
||||
{% if moderation_mode and perms.bookwyrm.moderate_post %}
|
||||
|
||||
{# moderation options #}
|
||||
<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" type="submit">
|
||||
{% trans "Delete status" %}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
{% elif request.user.is_authenticated %}
|
||||
<div class="field has-addons">
|
||||
<div class="control">
|
||||
{% trans "Reply" as button_text %}
|
||||
@ -56,14 +66,16 @@
|
||||
<div class="card-footer-item">
|
||||
<a href="{{ status.remote_id }}">{{ status.published_date | post_date }}</a>
|
||||
</div>
|
||||
{% if not moderation_mode %}
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/status/status_options.html' with class="is-small" right=True %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block card-bonus %}
|
||||
{% if request.user.is_authenticated %}
|
||||
{% if request.user.is_authenticated and not moderation_mode %}
|
||||
{% with status.id|uuid as uuid %}
|
||||
<section class="hidden" id="show-comment-{{ status.id }}">
|
||||
<div class="card-footer">
|
||||
|
@ -1,12 +1,14 @@
|
||||
{% load bookwyrm_tags %}
|
||||
{% load i18n %}
|
||||
<div class="block">
|
||||
{% if status.status_type == 'Review' %}
|
||||
{% if status.status_type == 'Review' or status.status_type == 'Rating' %}
|
||||
<div>
|
||||
<h3 class="title is-5 has-subtitle">
|
||||
{% if status.name %}<span dir="auto">{{ status.name }}</span><br>{% endif %}
|
||||
{% if status.name %}
|
||||
<h3 class="title is-5 has-subtitle" dir="auto">
|
||||
{{ status.name|escape }}
|
||||
</h3>
|
||||
<p class="subtitle">{% include 'snippets/stars.html' with rating=status.rating %}</p>
|
||||
{% endif %}
|
||||
{% include 'snippets/stars.html' with rating=status.rating %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@ -33,9 +35,9 @@
|
||||
{% endif %}
|
||||
|
||||
{% if status.content and status.status_type != 'GeneratedNote' and status.status_type != 'Announce' %}
|
||||
{% include 'snippets/trimmed_text.html' with full=status.content|safe %}
|
||||
{% include 'snippets/trimmed_text.html' with full=status.content|safe no_trim=status.content_warning %}
|
||||
{% endif %}
|
||||
{% if status.attachments %}
|
||||
{% if status.attachments.exists %}
|
||||
<div class="block">
|
||||
<div class="columns">
|
||||
{% for attachment in status.attachments.all %}
|
||||
|
@ -1,11 +1,13 @@
|
||||
{% load bookwyrm_tags %}
|
||||
{% load i18n %}
|
||||
{% include 'snippets/avatar.html' with user=status.user %}
|
||||
{% include 'snippets/username.html' with user=status.user %}
|
||||
<a href="{{ status.user.local_path }}">
|
||||
{% include 'snippets/avatar.html' with user=status.user ariaHide="true" %}
|
||||
{{ status.user.display_name }}
|
||||
</a>
|
||||
|
||||
{% if status.status_type == 'GeneratedNote' %}
|
||||
{{ status.content | safe }}
|
||||
{% elif status.status_type == 'Review' and not status.name and not status.content%}
|
||||
{% elif status.status_type == 'Rating' %}
|
||||
{% trans "rated" %}
|
||||
{% elif status.status_type == 'Review' %}
|
||||
{% trans "reviewed" %}
|
||||
@ -15,7 +17,17 @@
|
||||
{% 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>
|
||||
|
||||
{% if parent_status.status_type == 'Review' %}
|
||||
{% blocktrans with username=parent_status.user.display_name user_path=parent_status.user.local_path status_path=parent_status.local_path %}replied to <a href="{{ user_path }}">{{ username}}'s</a> <a href="{{ status_path }}">review</a>{% endblocktrans %}
|
||||
{% elif parent_status.status_type == 'Comment' %}
|
||||
{% blocktrans with username=parent_status.user.display_name user_path=parent_status.user.local_path status_path=parent_status.local_path %}replied to <a href="{{ user_path }}">{{ username}}'s</a> <a href="{{ status_path }}">comment</a>{% endblocktrans %}
|
||||
{% elif parent_status.status_type == 'Quotation' %}
|
||||
{% blocktrans with username=parent_status.user.display_name user_path=parent_status.user.local_path status_path=parent_status.local_path %}replied to <a href="{{ user_path }}">{{ username}}'s</a> <a href="{{ status_path }}">quote</a>{% endblocktrans %}
|
||||
{% else %}
|
||||
{% blocktrans with username=parent_status.user.display_name user_path=parent_status.user.local_path status_path=parent_status.local_path %}replied to <a href="{{ user_path }}">{{ username}}'s</a> <a href="{{ status_path }}">status</a>{% endblocktrans %}
|
||||
{% endif %}
|
||||
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% if status.book %}
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
{% block dropdown-list %}
|
||||
{% if status.user == request.user %}
|
||||
{# things you can do to your own statuses #}
|
||||
<li role="menuitem">
|
||||
<form class="dropdown-item pt-0 pb-0" name="delete-{{status.id}}" action="/delete-status/{{ status.id }}" method="post">
|
||||
{% csrf_token %}
|
||||
@ -19,8 +20,12 @@
|
||||
</form>
|
||||
</li>
|
||||
{% else %}
|
||||
{# things you can do to other people's statuses #}
|
||||
<li role="menuitem">
|
||||
<a href="/direct-messages/{{ status.user|username }}" class="button is-fullwidth is-small">{% trans "Send direct message" %}</a>
|
||||
<a href="{% url 'direct-messages-user' status.user|username %}" class="button is-small is-fullwidth">{% trans "Send direct message" %}</a>
|
||||
</li>
|
||||
<li role="menuitem">
|
||||
{% include 'snippets/report_button.html' with user=status.user status=status %}
|
||||
</li>
|
||||
<li role="menuitem">
|
||||
{% include 'snippets/block_button.html' with user=status.user class="is-fullwidth" %}
|
||||
|
9
bookwyrm/templates/snippets/status_preview.html
Normal file
9
bookwyrm/templates/snippets/status_preview.html
Normal file
@ -0,0 +1,9 @@
|
||||
{% if status.content %}
|
||||
<a href="{{ status.local_path }}">
|
||||
{{ status.content | safe | truncatewords_html:10 }}{% if status.mention_books %} <em>{{ status.mention_books.first.title }}</em>{% endif %}
|
||||
</a>
|
||||
{% elif status.quote %}
|
||||
<a href="{{ status.local_path }}">{{ status.quote | safe | truncatewords_html:10 }}</a>
|
||||
{% elif status.rating %}
|
||||
{% include 'snippets/stars.html' with rating=status.rating %}
|
||||
{% endif %}
|
@ -6,21 +6,31 @@
|
||||
{% with full|to_markdown|safe as full %}
|
||||
|
||||
{% with full|to_markdown|safe|truncatewords_html:60 as trimmed %}
|
||||
{% if trimmed != full %}
|
||||
{% if not no_trim and trimmed != full %}
|
||||
<div id="hide-full-{{ uuid }}">
|
||||
<div class="content" id="trimmed-{{ uuid }}"><span dir="auto">{{ trimmed }}</span>
|
||||
{% trans "Show more" as button_text %}
|
||||
{% include 'snippets/toggle/open_button.html' with text=button_text controls_text="full" controls_uid=uuid class="is-small" %}
|
||||
<div class="content" id="trimmed-{{ uuid }}">
|
||||
<div dir="auto">{{ trimmed }}</div>
|
||||
|
||||
<div>
|
||||
{% trans "Show more" as button_text %}
|
||||
{% include 'snippets/toggle/open_button.html' with text=button_text controls_text="full" controls_uid=uuid class="is-small" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="full-{{ uuid }}" class="hidden">
|
||||
<div class="content"><span dir="auto">{{ full }}</span>
|
||||
{% trans "Show less" as button_text %}
|
||||
{% include 'snippets/toggle/close_button.html' with text=button_text controls_text="full" controls_uid=uuid class="is-small" %}
|
||||
<div class="content">
|
||||
<div dir="auto">{{ full }}</div>
|
||||
|
||||
<div>
|
||||
{% trans "Show less" as button_text %}
|
||||
{% include 'snippets/toggle/close_button.html' with text=button_text controls_text="full" controls_uid=uuid class="is-small" %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="content"><span dir="auto">{{ full }}</span></div>
|
||||
<div class="content">
|
||||
<div dir="auto">{{ full }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
|
@ -12,6 +12,9 @@
|
||||
<li role="menuitem">
|
||||
<a href="/direct-messages/{{ user|username }}" class="button is-fullwidth is-small">{% trans "Send direct message" %}</a>
|
||||
</li>
|
||||
<li role="menuitem">
|
||||
{% include 'snippets/report_button.html' with user=status.user class="is-fullwidth" %}
|
||||
</li>
|
||||
<li role="menuitem">
|
||||
{% include 'snippets/block_button.html' with user=user class="is-fullwidth" %}
|
||||
</li>
|
||||
|
@ -1,2 +0,0 @@
|
||||
{% load bookwyrm_tags %}
|
||||
<a href="{{ user.local_path }}" class="user">{% if user.name %}{{ user.name }}{% else %}{{ user | username }}{% endif %}</a>{% if possessive %}'s{% endif %}{% if show_full and user.name or show_full and user.localname %} ({{ user.username }}){% endif %}
|
@ -11,19 +11,22 @@
|
||||
{% block panel %}
|
||||
<div class="block">
|
||||
<h2 class="title">{% trans "Followers" %}</h2>
|
||||
{% for followers in followers %}
|
||||
{% for follower in followers %}
|
||||
<div class="block columns">
|
||||
<div class="column">
|
||||
{% include 'snippets/avatar.html' with user=followers %}
|
||||
{% include 'snippets/username.html' with user=followers show_full=True %}
|
||||
<a href="{{ follower.local_path }}">
|
||||
{% include 'snippets/avatar.html' with user=follower %}
|
||||
{{ follower.display_name }}
|
||||
</a>
|
||||
({{ follower.username }})
|
||||
</div>
|
||||
<div class="column is-narrow">
|
||||
{% include 'snippets/follow_button.html' with user=followers %}
|
||||
{% include 'snippets/follow_button.html' with user=follower %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if not followers.count %}
|
||||
<div>{% blocktrans with username=user|username %}{{ username }} has no followers{% endblocktrans %}</div>
|
||||
<div>{% blocktrans with username=user.display_name %}{{ username }} has no followers{% endblocktrans %}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -14,8 +14,11 @@
|
||||
{% for follower in user.following.all %}
|
||||
<div class="block columns">
|
||||
<div class="column">
|
||||
{% include 'snippets/avatar.html' with user=follower %}
|
||||
{% include 'snippets/username.html' with user=follower show_full=True %}
|
||||
<a href="{{ follower.local_path }}">
|
||||
{% include 'snippets/avatar.html' with user=follower %}
|
||||
{{ follower.display_name }}
|
||||
</a>
|
||||
({{ follower.username }})
|
||||
</div>
|
||||
<div class="column">
|
||||
{% include 'snippets/follow_button.html' with user=follower %}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{% extends 'user/user_layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{{ user.name }}{% endblock %}
|
||||
{% block title %}{{ user.display_name }}{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
<div class="columns is-mobile">
|
||||
@ -67,7 +67,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{% for activity in activities %}
|
||||
<div class="block" id="feed">
|
||||
<div class="block" id="feed-{{ activity.id }}">
|
||||
{% include 'snippets/status/status.html' with status=activity %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
@ -17,11 +17,11 @@
|
||||
{% include 'user/user_preview.html' with user=user %}
|
||||
</div>
|
||||
|
||||
{% if user.summary %}
|
||||
<div class="column box has-background-white-bis content">
|
||||
{% if user.summary %}
|
||||
{{ user.summary | to_markdown | safe }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if not is_self and request.user.is_authenticated %}
|
||||
{% include 'snippets/follow_button.html' with user=user %}
|
||||
@ -33,7 +33,7 @@
|
||||
{% for requester in user.follower_requests.all %}
|
||||
<div class="row shrink">
|
||||
<p>
|
||||
{% include 'snippets/username.html' with user=requester show_full=True %}
|
||||
<a href="{{ requester.local_path }}">{{ requester.display_name }}</a> ({{ requester.username }})
|
||||
</p>
|
||||
{% include 'snippets/follow_request_buttons.html' with user=requester %}
|
||||
</div>
|
||||
@ -56,7 +56,7 @@
|
||||
<a href="{{ url }}">{% trans "Reading Goal" %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if is_self or user.lists.exists %}
|
||||
{% if is_self or user.list_set.exists %}
|
||||
{% url 'user-lists' user|username as url %}
|
||||
<li{% if url in request.path %} class="is-active"{% endif %}>
|
||||
<a href="{{ url }}">{% trans "Lists" %}</a>
|
||||
|
Reference in New Issue
Block a user