Merge branch 'main' into book-file-links
This commit is contained in:
141
bookwyrm/templates/about/about.html
Normal file
141
bookwyrm/templates/about/about.html
Normal file
@ -0,0 +1,141 @@
|
||||
{% extends 'about/layout.html' %}
|
||||
{% load humanize %}
|
||||
{% load i18n %}
|
||||
{% load utilities %}
|
||||
{% load bookwyrm_tags %}
|
||||
{% load cache %}
|
||||
|
||||
{% block title %}
|
||||
{% trans "About" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block about_content %}
|
||||
{# seven day cache #}
|
||||
{% cache 604800 about_page %}
|
||||
{% get_book_superlatives as superlatives %}
|
||||
<section class="content pb-4">
|
||||
<h2>
|
||||
{% blocktrans with site_name=site.name %}Welcome to {{ site_name }}!{% endblocktrans %}
|
||||
</h2>
|
||||
|
||||
<p class="subtitle notification has-background-primary-light">
|
||||
{% blocktrans trimmed with site_name=site.name %}
|
||||
{{ site_name }} is part of <em>BookWyrm</em>, a network of independent, self-directed communities for readers.
|
||||
While you can interact seemlessly with users anywhere in the <a href="https://joinbookwyrm.com/instances/" target="_blank">BookWyrm network</a>, this community is unique.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
|
||||
<div class="columns">
|
||||
{% if top_rated %}
|
||||
{% with book=superlatives.top_rated.default_edition rating=top_rated.rating %}
|
||||
<div class="column is-one-third is-flex">
|
||||
<div class="media notification">
|
||||
<div class="media-left">
|
||||
<a href="{{ book.local_path }}">
|
||||
{% include 'snippets/book_cover.html' with book=book cover_class='is-h-m' size='medium' aria='show' %}
|
||||
</a>
|
||||
</div>
|
||||
<div class="media-content">
|
||||
{% blocktrans trimmed with title=book|book_title book_path=book.local_path site_name=site.name rating=rating|floatformat:1 %}
|
||||
<a href="{{ book_path }}"><em>{{ title }}</em></a> is {{ site_name }}'s most beloved book, with an average rating of {{ rating }} out of 5.
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
|
||||
{% if wanted %}
|
||||
{% with book=superlatives.wanted.default_edition %}
|
||||
<div class="column is-one-third is-flex">
|
||||
<div class="media notification">
|
||||
<div class="media-left">
|
||||
<a href="{{ book.local_path }}">
|
||||
{% include 'snippets/book_cover.html' with book=book cover_class='is-h-m' size='medium' aria='show' %}
|
||||
</a>
|
||||
</div>
|
||||
<div class="media-content">
|
||||
{% blocktrans trimmed with title=book|book_title book_path=book.local_path site_name=site.name %}
|
||||
More {{ site_name }} users want to read <a href="{{ book_path }}"><em>{{ title }}</em></a> than any other book.
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
|
||||
{% if controversial %}
|
||||
{% with book=superlatives.controversial.default_edition %}
|
||||
<div class="column is-one-third is-flex">
|
||||
<div class="media notification">
|
||||
<div class="media-left">
|
||||
<a href="{{ book.local_path }}">
|
||||
{% include 'snippets/book_cover.html' with book=book cover_class='is-h-m' size='medium' aria='show' %}
|
||||
</a>
|
||||
</div>
|
||||
<div class="media-content">
|
||||
{% blocktrans trimmed with title=book|book_title book_path=book.local_path site_name=site.name %}
|
||||
<a href="{{ book_path }}"><em>{{ title }}</em></a> has the most divisive ratings of any book on {{ site_name }}.
|
||||
{% endblocktrans %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<p>
|
||||
{% trans "Track your reading, talk about books, write reviews, and discover what to read next. Always ad-free, anti-corporate, and community-oriented, BookWyrm is human-scale software, designed to stay small and personal. If you have feature requests, bug reports, or grand dreams, <a href='https://joinbookwyrm.com/get-involved' target='_blank'>reach out</a> and make yourself heard." %}
|
||||
</p>
|
||||
|
||||
</section>
|
||||
|
||||
<section class="block">
|
||||
<header class="content">
|
||||
<h2 class="title is-3">{% trans "Meet your admins" %}</h2>
|
||||
<p>
|
||||
{% url "conduct" as coc_path %}
|
||||
{% blocktrans with site_name=site.name %}
|
||||
{{ site_name }}'s moderators and administrators keep the site up and running, enforce the <a href="coc_path">code of conduct</a>, and respond when users report spam and bad behavior.
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<div class="columns is-multiline">
|
||||
{% for user in admins %}
|
||||
<div class="column">
|
||||
<div class="card is-stretchable">
|
||||
{% with role=user.groups.first.name %}
|
||||
<div class="card-header {% if role == "moderator" %}has-background-info-light{% else %}has-background-success-light{% endif %}">
|
||||
<span class="card-header-title is-size-7 pt-1 pb-1">
|
||||
{% if role == "moderator" %}
|
||||
{% trans "Moderator" %}
|
||||
{% else %}
|
||||
{% trans "Admin" %}
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
{% endwith %}
|
||||
|
||||
<div class="cord-content p-5">
|
||||
{% include 'user/user_preview.html' with user=user %}
|
||||
</div>
|
||||
|
||||
{% if request.user.is_authenticated and user.id != request.user.id %}
|
||||
<div class="has-background-white-bis card-footer">
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/follow_button.html' with user=user minimal=True %}
|
||||
</div>
|
||||
<div class="card-footer-item">
|
||||
<a href="{% url 'direct-messages-user' user|username %}">{% trans "Send direct message" %}</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{% endcache %}
|
||||
{% endblock %}
|
15
bookwyrm/templates/about/conduct.html
Normal file
15
bookwyrm/templates/about/conduct.html
Normal file
@ -0,0 +1,15 @@
|
||||
{% extends 'about/layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Code of Conduct" %}{% endblock %}
|
||||
|
||||
|
||||
{% block about_content %}
|
||||
<div class="block content">
|
||||
<h2>{% trans "Code of Conduct" %}</h2>
|
||||
<div class="content">
|
||||
{{ site.code_of_conduct | safe }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
57
bookwyrm/templates/about/layout.html
Normal file
57
bookwyrm/templates/about/layout.html
Normal file
@ -0,0 +1,57 @@
|
||||
{% extends 'landing/layout.html' %}
|
||||
{% load humanize %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block about_panel %}
|
||||
<div class="box">
|
||||
{% include "snippets/about.html" with size="m" %}
|
||||
{% if active_users %}
|
||||
<ul>
|
||||
<li class="tag is-size-6">
|
||||
<span class="mr-1">{% trans "Active users:" %}</span>
|
||||
<strong>{{ active_users|intcomma }}</strong>
|
||||
</li>
|
||||
<li class="tag is-size-6">
|
||||
<span class="mr-1">{% trans "Statuses posted:" %}</span>
|
||||
<strong>{{ status_count|intcomma }}</strong>
|
||||
</li>
|
||||
<li class="tag is-size-6">
|
||||
<span class="mr-1">{% trans "Software version:" %}</span>
|
||||
<strong>{{ version }}</strong>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block panel %}
|
||||
<div class="block columns pt-4">
|
||||
<nav class="menu column is-one-quarter">
|
||||
<h2 class="menu-label">{% blocktrans with site_name=site.name %}About {{ site_name }}{% endblocktrans %}</h2>
|
||||
<ul class="menu-list">
|
||||
<li>
|
||||
{% url 'about' as path %}
|
||||
<a href="{{ path }}" {% if request.path in path %}class="is-active"{% endif %}>
|
||||
{% trans "About" %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{% url 'conduct' as path %}
|
||||
<a href="{{ path }}" {% if request.path in path %}class="is-active"{% endif %}>
|
||||
{% trans "Code of Conduct" %}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{% url 'privacy' as path %}
|
||||
<a href="{{ path }}" {% if request.path in path %}class="is-active"{% endif %}>
|
||||
{% trans "Privacy Policy" %}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="column">
|
||||
{% block about_content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
15
bookwyrm/templates/about/privacy.html
Normal file
15
bookwyrm/templates/about/privacy.html
Normal file
@ -0,0 +1,15 @@
|
||||
{% extends 'about/layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Privacy Policy" %}{% endblock %}
|
||||
|
||||
{% block about_content %}
|
||||
|
||||
<div class="block">
|
||||
<h2 class="title">{% trans "Privacy Policy" %}</h2>
|
||||
<div class="content">
|
||||
{{ site.privacy_policy | safe }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
298
bookwyrm/templates/annual_summary/layout.html
Normal file
298
bookwyrm/templates/annual_summary/layout.html
Normal file
@ -0,0 +1,298 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
{% load humanize %}
|
||||
|
||||
|
||||
{% block title %}{% blocktrans %}{{ year }} in the books{% endblocktrans %}{% endblock %}
|
||||
|
||||
{% block head_links %}
|
||||
<link rel="stylesheet" href="{% static "css/vendor/dm_serif_display.css" %}">
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% with display_name=summary_user.display_name %}
|
||||
{% if user == summary_user %}
|
||||
<div class="columns">
|
||||
{% with year=paginated_years|first %}
|
||||
{% if year %}
|
||||
<div class="column">
|
||||
<a href="{% url 'annual-summary' summary_user.localname year %}">
|
||||
<span class="icon icon-arrow-left" aria-hidden="true"></span>
|
||||
{{ year }}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
{% with year=paginated_years|last %}
|
||||
{% if year %}
|
||||
<div class="column has-text-right">
|
||||
<a href="{% url 'annual-summary' summary_user.localname year %}">
|
||||
{{ year }}
|
||||
<span class="icon icon-arrow-right" aria-hidden="true"></span>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<h1 class="title is-1 is-serif has-text-centered">
|
||||
📚✨
|
||||
{% blocktrans %}{{ year }} <em>in the books</em>{% endblocktrans %}
|
||||
✨📚
|
||||
</h1>
|
||||
<p class="subtitle is-3 is-serif has-text-centered mb-5">
|
||||
{% blocktrans %}<em>{{ display_name }}’s</em> year of reading{% endblocktrans %}
|
||||
</p>
|
||||
|
||||
<details>
|
||||
<summary class="has-text-centered">
|
||||
<span role="heading" aria-level="2" class="title is-6 has-text-success-dark">
|
||||
{% trans "Share this page" %}
|
||||
</span>
|
||||
</summary>
|
||||
<div class="columns mt-3">
|
||||
<div class="column is-three-fifths is-offset-one-fifth">
|
||||
|
||||
{% if year_key %}
|
||||
<div class="horizontal-copy mb-5">
|
||||
<textarea
|
||||
rows="1"
|
||||
readonly
|
||||
class="textarea is-small"
|
||||
aria-labelledby="embed-label"
|
||||
data-copytext
|
||||
data-copytext-label="{% trans 'Copy address' %}"
|
||||
data-copytext-success="{% trans 'Copied!' %}"
|
||||
>{{ request.scheme|add:"://"|add:request.get_host|add:request.path }}?key={{ year_key }}</textarea>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if user == summary_user %}
|
||||
{% if year_key %}
|
||||
<div class="columns mb-2">
|
||||
<div class="column pb-0">
|
||||
<p>{% trans "Sharing status: <strong>public with key</strong>" %}</p>
|
||||
<p>{% trans "The page can be seen by anyone with the complete address." %}</p>
|
||||
</div>
|
||||
<form class="column pb-0 is-narrow" method="post" action="{% url "summary-revoke-key" %}" id="revoke-key">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="year" value="{{ year }}" />
|
||||
<button class="button is-danger is-outlined" type="submit">{% trans "Make page private" %}</button>
|
||||
</form>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="columns">
|
||||
<div class="column pb-0">
|
||||
<p>{% trans "Sharing status: <strong>private</strong>" %}</p>
|
||||
<p>{% trans "The page is private, only you can see it." %}</p>
|
||||
</div>
|
||||
<form class="column pb-0 is-narrow" method="post" action="{% url "summary-add-key" %}" id="add-key">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="year" value="{{ year }}" />
|
||||
<button class="button is-primary is-outlined" type="submit">{% trans "Make page public" %}</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
<p class="help">{% trans "When you make your page private, the old key won’t give access to the page anymore. A new key will be created if the page is once again made public." %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<div class="columns mt-1">
|
||||
<div class="column is-one-fifth is-offset-two-fifths">
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if not books %}
|
||||
<p class="has-text-centered is-size-5">{% blocktrans %}Sadly {{ display_name }} didn’t finish any books in {{ year }}{% endblocktrans %}</p>
|
||||
{% else %}
|
||||
|
||||
<div class="columns is-mobile">
|
||||
<div class="column is-8 is-offset-2 has-text-centered">
|
||||
<h2 class="title is-3 is-serif">
|
||||
{% blocktrans trimmed count counter=books_total with pages_total=pages_total|intcomma %}
|
||||
In {{ year }}, {{ display_name }} read {{ books_total }} book<br />for a total of {{ pages_total }} pages!
|
||||
{% plural %}
|
||||
In {{ year }}, {{ display_name }} read {{ books_total }} books<br />for a total of {{ pages_total }} pages!
|
||||
{% endblocktrans %}
|
||||
</h2>
|
||||
<p class="subtitle is-5">{% trans "That’s great!" %}</p>
|
||||
|
||||
<p class="title is-4 is-serif">
|
||||
{% blocktrans with pages=pages_average|intcomma %}That makes an average of {{ pages }} pages per book.{% endblocktrans %}
|
||||
</p>
|
||||
|
||||
{% if no_page_number %}
|
||||
<p class="subtitle is-6">
|
||||
{% blocktrans trimmed count counter=no_page_number %}
|
||||
({{ no_page_number }} book doesn’t have pages)
|
||||
{% plural %}
|
||||
({{ no_page_number }} books don’t have pages)
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if book_pages_lowest and book_pages_highest %}
|
||||
<div class="columns is-align-items-center mt-5">
|
||||
<div class="column is-2 is-offset-1">
|
||||
<a href="{{ book_pages_lowest.local_path }}">{% include 'snippets/book_cover.html' with book=book_pages_lowest cover_class='is-w-auto-tablet is-h-l-mobile' size='xxlarge' %}</a>
|
||||
</div>
|
||||
<div class="column is-3">
|
||||
{% trans "Their shortest read this year…" %}
|
||||
<p class="title is-4 is-serif is-italic">
|
||||
<a href="{{ book_pages_lowest.local_path }}" class="has-text-success-dark">
|
||||
{{ book_pages_lowest.title }}
|
||||
</a>
|
||||
</p>
|
||||
{% if book_pages_lowest.authors.exists %}
|
||||
<p class="subtitle is-5 mb-2">{% trans "by" %}
|
||||
{% include 'snippets/authors.html' with book=book_pages_lowest link_class="has-text-success-dark" %}
|
||||
</p>
|
||||
{% endif %}
|
||||
<p class="subtitle is-6">
|
||||
{% with pages=book_pages_lowest.pages %}
|
||||
{% blocktrans %}<strong>{{ pages }}</strong> pages{% endblocktrans%}
|
||||
{% endwith %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="column is-2">
|
||||
<a href="{{ book_pages_highest.local_path }}">{% include 'snippets/book_cover.html' with book=book_pages_highest cover_class='is-w-auto-tablet is-h-l-mobile' size='xxlarge' %}</a>
|
||||
</div>
|
||||
<div class="column is-3">
|
||||
{% trans "…and the longest" %}
|
||||
<p class="title is-4 is-serif is-italic">
|
||||
<a href="{{ book_pages_lowest.local_path }}" class="has-text-success-dark">
|
||||
{{ book_pages_highest.title }}
|
||||
</a>
|
||||
</p>
|
||||
{% if book_pages_highest.authors.exists %}
|
||||
<p class="subtitle is-5 mb-2">{% trans "by" %}
|
||||
{% include 'snippets/authors.html' with book=book_pages_highest link_class="has-text-success-dark" %}
|
||||
</p>
|
||||
{% endif %}
|
||||
<p class="subtitle is-6">
|
||||
{% with pages=book_pages_highest.pages %}
|
||||
{% blocktrans %}<strong>{{ pages }}</strong> pages{% endblocktrans%}
|
||||
{% endwith %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="columns">
|
||||
<div class="column is-one-fifth is-offset-two-fifths">
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if goal_status and goal_status.percent >= 100 %}
|
||||
<div class="columns">
|
||||
<div class="column has-text-centered">
|
||||
<h2 class="title is-3 is-serif">
|
||||
{% with goal=goal_status.goal goal_percent=goal_status.percent %}
|
||||
{% blocktrans trimmed count counter=goal %}
|
||||
{{ display_name }} set a goal of reading {{ goal }} book in {{ year }},<br />
|
||||
and achieved {{ goal_percent }}% of that goal
|
||||
{% plural %}
|
||||
{{ display_name }} set a goal of reading {{ goal }} books in {{ year }},<br />
|
||||
and achieved {{ goal_percent }}% of that goal
|
||||
{% endblocktrans %}
|
||||
{% endwith %}
|
||||
</h2>
|
||||
<p class="subtitle is-5">{% trans "Way to go!" %}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="columns">
|
||||
<div class="column is-one-fifth is-offset-two-fifths">
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if ratings_total > 0 %}
|
||||
<div class="columns">
|
||||
<div class="column has-text-centered">
|
||||
<h2 class="title is-3 is-serif">
|
||||
{% blocktrans trimmed count counter=ratings_total %}
|
||||
{{ display_name }} left {{ ratings_total }} rating, <br />their average rating is {{ rating_average }}
|
||||
{% plural %}
|
||||
{{ display_name }} left {{ ratings_total }} ratings, <br />their average rating is {{ rating_average }}
|
||||
{% endblocktrans %}
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="columns is-align-items-center">
|
||||
<div class="column is-2 is-offset-4">
|
||||
<a href="{{ book_rating_highest.book.local_path }}">{% include 'snippets/book_cover.html' with book=book_rating_highest.book cover_class='is-w-xl-tablet is-h-l-mobile' size='xxlarge' %}</a>
|
||||
</div>
|
||||
{% if book_rating_highest %}
|
||||
<div class="column is-4">
|
||||
{% trans "Their best rated review" %}
|
||||
<p class="title is-4 is-serif is-italic">
|
||||
<a href="{{ book_rating_highest.book.local_path }}" class="has-text-success-dark">
|
||||
{{ book_rating_highest.book.title }}
|
||||
</a>
|
||||
</p>
|
||||
{% if book_rating_highest.book.authors.exists %}
|
||||
<p class="subtitle is-5 mb-2">{% trans "by" %}
|
||||
{% include 'snippets/authors.html' with book=book_rating_highest.book link_class="has-text-success-dark" %}
|
||||
</p>
|
||||
{% endif %}
|
||||
<p class="subtitle is-6">
|
||||
{% with rating=book_rating_highest.rating|floatformat %}
|
||||
{% blocktrans %}Their rating: <strong>{{ rating }}</strong>{% endblocktrans%}
|
||||
{% endwith %}
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="columns">
|
||||
<div class="column is-one-fifth is-offset-two-fifths">
|
||||
<hr />
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="columns">
|
||||
<div class="column has-text-centered">
|
||||
<h2 class="title is-3 is-serif">
|
||||
{% blocktrans %}All the books {{ display_name }} read in {{ year }}{% endblocktrans %}
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="columns">
|
||||
<div class="column is-10 is-offset-1">
|
||||
<div class="books-grid">
|
||||
{% for book in books %}
|
||||
{% if books_total > 12 and book.id in best_ratings_books_ids %}
|
||||
<a href="{{ book.local_path }}" class="has-text-centered is-big has-text-success-dark">
|
||||
{% include 'snippets/book_cover.html' with book=book cover_class='is-w-auto' size='xxlarge' %}
|
||||
<span class="book-title is-serif is-size-5">
|
||||
{{ book.title }}
|
||||
</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{{ book.local_path }}" class="has-text-centered has-text-success-dark">
|
||||
{% include 'snippets/book_cover.html' with book=book cover_class='is-w-auto' size='xlarge' %}
|
||||
<span class="book-title is-serif is-size-6">
|
||||
{{ book.title }}
|
||||
</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
@ -92,10 +92,11 @@
|
||||
{% trans "View on OpenLibrary" %}
|
||||
</a>
|
||||
{% if request.user.is_authenticated and perms.bookwyrm.edit_book %}
|
||||
{% with controls_text="ol_sync" controls_uid=author.id %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text=button_text focus="modal_title_ol_sync" class="is-small" icon_with_text="download" %}
|
||||
{% include "author/sync_modal.html" with source="openlibrary.org" source_name="OpenLibrary" %}
|
||||
{% endwith %}
|
||||
<button class="button is-small" type="button" data-modal-open="openlibrary_sync">
|
||||
<span class="icon icon-download" title="{{ button_text }}"></span>
|
||||
<span class="is-sr-only-mobile">{{ button_text }}</span>
|
||||
</button>
|
||||
{% include "author/sync_modal.html" with source="openlibrary.org" source_name="OpenLibrary" id="openlibrary_sync" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
@ -107,10 +108,11 @@
|
||||
</a>
|
||||
|
||||
{% if request.user.is_authenticated and perms.bookwyrm.edit_book %}
|
||||
{% with controls_text="iv_sync" controls_uid=author.id %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text=button_text focus="modal_title_iv_sync" class="is-small" icon_with_text="download" %}
|
||||
{% include "author/sync_modal.html" with source="inventaire.io" source_name="Inventaire" %}
|
||||
{% endwith %}
|
||||
<button class="button is-small" type="button" data-modal-open="inventaire_sync">
|
||||
<span class="icon icon-download" title="{{ button_text }}"></span>
|
||||
<span class="is-sr-only-mobile">{{ button_text }}</span>
|
||||
</button>
|
||||
{% include "author/sync_modal.html" with source="inventaire.io" source_name="Inventaire" id="inventaire_sync" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -19,12 +19,8 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-footer %}
|
||||
<button class="button is-primary" type="submit">
|
||||
<span>{% trans "Confirm" %}</span>
|
||||
</button>
|
||||
|
||||
{% trans "Cancel" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text=button_text %}
|
||||
<button class="button is-primary" type="submit">{% trans "Confirm" %}</button>
|
||||
<button type="button" class="button" data-modal-close>{% trans "Cancel" %}</button>
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-form-close %}</form>{% endblock %}
|
||||
|
@ -61,24 +61,53 @@
|
||||
|
||||
<div class="columns">
|
||||
<div class="column is-one-fifth">
|
||||
{% include 'snippets/book_cover.html' with size='xxlarge' size_mobile='medium' book=book cover_class='is-h-m-mobile' %}
|
||||
{% if not book.cover %}
|
||||
{% if user_authenticated %}
|
||||
<button
|
||||
type="button"
|
||||
class="cover-container no-cover is-h-m-mobile"
|
||||
data-modal-open="add_cover_{{ book.id }}"
|
||||
>
|
||||
<img
|
||||
class="book-cover"
|
||||
src="{% static "images/no_cover.jpg" %}"
|
||||
alt=""
|
||||
aria-hidden="true"
|
||||
>
|
||||
<span class="cover-caption">
|
||||
<span>{{ book.alt_text }}</span>
|
||||
<span>{% trans "Click to add cover" %}</span>
|
||||
</span>
|
||||
<span class="button-invisible-overlay has-text-centered">
|
||||
{% trans "Click to add cover" %}
|
||||
</span>
|
||||
</button>
|
||||
{% join "add_cover" book.id as modal_id %}
|
||||
{% include 'book/cover_add_modal.html' with id=modal_id %}
|
||||
{% if request.GET.cover_error %}
|
||||
<p class="help is-danger">{% trans "Failed to load cover" %}</p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% include 'snippets/book_cover.html' with book=book cover_class='is-h-m-mobile' %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if book.cover %}
|
||||
<button type="button" data-modal-open="cover_show_modal" class="cover-container is-h-m-mobile is-relative">
|
||||
{% include 'snippets/book_cover.html' with size='xxlarge' size_mobile='medium' book=book cover_class='is-h-m-mobile' %}
|
||||
<span class="button-invisible-overlay has-text-centered">
|
||||
{% trans "Click to enlarge" %}
|
||||
</span>
|
||||
</button>
|
||||
{% include 'book/cover_show_modal.html' with book=book id="cover_show_modal" %}
|
||||
{% endif %}
|
||||
|
||||
{% include 'snippets/rate_action.html' with user=request.user book=book %}
|
||||
|
||||
<div class="mb-3">
|
||||
{% include 'snippets/shelve_button/shelve_button.html' %}
|
||||
</div>
|
||||
|
||||
{% if user_authenticated and not book.cover %}
|
||||
<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 %}
|
||||
{% if request.GET.cover_error %}
|
||||
<p class="help is-danger">{% trans "Failed to load cover" %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<section class="is-clipped">
|
||||
{% with book=book %}
|
||||
<div class="content">
|
||||
@ -93,23 +122,30 @@
|
||||
{% trans "Load data" as button_text %}
|
||||
{% if book.openlibrary_key %}
|
||||
<p>
|
||||
<a href="{{ book.openlibrary_link }}" target="_blank" rel="noopener">{% trans "View on OpenLibrary" %}</a>
|
||||
<a href="{{ book.openlibrary_link }}" target="_blank" rel="noopener">
|
||||
{% trans "View on OpenLibrary" %}
|
||||
</a>
|
||||
{% if request.user.is_authenticated and perms.bookwyrm.edit_book %}
|
||||
{% with controls_text="ol_sync" controls_uid=book.id %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text=button_text focus="modal_title_ol_sync" class="is-small" icon_with_text="download" %}
|
||||
{% include "book/sync_modal.html" with source="openlibrary.org" source_name="OpenLibrary" %}
|
||||
{% endwith %}
|
||||
<button class="button is-small" type="button" data-modal-open="openlibrary_sync">
|
||||
<span class="icon icon-download" title="{{ button_text }}"></span>
|
||||
<span class="is-sr-only-mobile">{{ button_text }}</span>
|
||||
</button>
|
||||
{% include "book/sync_modal.html" with source="openlibrary.org" source_name="OpenLibrary" id="openlibrary_sync" %}
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if book.inventaire_id %}
|
||||
<p>
|
||||
<a href="{{ book.inventaire_link }}" target="_blank" rel="noopener">{% trans "View on Inventaire" %}</a>
|
||||
<a href="{{ book.inventaire_link }}" target="_blank" rel="noopener">
|
||||
{% trans "View on Inventaire" %}
|
||||
</a>
|
||||
|
||||
{% if request.user.is_authenticated and perms.bookwyrm.edit_book %}
|
||||
{% with controls_text="iv_sync" controls_uid=book.id %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text=button_text focus="modal_title_iv_sync" class="is-small" icon_with_text="download" %}
|
||||
{% include "book/sync_modal.html" with source="inventaire.io" source_name="Inventaire" %}
|
||||
{% endwith %}
|
||||
<button class="button is-small" type="button" data-modal-open="inventaire_sync">
|
||||
<span class="icon icon-download" title="{{ button_text }}"></span>
|
||||
<span class="is-sr-only-mobile">{{ button_text }}</span>
|
||||
</button>
|
||||
{% include "book/sync_modal.html" with source="inventaire.io" source_name="Inventaire" id="inventaire_sync" %}
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
@ -29,8 +29,7 @@
|
||||
|
||||
{% 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 %}
|
||||
<button type="button" class="button" data-modal-close>{% trans "Cancel" %}</button>
|
||||
{% endblock %}
|
||||
{% block modal-form-close %}</form>{% endblock %}
|
||||
|
||||
{% block modal-form-close %}</form>{% endblock %}
|
12
bookwyrm/templates/book/cover_show_modal.html
Normal file
12
bookwyrm/templates/book/cover_show_modal.html
Normal file
@ -0,0 +1,12 @@
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
|
||||
<div class="modal" id="{{ id }}">
|
||||
<div class="modal-background" data-modal-close></div><!-- modal background -->
|
||||
<div class="modal-card is-align-items-center" role="dialog" aria-modal="true" tabindex="-1" aria-label="{% trans 'Book cover preview' %}">
|
||||
<div class="cover-container">
|
||||
<img class="book-cover" src="{% get_media_prefix %}{{ book.cover }}" itemprop="thumbnailUrl" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" data-modal-close class="modal-close is-large" aria-label="{% trans 'Close' %}"></button>
|
||||
</div>
|
@ -2,11 +2,17 @@
|
||||
{% load i18n %}
|
||||
|
||||
{% block modal-title %}{% trans "Delete these read dates?" %}{% endblock %}
|
||||
|
||||
{% block modal-body %}
|
||||
{% if readthrough.progress_updates|length > 0 %}
|
||||
{% blocktrans with count=readthrough.progress_updates|length %}You are deleting this readthrough and its {{ count }} associated progress updates.{% endblocktrans %}
|
||||
{% blocktrans trimmed with count=readthrough.progress_updates|length %}
|
||||
You are deleting this readthrough and its {{ count }} associated progress updates.
|
||||
{% endblocktrans %}
|
||||
{% else %}
|
||||
{% trans "This action cannot be un-done" %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-footer %}
|
||||
<form name="delete-readthrough-{{ readthrough.id }}" action="/delete-readthrough" method="POST">
|
||||
{% csrf_token %}
|
||||
@ -14,7 +20,6 @@
|
||||
<button class="button is-danger" type="submit">
|
||||
{% trans "Delete" %}
|
||||
</button>
|
||||
{% trans "Cancel" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text=button_text controls_text="delete_readthrough" controls_uid=readthrough.id %}
|
||||
<button type="button" class="button" data-modal-close>{% trans "Cancel" %}</button>
|
||||
</form>
|
||||
{% endblock %}
|
@ -1,6 +1,7 @@
|
||||
{% load i18n %}
|
||||
{% load humanize %}
|
||||
{% load tz %}
|
||||
{% load utilities %}
|
||||
<div class="content">
|
||||
<div id="hide_edit_readthrough_{{ readthrough.id }}" class="box is-shadowless has-background-white-bis">
|
||||
<div class="columns">
|
||||
@ -10,14 +11,14 @@
|
||||
{% if readthrough.finish_date or readthrough.progress %}
|
||||
<li>
|
||||
{% if readthrough.finish_date %}
|
||||
{{ readthrough.finish_date | localtime | naturalday }}: {% trans "finished" %}
|
||||
{{ readthrough.finish_date | localtime | naturalday }}: {% trans "finished" %}
|
||||
{% else %}
|
||||
|
||||
{% if readthrough.progress_mode == 'PG' %}
|
||||
{% include 'snippets/page_text.html' with page=readthrough.progress total_pages=book.pages %}
|
||||
{% else %}
|
||||
{{ readthrough.progress }}%
|
||||
{% endif %}
|
||||
{% if readthrough.progress_mode == 'PG' %}
|
||||
{% include 'snippets/page_text.html' with page=readthrough.progress total_pages=book.pages %}
|
||||
{% else %}
|
||||
{{ readthrough.progress }}%
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if readthrough.progress %}
|
||||
@ -47,6 +48,7 @@
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if readthrough.start_date %}
|
||||
<li>{{ readthrough.start_date | localtime | naturalday }}: {% trans "started" %}</li>
|
||||
{% endif %}
|
||||
@ -60,7 +62,11 @@
|
||||
</div>
|
||||
<div class="control">
|
||||
{% trans "Delete these read dates" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with class="is-small" text=button_text icon="x" controls_text="delete_readthrough" controls_uid=readthrough.id focus="modal_title_delete_readthrough" %}
|
||||
<button class="button is-small" type="button" data-modal-open="delete_readthrough_{{ readthrough.id }}">
|
||||
<span class="icon icon-x" title="{{ button_text }}">
|
||||
<span class="is-sr-only">{{ button_text }}</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -79,4 +85,5 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% include 'snippets/delete_readthrough_modal.html' with controls_text="delete_readthrough" controls_uid=readthrough.id no_body=True %}
|
||||
{% join "delete_readthrough" readthrough.id as modal_id %}
|
||||
{% include 'book/delete_readthrough_modal.html' with id=modal_id %}
|
||||
|
@ -19,12 +19,8 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-footer %}
|
||||
<button class="button is-primary" type="submit">
|
||||
<span>{% trans "Confirm" %}</span>
|
||||
</button>
|
||||
|
||||
{% trans "Cancel" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text=button_text %}
|
||||
<button class="button is-primary" type="submit">{% trans "Confirm" %}</button>
|
||||
<button type="button" class="button" data-modal-close>{% trans "Cancel" %}</button>
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-form-close %}</form>{% endblock %}
|
||||
|
@ -7,6 +7,7 @@
|
||||
class="
|
||||
dropdown control
|
||||
{% if right %}is-right{% endif %}
|
||||
has-text-left
|
||||
"
|
||||
>
|
||||
<summary
|
||||
@ -15,7 +16,7 @@
|
||||
{% block dropdown-trigger %}{% endblock %}
|
||||
</summary>
|
||||
|
||||
<div class="dropdown-menu control">
|
||||
<div class="dropdown-menu">
|
||||
<ul
|
||||
id="menu_options_{{ uuid }}"
|
||||
class="dropdown-content p-0 is-clipped"
|
||||
|
@ -1,40 +1,33 @@
|
||||
{% load i18n %}
|
||||
<div
|
||||
role="dialog"
|
||||
class="modal {% if active %}is-active{% else %}is-hidden{% endif %}"
|
||||
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>
|
||||
{% trans "Close" as label %}
|
||||
<div class="modal-card">
|
||||
<header class="modal-card-head" tabindex="0" id="modal_title_{{ controls_text }}_{{ controls_uid }}">
|
||||
<h2 class="modal-card-title is-flex-shrink-1" id="modal_card_title_{{ controls_text }}_{{ controls_uid }}">
|
||||
|
||||
<div class="modal {% if active %}is-active{% endif %}" id="{{ id }}">
|
||||
<div class="modal-background" data-modal-close></div>
|
||||
<div class="modal-card" role="dialog" aria-modal="true" tabindex="-1" aria-described-by="{{ id }}_header">
|
||||
<header class="modal-card-head">
|
||||
<h2 class="modal-card-title mb-0" id="{{ id }}_header">
|
||||
{% block modal-title %}{% endblock %}
|
||||
</h2>
|
||||
{% if static %}
|
||||
<a href="/" class="delete">{{ label }}</a>
|
||||
{% else %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with label=label class="delete" nonbutton=True %}
|
||||
{% endif %}
|
||||
<button
|
||||
type="button"
|
||||
class="delete"
|
||||
aria-label="{% trans 'Close' %}"
|
||||
data-modal-close
|
||||
></button>
|
||||
</header>
|
||||
|
||||
{% block modal-form-open %}{% endblock %}
|
||||
{% if not no_body %}
|
||||
<section class="modal-card-body">
|
||||
{% block modal-body %}{% endblock %}
|
||||
</section>
|
||||
{% endif %}
|
||||
<footer class="modal-card-foot">
|
||||
{% block modal-footer %}{% endblock %}
|
||||
</footer>
|
||||
{% block modal-form-close %}{% endblock %}
|
||||
</div>
|
||||
{% if static %}
|
||||
<a href="/" class="modal-close is-large">{{ label }}</a>
|
||||
{% else %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with label=label class="modal-close is-large" nonbutton=True %}
|
||||
{% endif %}
|
||||
<button
|
||||
type="button"
|
||||
class="modal-close is-large"
|
||||
aria-label="{% trans 'Close' %}"
|
||||
data-modal-close
|
||||
></button>
|
||||
</div>
|
||||
|
||||
|
@ -3,10 +3,12 @@
|
||||
|
||||
{% block filter %}
|
||||
<label class="label" for="id_sort">{% trans "Order by" %}</label>
|
||||
<div class="select">
|
||||
<select name="sort" id="id_sort">
|
||||
<option value="recent" {% if request.GET.sort == "recent" %}selected{% endif %}>{% trans "Recently active" %}</option>
|
||||
<option value="suggested" {% if request.GET.sort == "suggested" %}selected{% endif %}>{% trans "Suggested" %}</option>
|
||||
</select>
|
||||
<div class="control">
|
||||
<div class="select">
|
||||
<select name="sort" id="id_sort">
|
||||
<option value="recent" {% if request.GET.sort == "recent" %}selected{% endif %}>{% trans "Recently active" %}</option>
|
||||
<option value="suggested" {% if request.GET.sort == "suggested" %}selected{% endif %}>{% trans "Suggested" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -6,57 +6,22 @@
|
||||
<h1 class="title">
|
||||
{{ tab.name }}
|
||||
</h1>
|
||||
<div class="block is-clipped">
|
||||
<div class="is-pulled-left">
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
{% for stream in streams %}
|
||||
<li class="{% if tab.key == stream.key %}is-active{% endif %}"{% if tab.key == stream.key %} aria-current="page"{% endif %}>
|
||||
<a href="/{{ stream.key }}#feed">{{ stream.shortname }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# feed settings #}
|
||||
<details class="detail-pinned-button" {% if settings_saved %}open{% endif %}>
|
||||
<summary class="control">
|
||||
<span class="button">
|
||||
<span class="icon icon-dots-three m-0-mobile" aria-hidden="true"></span>
|
||||
<span class="is-sr-only-mobile">{{ _("Feed settings") }}</span>
|
||||
</span>
|
||||
</summary>
|
||||
<form class="notification level is-align-items-flex-end" method="post" action="/{{ tab.key }}#feed">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="level-left">
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<span class="is-flex is-align-items-baseline">
|
||||
<label class="label mt-2 mb-1">Status types</label>
|
||||
{% if settings_saved %}
|
||||
<span class="tag is-success is-light ml-2">{{ _("Saved!") }}</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
{% for name, value in feed_status_types_options %}
|
||||
<label class="mr-2">
|
||||
<input type="checkbox" name="feed_status_types" value="{{ name }}" {% if name in user.feed_status_types %}checked=""{% endif %}/>
|
||||
{{ value }}
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="level-right control">
|
||||
<button class="button is-small is-primary is-outlined" type="submit">
|
||||
{{ _("Save settings") }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</details>
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
{% for stream in streams %}
|
||||
<li class="{% if tab.key == stream.key %}is-active{% endif %}"{% if tab.key == stream.key %} aria-current="page"{% endif %}>
|
||||
<a href="/{{ stream.key }}#feed">{{ stream.shortname }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{# feed settings #}
|
||||
{% with "/"|add:tab.key|add:"#feed" as action %}
|
||||
{% include 'feed/feed_filters.html' with size="small" method="post" action=action %}
|
||||
{% endwith %}
|
||||
|
||||
{# announcements and system messages #}
|
||||
{% if not activities.number > 1 %}
|
||||
<a href="{{ request.path }}" class="transition-y is-hidden notification is-primary is-block" data-poll-wrapper>
|
||||
@ -64,14 +29,20 @@
|
||||
{{ allowed_status_types|json_script:"unread-notifications-wrapper" }}
|
||||
</a>
|
||||
|
||||
{% if request.user.show_goal and not goal and tab.key == 'home' %}
|
||||
{% now 'Y' as year %}
|
||||
<section class="block">
|
||||
{% include 'feed/goal_card.html' with year=year %}
|
||||
<hr>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% if request.user.show_goal and not goal and tab.key == 'home' %}
|
||||
{% now 'Y' as year %}
|
||||
<section class="block">
|
||||
{% include 'feed/goal_card.html' with year=year %}
|
||||
<hr>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% if annual_summary_year and tab.key == 'home' %}
|
||||
<section class="block is-hidden" data-hide="hide_annual_summary_{{ annual_summary_year }}">
|
||||
{% include 'feed/summary_card.html' with year=annual_summary_year %}
|
||||
<hr>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{# activity feed #}
|
||||
|
5
bookwyrm/templates/feed/feed_filters.html
Normal file
5
bookwyrm/templates/feed/feed_filters.html
Normal file
@ -0,0 +1,5 @@
|
||||
{% extends 'snippets/filters_panel/filters_panel.html' %}
|
||||
|
||||
{% block filter_fields %}
|
||||
{% include 'feed/status_types_filter.html' %}
|
||||
{% endblock %}
|
@ -8,82 +8,7 @@
|
||||
<div class="columns">
|
||||
{% if user.is_authenticated %}
|
||||
<div class="column is-one-third">
|
||||
<section class="block">
|
||||
<h2 class="title is-4">{% trans "Your Books" %}</h2>
|
||||
{% if not suggested_books %}
|
||||
<p>{% trans "There are no books here right now! Try searching for a book to get started" %}</p>
|
||||
{% else %}
|
||||
{% with active_book=request.GET.book %}
|
||||
<div class="tab-group">
|
||||
<div class="tabs is-small">
|
||||
<ul role="tablist">
|
||||
{% for shelf in suggested_books %}
|
||||
{% if shelf.books %}
|
||||
{% with shelf_counter=forloop.counter %}
|
||||
<li>
|
||||
<p>
|
||||
{% if shelf.identifier == 'to-read' %}{% trans "To Read" %}
|
||||
{% elif shelf.identifier == 'reading' %}{% trans "Currently Reading" %}
|
||||
{% elif shelf.identifier == 'read' %}{% trans "Read" %}
|
||||
{% else %}{{ shelf.name }}{% endif %}
|
||||
</p>
|
||||
<div class="tabs is-small is-toggle">
|
||||
<ul>
|
||||
{% for book in shelf.books %}
|
||||
<li class="{% if active_book == book.id|stringformat:'d' %}is-active{% elif not active_book and shelf_counter == 1 and forloop.first %}is-active{% endif %}">
|
||||
<a
|
||||
href="{{ request.path }}?book={{ book.id }}"
|
||||
id="tab_book_{{ book.id }}"
|
||||
role="tab"
|
||||
aria-label="{{ book.title }}"
|
||||
aria-selected="{% if active_book == book.id|stringformat:'d' %}true{% elif shelf_counter == 1 and forloop.first %}true{% else %}false{% endif %}"
|
||||
aria-controls="book_{{ book.id }}">
|
||||
{% include 'snippets/book_cover.html' with book=book cover_class='is-h-m' %}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% for shelf in suggested_books %}
|
||||
{% with shelf_counter=forloop.counter %}
|
||||
{% for book in shelf.books %}
|
||||
<div
|
||||
class="suggested-tabs card"
|
||||
role="tabpanel"
|
||||
id="book_{{ book.id }}"
|
||||
{% if active_book and active_book == book.id|stringformat:'d' %}{% elif not active_book and shelf_counter == 1 and forloop.first %}{% else %} hidden{% endif %}
|
||||
aria-labelledby="tab_book_{{ book.id }}">
|
||||
|
||||
<div class="card-header">
|
||||
<div class="card-header-title">
|
||||
<div>
|
||||
<p class="mb-2">{% include 'snippets/book_titleby.html' with book=book %}</p>
|
||||
{% include 'snippets/shelve_button/shelve_button.html' with book=book %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-header-icon is-hidden-tablet">
|
||||
{% trans "Close" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with label=button_text controls_text="book" controls_uid=book.id class="delete" nonbutton=True pressed=True %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
{% include 'snippets/create_status.html' with book=book %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
{% include "feed/suggested_books.html" %}
|
||||
{% if goal %}
|
||||
<section class="block">
|
||||
<div class="block">
|
||||
|
@ -31,7 +31,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<div class="is-main block" id="anchor-{{ status.id }}">
|
||||
<div class="is-main block">
|
||||
{% include 'snippets/status/status.html' with status=status main=True %}
|
||||
</div>
|
||||
|
||||
|
16
bookwyrm/templates/feed/status_types_filter.html
Normal file
16
bookwyrm/templates/feed/status_types_filter.html
Normal file
@ -0,0 +1,16 @@
|
||||
{% extends 'snippets/filters_panel/filter_field.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block filter %}
|
||||
<label class="label mt-2 mb-1">Status types</label>
|
||||
|
||||
<div class="is-flex is-flex-direction-row is-flex-direction-column-mobile">
|
||||
{% for name, value in feed_status_types_options %}
|
||||
<label class="mr-2">
|
||||
<input type="checkbox" name="feed_status_types" value="{{ name }}" {% if name in user.feed_status_types %}checked=""{% endif %}/>
|
||||
{{ value }}
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
79
bookwyrm/templates/feed/suggested_books.html
Normal file
79
bookwyrm/templates/feed/suggested_books.html
Normal file
@ -0,0 +1,79 @@
|
||||
{% load i18n %}
|
||||
{% load bookwyrm_tags %}
|
||||
|
||||
{% suggested_books as suggested_books %}
|
||||
<section class="block">
|
||||
<h2 class="title is-4">{% trans "Your Books" %}</h2>
|
||||
{% if not suggested_books %}
|
||||
<p>{% trans "There are no books here right now! Try searching for a book to get started" %}</p>
|
||||
{% else %}
|
||||
{% with active_book=request.GET.book %}
|
||||
<div class="tab-group">
|
||||
<div class="tabs is-small">
|
||||
<ul role="tablist">
|
||||
{% for shelf in suggested_books %}
|
||||
{% if shelf.books %}
|
||||
{% with shelf_counter=forloop.counter %}
|
||||
<li>
|
||||
<p>
|
||||
{% if shelf.identifier == 'to-read' %}{% trans "To Read" %}
|
||||
{% elif shelf.identifier == 'reading' %}{% trans "Currently Reading" %}
|
||||
{% elif shelf.identifier == 'read' %}{% trans "Read" %}
|
||||
{% else %}{{ shelf.name }}{% endif %}
|
||||
</p>
|
||||
<div class="tabs is-small is-toggle">
|
||||
<ul>
|
||||
{% for book in shelf.books %}
|
||||
<li class="{% if active_book == book.id|stringformat:'d' %}is-active{% elif not active_book and shelf_counter == 1 and forloop.first %}is-active{% endif %}">
|
||||
<a
|
||||
href="{{ request.path }}?book={{ book.id }}"
|
||||
id="tab_book_{{ book.id }}"
|
||||
role="tab"
|
||||
aria-label="{{ book.title }}"
|
||||
aria-selected="{% if active_book == book.id|stringformat:'d' %}true{% elif shelf_counter == 1 and forloop.first %}true{% else %}false{% endif %}"
|
||||
aria-controls="book_{{ book.id }}">
|
||||
{% include 'snippets/book_cover.html' with book=book cover_class='is-h-m' %}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% for shelf in suggested_books %}
|
||||
{% with shelf_counter=forloop.counter %}
|
||||
{% for book in shelf.books %}
|
||||
<div
|
||||
class="suggested-tabs card"
|
||||
role="tabpanel"
|
||||
id="book_{{ book.id }}"
|
||||
{% if active_book and active_book == book.id|stringformat:'d' %}{% elif not active_book and shelf_counter == 1 and forloop.first %}{% else %} hidden{% endif %}
|
||||
aria-labelledby="tab_book_{{ book.id }}">
|
||||
|
||||
<div class="card-header">
|
||||
<div class="card-header-title">
|
||||
<div>
|
||||
<p class="mb-2">{% include 'snippets/book_titleby.html' with book=book %}</p>
|
||||
{% include 'snippets/shelve_button/shelve_button.html' with book=book %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-header-icon is-hidden-tablet">
|
||||
{% trans "Close" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with label=button_text controls_text="book" controls_uid=book.id class="delete" nonbutton=True pressed=True %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
{% include 'snippets/create_status.html' with book=book %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</section>
|
31
bookwyrm/templates/feed/summary_card.html
Normal file
31
bookwyrm/templates/feed/summary_card.html
Normal file
@ -0,0 +1,31 @@
|
||||
{% load i18n %}
|
||||
|
||||
<article class="card">
|
||||
<header class="card-header has-background-success-dark">
|
||||
<h3 class="card-header-title has-text-white">
|
||||
<span class="icon is-size-3 mr-2" aria-hidden="true">📚</span>
|
||||
<span class="icon is-size-3 mr-2" aria-hidden="true">✨</span>
|
||||
{% blocktrans %}{{ year }} in the books{% endblocktrans %}
|
||||
</h3>
|
||||
|
||||
<div class="card-header-icon has-text-white">
|
||||
{% trans "Dismiss message" as button_text %}
|
||||
<button class="delete set-display" type="button" data-id="hide_annual_summary_{{ year }}" data-value="true">
|
||||
<span>{% trans "Dismiss message" %}</span>
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section class="card-content">
|
||||
<p class="mb-3">
|
||||
{% blocktrans %}The end of the year is the best moment to take stock of all the books read during the last 12 months. How many pages have you read? Which book is your best-rated of the year? We compiled these stats, and more!{% endblocktrans %}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="{% url 'annual-summary' request.user.localname year %}" class="button is-success has-background-success-dark">
|
||||
{% blocktrans %}Discover your stats for {{ year }}!{% endblocktrans %}
|
||||
</a>
|
||||
</p>
|
||||
</section>
|
||||
|
||||
</article>
|
@ -10,7 +10,12 @@
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card is-fullwidth">
|
||||
<header class="modal-card-head">
|
||||
<img class="image logo mr-2" src="{% if site.logo_small %}{% get_media_prefix %}{{ site.logo_small }}{% else %}{% static "images/logo-small.png" %}{% endif %}" aria-hidden="true">
|
||||
<img
|
||||
class="image logo mr-2"
|
||||
src="{% if site.logo_small %}{% get_media_prefix %}{{ site.logo_small }}{% else %}{% static "images/logo-small.png" %}{% endif %}"
|
||||
aria-hidden="true"
|
||||
alt="{{ site.name }}"
|
||||
>
|
||||
<h1 class="modal-card-title" id="get_started_header">
|
||||
{% blocktrans %}Welcome to {{ site_name }}!{% endblocktrans %}
|
||||
<span class="subtitle is-block">
|
||||
|
@ -13,13 +13,26 @@
|
||||
<div class="column is-two-thirds">
|
||||
<div class="block">
|
||||
<label class="label" for="id_name">{% trans "Display name:" %}</label>
|
||||
<input type="text" name="name" maxlength="100" class="input" id="id_name" placeholder="{{ user.localname }}" value="{% if request.user.name %}{{ request.user.name }}{% endif %}">
|
||||
<input
|
||||
type="text"
|
||||
name="name"
|
||||
maxlength="100"
|
||||
class="input"
|
||||
id="id_name"
|
||||
placeholder="{{ user.localname }}"
|
||||
value="{% if request.user.name %}{{ request.user.name }}{% endif %}"
|
||||
>
|
||||
|
||||
{% include 'snippets/form_errors.html' with errors_list=form.name.errors id="desc_name" %}
|
||||
</div>
|
||||
<div class="block">
|
||||
<label class="label" for="id_summary">{% trans "Summary:" %}</label>
|
||||
<textarea name="summary" cols="None" rows="None" class="textarea" id="id_summary" placeholder="{% trans 'A little bit about you' %}">{% if request.user.summary %}{{ request.user.summary }}{% endif %}</textarea>
|
||||
<textarea
|
||||
name="summary"
|
||||
class="textarea"
|
||||
id="id_summary"
|
||||
placeholder="{% trans 'A little bit about you' %}"
|
||||
>{% if request.user.summary %}{{ request.user.summary }}{% endif %}</textarea>
|
||||
|
||||
{% include 'snippets/form_errors.html' with errors_list=form.summary.errors id="desc_summary" %}
|
||||
</div>
|
||||
|
@ -14,8 +14,7 @@
|
||||
<button class="button is-danger" type="submit">
|
||||
{% trans "Delete" %}
|
||||
</button>
|
||||
{% trans "Cancel" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text=button_text controls_text="delete_group" controls_uid=group.id %}
|
||||
<button type="button" class="button" data-modal-close>{% trans "Cancel" %}</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
@ -9,5 +9,5 @@
|
||||
<form name="edit-group" method="post" action="{% url 'group' group.id %}">
|
||||
{% include 'groups/form.html' %}
|
||||
</form>
|
||||
{% include "groups/delete_group_modal.html" with controls_text="delete_group" controls_uid=group.id %}
|
||||
{% include "groups/delete_group_modal.html" with id="delete_group" %}
|
||||
{% endblock %}
|
||||
|
@ -2,8 +2,5 @@
|
||||
{% load i18n %}
|
||||
|
||||
{% block searchresults %}
|
||||
<h2 class="title is-5">
|
||||
{% trans "Add new members!" %}
|
||||
</h2>
|
||||
{% include 'groups/suggested_users.html' with suggested_users=suggested_users %}
|
||||
{% endblock %}
|
||||
|
@ -5,30 +5,29 @@
|
||||
<div class="column is-two-thirds">
|
||||
<input type="hidden" name="user" value="{{ request.user.id }}" />
|
||||
<div class="field">
|
||||
<label class="label" for="id_name">{% trans "Group Name:" %}</label>
|
||||
<label class="label" for="group_form_id_name">{% trans "Group Name:" %}</label>
|
||||
{{ group_form.name }}
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="label" for="id_description">{% trans "Group Description:" %}</label>
|
||||
<label class="label" for="group_form_id_description">{% trans "Group Description:" %}</label>
|
||||
{{ group_form.description }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="columns is-mobile">
|
||||
<div class="column">
|
||||
<div class="field has-addons">
|
||||
<div class="control">
|
||||
{% include 'snippets/privacy_select_no_followers.html' with current=group.privacy %}
|
||||
</div>
|
||||
<div class="control">
|
||||
<button type="submit" class="button is-primary">{% trans "Save" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="is-flex">
|
||||
{% if group.id %}
|
||||
<div class="column is-narrow">
|
||||
{% trans "Delete group" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with class="is-danger" text=button_text icon_with_text="x" controls_text="delete_group" controls_uid=group.id focus="modal_title_delete_group" %}
|
||||
<div class="is-flex-grow-1">
|
||||
<button type="button" data-modal-open="delete_group" class="button is-danger">
|
||||
{% trans "Delete group" %}
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="field has-addons">
|
||||
<div class="control">
|
||||
{% include 'snippets/privacy_select_no_followers.html' with current=group.privacy %}
|
||||
</div>
|
||||
<div class="control">
|
||||
<button type="submit" class="button is-primary">{% trans "Save" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,37 +1,41 @@
|
||||
{% extends 'groups/layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load bookwyrm_tags %}
|
||||
{% load bookwyrm_group_tags %}
|
||||
{% load markdown %}
|
||||
|
||||
{% block panel %}
|
||||
|
||||
<div class="columns mt-3">
|
||||
<section class="column is-three-quarters">
|
||||
|
||||
{% if group.user == request.user %}
|
||||
<div class="block">
|
||||
<form class="field has-addons" method="get" action="{% url 'group-find-users' group.id %}">
|
||||
<div class="control">
|
||||
<input type="text" name="user_query" value="{{ request.GET.user_query }}" class="input" placeholder="{% trans 'Search to add a user' %}" aria-label="{% trans 'Search to add a user' %}">
|
||||
</div>
|
||||
<div class="control">
|
||||
<button class="button" type="submit">
|
||||
<span class="icon icon-search" title="{% trans 'Search' %}">
|
||||
<span class="is-sr-only">{% trans "Search" %}</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% block searchresults %}
|
||||
{% endblock %}
|
||||
<div class="mb-2">
|
||||
{% include "groups/members.html" with group=group %}
|
||||
</div>
|
||||
|
||||
<h2 class="title is-5">Lists</h2>
|
||||
</section>
|
||||
</div>
|
||||
<header class="columns content is-mobile">
|
||||
<div class="column">
|
||||
<h2 class="title is-5">{% trans "Lists" %}</h2>
|
||||
<p class="subtitle is-6">
|
||||
{% trans "Members of this group can create group-curated lists." %}
|
||||
</p>
|
||||
</div>
|
||||
{% if request.user.is_authenticated and group|is_member:request.user %}
|
||||
<div class="column is-narrow is-flex">
|
||||
{% trans "Create List" as button_text %}
|
||||
{% include 'snippets/toggle/open_button.html' with controls_text="create_list" icon_with_text="plus" text=button_text focus="create_list_header" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</header>
|
||||
{% if request.user.is_authenticated and group|is_member:request.user %}
|
||||
<div class="block">
|
||||
{% include 'lists/create_form.html' with controls_text="create_list" curation_group=group %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="columns mt-3">
|
||||
<section class="column is-three-quarters">
|
||||
{% if not lists %}
|
||||
<p>{% trans "This group has no lists" %}</p>
|
||||
{% else %}
|
||||
@ -45,19 +49,17 @@
|
||||
<a href="{{ list.local_path }}">{{ list.name }}</a> <span class="subtitle">{% include 'snippets/privacy-icons.html' with item=list %}</span>
|
||||
</h4>
|
||||
</header>
|
||||
|
||||
{% with list_books=list.listitem_set.all|slice:5 %}
|
||||
{% if list_books %}
|
||||
<div class="card-image columns is-mobile is-gapless is-clipped">
|
||||
{% for book in list_books %}
|
||||
<a class="column is-cover" href="{{ book.book.local_path }}">
|
||||
{% include 'snippets/book_cover.html' with book=book.book cover_class='is-h-s' size='small' aria='show' %}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if list_books %}
|
||||
<div class="card-image columns is-mobile is-gapless is-clipped">
|
||||
{% for book in list_books %}
|
||||
<a class="column is-cover" href="{{ book.book.local_path }}">
|
||||
{% include 'snippets/book_cover.html' with book=book.book cover_class='is-h-s' size='small' aria='show' %}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<div class="card-content is-flex-grow-0">
|
||||
<div class="is-clipped" {% if list.description %}title="{{ list.description }}"{% endif %}>
|
||||
{% if list.description %}
|
||||
@ -74,9 +76,8 @@
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
{% include "snippets/pagination.html" with page=items %}
|
||||
</section>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
@ -1,5 +1,6 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load bookwyrm_group_tags %}
|
||||
|
||||
{% block title %}{{ group.name }}{% endblock %}
|
||||
|
||||
@ -11,12 +12,12 @@
|
||||
{% include 'groups/created_text.html' with group=group %}
|
||||
</p>
|
||||
</div>
|
||||
{% if request.user == group.user %}
|
||||
<div class="column is-narrow is-flex">
|
||||
{% if request.user == group.user %}
|
||||
{% trans "Edit group" as button_text %}
|
||||
{% include 'snippets/toggle/open_button.html' with text=button_text icon_with_text="pencil" controls_text="edit_group" focus="edit_group_header" %}
|
||||
{% endif %}
|
||||
{% trans "Edit group" as button_text %}
|
||||
{% include 'snippets/toggle/open_button.html' with text=button_text icon_with_text="pencil" controls_text="edit_group" focus="edit_group_header" %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</header>
|
||||
|
||||
<div class="block content">
|
||||
|
@ -5,8 +5,22 @@
|
||||
{% load bookwyrm_group_tags %}
|
||||
|
||||
<h2 class="title is-5">Group Members</h2>
|
||||
<p class="subtitle is-6">{% trans "Members can add and remove books on a group's book lists" %}</p>
|
||||
|
||||
{% if group.user == request.user %}
|
||||
<div class="block">
|
||||
<form class="field has-addons" method="get" action="{% url 'group-find-users' group.id %}">
|
||||
<div class="control">
|
||||
<input type="text" name="user_query" value="{{ request.GET.user_query }}" class="input" placeholder="{% trans 'Search to add a user' %}" aria-label="{% trans 'Search to add a user' %}">
|
||||
</div>
|
||||
<div class="control">
|
||||
<button class="button" type="submit">
|
||||
<span class="icon icon-search" title="{% trans 'Search' %}">
|
||||
<span class="is-sr-only">{% trans "Search" %}</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if group.user != request.user and group|is_member:request.user %}
|
||||
<form action="{% url 'remove-group-member' %}" method="POST" class="my-4">
|
||||
{% csrf_token %}
|
||||
|
@ -3,6 +3,9 @@
|
||||
{% load humanize %}
|
||||
|
||||
{% if suggested_users %}
|
||||
<h2 class="title is-5">
|
||||
{% trans "Add new members!" %}
|
||||
</h2>
|
||||
<div class="column is-flex is-flex-grow-0">
|
||||
{% for user in suggested_users %}
|
||||
<div class="box has-text-centered is-shadowless has-background-white-bis m-2">
|
||||
|
@ -234,7 +234,3 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endspaceless %}{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script src="{% static "js/check_all.js" %}?v={{ js_cache }}"></script>
|
||||
{% endblock %}
|
||||
|
@ -1,37 +0,0 @@
|
||||
{% extends 'landing/layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block panel %}
|
||||
<div class="block columns mt-4">
|
||||
<nav class="menu column is-one-quarter">
|
||||
<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>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#privacy">{% trans "Privacy Policy" %}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="column content">
|
||||
<div class="block" id="coc">
|
||||
<h2 class="title">{% trans "Code of Conduct" %}</h2>
|
||||
<div class="content">
|
||||
{{ site.code_of_conduct | safe }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr aria-hidden="true">
|
||||
|
||||
<div class="block" id="privacy">
|
||||
<h2 class="title">{% trans "Privacy Policy" %}</h2>
|
||||
<div class="content">
|
||||
{{ site.privacy_policy | safe }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
@ -1,11 +1,13 @@
|
||||
{% extends 'landing/layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load cache %}
|
||||
{% block panel %}
|
||||
|
||||
<div class="block is-hidden-tablet">
|
||||
<h2 class="title has-text-centered">{% trans "Recent Books" %}</h2>
|
||||
</div>
|
||||
|
||||
{% cache 60 * 60 %}
|
||||
<section class="tile is-ancestor">
|
||||
<div class="tile is-vertical is-6">
|
||||
<div class="tile is-parent">
|
||||
@ -46,5 +48,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{% endcache %}
|
||||
{% endblock %}
|
||||
|
@ -31,6 +31,7 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{% block about_panel %}
|
||||
<section class="tile is-ancestor">
|
||||
<div class="tile is-7 is-parent">
|
||||
<div class="tile is-child box">
|
||||
@ -89,6 +90,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block panel %}{% endblock %}
|
||||
|
||||
|
@ -28,6 +28,8 @@
|
||||
{% include 'snippets/opengraph_images.html' %}
|
||||
{% endblock %}
|
||||
<meta name="twitter:image:alt" content="BookWyrm Logo">
|
||||
|
||||
{% block head_links %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar" aria-label="main navigation">
|
||||
@ -36,7 +38,7 @@
|
||||
<a class="navbar-item" href="/">
|
||||
<img class="image logo" src="{% if site.logo_small %}{% get_media_prefix %}{{ site.logo_small }}{% else %}{% static "images/logo-small.png" %}{% endif %}" alt="{% blocktrans with site_name=site.name %}{{ site_name }} home page{% endblocktrans %}">
|
||||
</a>
|
||||
<form class="navbar-item column" action="{% url 'search' %}">
|
||||
<form class="navbar-item column is-align-items-start pt-5" action="{% url 'search' %}">
|
||||
<div class="field has-addons">
|
||||
<div class="control">
|
||||
{% if user.is_authenticated %}
|
||||
@ -56,25 +58,22 @@
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div role="button" tabindex="0" class="navbar-burger pulldown-menu" data-controls="main_nav" aria-expanded="false">
|
||||
<div class="navbar-item mt-3">
|
||||
<div class="icon icon-dots-three-vertical" title="{% trans 'Main navigation menu' %}">
|
||||
<span class="is-sr-only">{% trans "Main navigation menu" %}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" tabindex="0" class="navbar-burger pulldown-menu my-4" data-controls="main_nav" aria-expanded="false">
|
||||
<i class="icon icon-dots-three-vertical" aria-hidden="true"></i>
|
||||
<span class="is-sr-only">{% trans "Main navigation menu" %}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="navbar-menu" id="main_nav">
|
||||
<div class="navbar-start">
|
||||
{% if request.user.is_authenticated %}
|
||||
<a href="/#feed" class="navbar-item">
|
||||
<a href="/#feed" class="navbar-item mt-3 py-0">
|
||||
{% trans "Feed" %}
|
||||
</a>
|
||||
<a href="{% url 'lists' %}" class="navbar-item">
|
||||
<a href="{% url 'lists' %}" class="navbar-item mt-3 py-0">
|
||||
{% trans "Lists" %}
|
||||
</a>
|
||||
<a href="{% url 'discover' %}" class="navbar-item">
|
||||
<a href="{% url 'discover' %}" class="navbar-item mt-3 py-0">
|
||||
{% trans "Discover" %}
|
||||
</a>
|
||||
{% endif %}
|
||||
@ -82,7 +81,7 @@
|
||||
|
||||
<div class="navbar-end">
|
||||
{% if request.user.is_authenticated %}
|
||||
<div class="navbar-item has-dropdown is-hoverable">
|
||||
<div class="navbar-item mt-3 py-0 has-dropdown is-hoverable">
|
||||
<a
|
||||
href="{{ request.user.local_path }}"
|
||||
class="navbar-link pulldown-menu"
|
||||
@ -141,7 +140,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="navbar-item">
|
||||
<div class="navbar-item mt-3 py-0">
|
||||
<a href="{% url 'notifications' %}" class="tags has-addons">
|
||||
<span class="tag is-medium">
|
||||
<span class="icon icon-bell" title="{% trans 'Notifications' %}">
|
||||
@ -159,7 +158,7 @@
|
||||
</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="navbar-item">
|
||||
<div class="navbar-item pt-5 pb-0">
|
||||
{% if request.path != '/login' and request.path != '/login/' %}
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
|
@ -7,6 +7,6 @@
|
||||
|
||||
{% block form %}
|
||||
<form name="create-list" method="post" action="{% url 'lists' %}">
|
||||
{% include 'lists/form.html' %}
|
||||
{% include 'lists/form.html' with curation_group=group %}
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
@ -1,72 +1,74 @@
|
||||
{% extends 'lists/layout.html' %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<nav class="breadcrumb subtitle" aria-label="breadcrumbs">
|
||||
<ul>
|
||||
<li><a href="{% url 'lists' %}">{% trans "Lists" %}</a></li>
|
||||
<li><a href="{% url 'list' list.id %}">{{ list.name|truncatechars:30 }}</a></li>
|
||||
<li class="is-active">
|
||||
<a href="#" aria-current="page">
|
||||
{% trans "Curate" %}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
|
||||
{% block panel %}
|
||||
|
||||
<section class="block">
|
||||
<div class="columns is-mobile is-multiline is-align-items-baseline">
|
||||
<div class="column is-narrow">
|
||||
<h2 class="title is-4">{% trans "Pending Books" %}</h2>
|
||||
</div>
|
||||
|
||||
<p class="column is-narrow"><a href="{% url 'list' list.id %}">{% trans "Go to list" %}</a></p>
|
||||
</div>
|
||||
<h2 class="title is-4">{% trans "Pending Books" %}</h2>
|
||||
|
||||
{% if not pending.exists %}
|
||||
<p>{% trans "You're all set!" %}</p>
|
||||
<p><em>{% trans "You're all set!" %}</em></p>
|
||||
{% else %}
|
||||
|
||||
<dl>
|
||||
<div class="columns">
|
||||
{% for item in pending %}
|
||||
{% with book=item.book %}
|
||||
<div
|
||||
class="
|
||||
columns is-gapless
|
||||
is-vcentered is-justify-content-space-between
|
||||
mb-6
|
||||
"
|
||||
>
|
||||
<dt class="column mr-auto">
|
||||
<div class="columns is-mobile is-gapless is-vcentered">
|
||||
<a
|
||||
class="column is-cover"
|
||||
href="{{ book.local_path }}"
|
||||
aria-hidden="true"
|
||||
>
|
||||
{% include 'snippets/book_cover.html' with cover_class='is-w-xs-mobile is-w-s is-h-xs-mobile is-h-s' size_mobile='xsmall' size='small' %}
|
||||
{% with book=item.book %}
|
||||
<div class="column">
|
||||
<div class="columns is-mobile">
|
||||
<a
|
||||
class="column is-cover"
|
||||
href="{{ book.local_path }}"
|
||||
aria-hidden="true"
|
||||
>
|
||||
{% include 'snippets/book_cover.html' with cover_class='is-w-xs-mobile is-w-s is-h-xs-mobile is-h-s' size_mobile='xsmall' size='small' %}
|
||||
</a>
|
||||
|
||||
<div class="column ml-3">
|
||||
{% include 'snippets/book_titleby.html' %}
|
||||
|
||||
<p>
|
||||
{% trans "Suggested by" %}
|
||||
|
||||
<a href="{{ item.user.local_path }}">
|
||||
{{ item.user.display_name }}
|
||||
</a>
|
||||
|
||||
<div class="column ml-3">
|
||||
{% include 'snippets/book_titleby.html' %}
|
||||
</div>
|
||||
</div>
|
||||
</dt>
|
||||
|
||||
<dd class="column is-4-tablet mx-3-tablet my-3-mobile">
|
||||
{% trans "Suggested by" %}
|
||||
|
||||
<a href="{{ item.user.local_path }}">
|
||||
{{ item.user.display_name }}
|
||||
</a>
|
||||
</dd>
|
||||
|
||||
<dd class="column is-narrow field has-addons">
|
||||
<form class="control" method="POST" action="{% url 'list-curate' list.id %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="item" value="{{ item.id }}">
|
||||
<input type="hidden" name="approved" value="true">
|
||||
<button class="button">{% trans "Approve" %}</button>
|
||||
</form>
|
||||
<form class="control" method="POST" action="{% url 'list-curate' list.id %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="item" value="{{ item.id }}">
|
||||
<input type="hidden" name="approved" value="false">
|
||||
<button class="button is-danger is-light">{% trans "Discard" %}</button>
|
||||
</form>
|
||||
</dd>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endwith %}
|
||||
</div>
|
||||
|
||||
<div class="column is-narrow">
|
||||
<div class="field has-addons">
|
||||
<form class="control" method="POST" action="{% url 'list-curate' list.id %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="item" value="{{ item.id }}">
|
||||
<input type="hidden" name="approved" value="true">
|
||||
<button type="submit" class="button">{% trans "Approve" %}</button>
|
||||
</form>
|
||||
<form class="control" method="POST" action="{% url 'list-curate' list.id %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="item" value="{{ item.id }}">
|
||||
<input type="hidden" name="approved" value="false">
|
||||
<button type="submit" class="button is-danger is-light">{% trans "Discard" %}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</dl>
|
||||
</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
@ -14,8 +14,9 @@
|
||||
<button class="button is-danger" type="submit">
|
||||
{% trans "Delete" %}
|
||||
</button>
|
||||
{% trans "Cancel" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with text=button_text controls_text="delete_list" controls_uid=list.id %}
|
||||
<button type="button" class="button" data-modal-close>
|
||||
{% trans "Cancel" %}
|
||||
</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
|
@ -9,5 +9,5 @@
|
||||
<form name="edit-list" method="post" action="{% url 'list' list.id %}">
|
||||
{% include 'lists/form.html' %}
|
||||
</form>
|
||||
{% include "lists/delete_list_modal.html" with controls_text="delete_list" controls_uid=list.id %}
|
||||
{% include "lists/delete_list_modal.html" with id="delete_list" %}
|
||||
{% endblock %}
|
||||
|
@ -18,33 +18,82 @@
|
||||
<fieldset class="field">
|
||||
<legend class="label">{% trans "List curation:" %}</legend>
|
||||
|
||||
<label class="field" data-hides="list_group_selector">
|
||||
<input type="radio" name="curation" value="closed"{% if not list or list.curation == 'closed' %} checked{% endif %}> {% trans "Closed" %}
|
||||
<p class="help mb-2">{% trans "Only you can add and remove books to this list" %}</p>
|
||||
</label>
|
||||
<div class="field" data-hides="list_group_selector">
|
||||
<input
|
||||
type="radio"
|
||||
name="curation"
|
||||
value="closed"
|
||||
aria-described-by="id_curation_closed_help"
|
||||
id="id_curation_closed"
|
||||
{% if not curation_group.exists or not list or list.curation == 'closed' %}checked{% endif %}
|
||||
>
|
||||
<label for="id_curation_closed">
|
||||
{% trans "Closed" %}
|
||||
</label>
|
||||
<p class="help mb-2" id="id_curation_closed_help">
|
||||
{% trans "Only you can add and remove books to this list" %}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<label class="field" data-hides="list_group_selector">
|
||||
<input type="radio" name="curation" value="curated"{% if list.curation == 'curated' %} checked{% endif %}> {% trans "Curated" %}
|
||||
<p class="help mb-2">{% trans "Anyone can suggest books, subject to your approval" %}</p>
|
||||
</label>
|
||||
<div class="field" data-hides="list_group_selector">
|
||||
<input
|
||||
type="radio"
|
||||
name="curation"
|
||||
value="curated"
|
||||
aria-described-by="id_curation_curated_help"
|
||||
id="id_curation_curated"
|
||||
{% if list.curation == 'curated' %} checked{% endif %}
|
||||
>
|
||||
<label for="id_curation_curated">
|
||||
{% trans "Curated" %}
|
||||
</label>
|
||||
<p class="help mb-2" id="id_curation_curated_help">
|
||||
{% trans "Anyone can suggest books, subject to your approval" %}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<label class="field" data-hides="list_group_selector">
|
||||
<input type="radio" name="curation" value="open"{% if list.curation == 'open' %} checked{% endif %}> {% trans "Open" context "curation type" %}
|
||||
<p class="help mb-2">{% trans "Anyone can add books to this list" %}</p>
|
||||
</label>
|
||||
<div class="field" data-hides="list_group_selector">
|
||||
<input
|
||||
type="radio"
|
||||
name="curation"
|
||||
value="open"
|
||||
aria-described-by="id_curation_open_help"
|
||||
id="id_curation_open"
|
||||
{% if list.curation == 'open' %} checked{% endif %}
|
||||
>
|
||||
<label for="id_curation_open">
|
||||
{% trans "Open" context "curation type" %}
|
||||
</label>
|
||||
<p class="help mb-2" id="id_curation_open_help">
|
||||
{% trans "Anyone can add books to this list" %}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<label class="field hidden-form">
|
||||
<input type="radio" name="curation" value="group"{% if list.curation == 'group' %} checked{% endif %} > {% trans "Group" %}
|
||||
<p class="help mb-2">{% trans "Group members can add to and remove from this list" %}</p>
|
||||
<fieldset class="{% if list.curation != 'group' %}is-hidden{% endif %}" id="list_group_selector">
|
||||
<div class="field hidden-form">
|
||||
<input
|
||||
type="radio"
|
||||
name="curation"
|
||||
value="group"
|
||||
aria-described-by="id_curation_group_help"
|
||||
id="id_curation_group"
|
||||
{% if curation_group.id or list.curation == 'group' %}checked{% endif %}
|
||||
>
|
||||
<label for="id_curation_group">
|
||||
{% trans "Group" %}
|
||||
</label>
|
||||
<p class="help mb-2" id="id_curation_group_help">
|
||||
{% trans "Group members can add to and remove from this list" %}
|
||||
</p>
|
||||
|
||||
<fieldset class="{% if list.curation != 'group' and not curation_group %}is-hidden{% endif %}" id="list_group_selector">
|
||||
{% if user.memberships.exists %}
|
||||
<label class="label" for="id_group" id="group">{% trans "Select Group" %}</label>
|
||||
<div class="field has-addons">
|
||||
<div class="select control">
|
||||
<select name="group" id="id_group">
|
||||
<option value="" disabled {% if not list.group %} selected{% endif %}>{% trans "Select a group" %}</option>
|
||||
<option value="" disabled {% if not list.group and not curation_group %} selected{% endif %}>{% trans "Select a group" %}</option>
|
||||
{% for membership in user.memberships.all %}
|
||||
<option value="{{ membership.group.id }}" {% if list.group.id == membership.group.id %} selected{% endif %}>{{ membership.group.name }}</option>
|
||||
<option value="{{ membership.group.id }}" {% if list.group.id == membership.group.id or curation_group.id == membership.group.id %} selected{% endif %}>{{ membership.group.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
@ -61,25 +110,24 @@
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
</fieldset>
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="columns is-mobile">
|
||||
<div class="column">
|
||||
<div class="field has-addons">
|
||||
<div class="control">
|
||||
{% include 'snippets/privacy_select.html' with current=list.privacy %}
|
||||
</div>
|
||||
<div class="control">
|
||||
<button type="submit" class="button is-primary">{% trans "Save" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="is-flex">
|
||||
{% if list.id %}
|
||||
<div class="column is-narrow">
|
||||
{% trans "Delete list" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with class="is-danger" text=button_text icon_with_text="x" controls_text="delete_list" controls_uid=list.id focus="modal_title_delete_list" %}
|
||||
<div class="is-flex-grow-1">
|
||||
<button type="button" data-modal-open="delete_list" class="button is-danger">
|
||||
{% trans "Delete list" %}
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="field has-addons">
|
||||
<div class="control">
|
||||
{% include 'snippets/privacy_select.html' with current=list.privacy %}
|
||||
</div>
|
||||
<div class="control">
|
||||
<button type="submit" class="button is-primary">{% trans "Save" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -11,6 +11,7 @@
|
||||
{% include 'lists/created_text.html' with list=list %}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="column is-narrow is-flex">
|
||||
{% if request.user == list.user %}
|
||||
{% trans "Edit List" as button_text %}
|
||||
@ -20,6 +21,8 @@
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{% block breadcrumbs %}{% endblock %}
|
||||
|
||||
<div class="block content">
|
||||
{% include 'snippets/trimmed_text.html' with full=list.description %}
|
||||
</div>
|
||||
|
@ -4,6 +4,19 @@
|
||||
{% load bookwyrm_group_tags %}
|
||||
{% load markdown %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<nav class="breadcrumb subtitle" aria-label="breadcrumbs">
|
||||
<ul>
|
||||
<li><a href="{% url 'lists' %}">{% trans "Lists" %}</a></li>
|
||||
<li class="is-active">
|
||||
<a href="#" aria-current="page">
|
||||
{{ list.name|truncatechars:30 }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
|
||||
{% block panel %}
|
||||
{% if request.user == list.user and pending_count %}
|
||||
<div class="block content">
|
||||
@ -56,37 +69,48 @@
|
||||
<div>
|
||||
{{ book|book_description|to_markdown|default:""|safe|truncatewords_html:20 }}
|
||||
</div>
|
||||
{% include 'snippets/shelve_button/shelve_button.html' %}
|
||||
{% include 'snippets/shelve_button/shelve_button.html' with book=book %}
|
||||
</div>
|
||||
</div>
|
||||
{% endwith %}
|
||||
|
||||
<div class="card-footer is-stacked-mobile has-background-white-bis is-align-items-stretch">
|
||||
<div class="card-footer-item">
|
||||
<div>
|
||||
<p>{% blocktrans with username=item.user.display_name user_path=item.user.local_path %}Added by <a href="{{ user_path }}">{{ username }}</a>{% endblocktrans %}</p>
|
||||
</div>
|
||||
<p>
|
||||
{% blocktrans trimmed with username=item.user.display_name user_path=item.user.local_path %}
|
||||
Added by <a href="{{ user_path }}">{{ username }}</a>
|
||||
{% endblocktrans %}
|
||||
</p>
|
||||
</div>
|
||||
{% if list.user == request.user or list.group|is_member:request.user %}
|
||||
<div class="card-footer-item">
|
||||
<form name="set-position" method="post" action="{% url 'list-set-book-position' item.id %}">
|
||||
{% csrf_token %}
|
||||
<div class="field has-addons mb-0">
|
||||
<div class="control">
|
||||
<label for="input-list-position" class="button is-transparent is-small">{% trans "List position" %}</label>
|
||||
</div>
|
||||
<div class="control">
|
||||
<input id="input_list_position" class="input is-small" type="number" min="1" name="position" value="{{ item.order }}">
|
||||
</div>
|
||||
<div class="control">
|
||||
<button type="submit" class="button is-info is-small is-tablet">{% trans "Set" %}</button>
|
||||
</div>
|
||||
<form
|
||||
name="set-position-{{ item.id }}"
|
||||
method="post"
|
||||
action="{% url 'list-set-book-position' item.id %}"
|
||||
class="card-footer-item"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<div class="field has-addons mb-0">
|
||||
<div class="control">
|
||||
<label for="input-list-position" class="button is-transparent is-small">{% trans "List position" %}</label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="control">
|
||||
<input id="input_list_position_{{ item.id }}" class="input is-small" type="number" min="1" name="position" value="{{ item.order }}">
|
||||
</div>
|
||||
<div class="control">
|
||||
<button type="submit" class="button is-info is-small is-tablet">{% trans "Set" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
{% if list.user == request.user or list.curation == 'open' and item.user == request.user or list.group|is_member:request.user %}
|
||||
<form name="remove-book" method="post" action="{% url 'list-remove-book' list.id %}" class="card-footer-item">
|
||||
<form
|
||||
name="remove-book-{{ item.id }}"
|
||||
method="post"
|
||||
action="{% url 'list-remove-book' list.id %}"
|
||||
class="card-footer-item"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="item" value="{{ item.id }}">
|
||||
<button type="submit" class="button is-small is-danger">{% trans "Remove" %}</button>
|
||||
@ -172,14 +196,20 @@
|
||||
|
||||
<form
|
||||
class="mt-1"
|
||||
name="add-book"
|
||||
name="add-book-{{ book.id }}"
|
||||
method="post"
|
||||
action="{% url 'list-add-book' %}{% if query %}?q={{ query }}{% endif %}"
|
||||
>
|
||||
{% 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 or list.group|is_member:request.user %}{% trans "Add" %}{% else %}{% trans "Suggest" %}{% endif %}</button>
|
||||
<button type="submit" class="button is-small is-link">
|
||||
{% if list.curation == 'open' or request.user == list.user or list.group|is_member:request.user %}
|
||||
{% trans "Add" %}
|
||||
{% else %}
|
||||
{% trans "Suggest" %}
|
||||
{% endif %}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@ -190,7 +220,18 @@
|
||||
<h2 class="title is-5 mt-6" id="embed-label">
|
||||
{% trans "Embed this list on a website" %}
|
||||
</h2>
|
||||
<textarea readonly class="textarea is-small" aria-labelledby="embed-label" data-copytext data-copytext-label="{% trans 'Copy embed code' %}" data-copytext-success="{% trans 'Copied!' %}"><iframe style="border-width:0;" id="bookwyrm_list_embed" width="400" height="600" title="{% blocktrans with list_name=list.name site_name=site.name owner=list.user.display_name %}{{ list_name }}, a list by {{owner}} on {{ site_name }}{% endblocktrans %}" src="{{ embed_url }}"></iframe></textarea>
|
||||
<div class="vertical-copy">
|
||||
<textarea
|
||||
readonly
|
||||
class="textarea is-small"
|
||||
aria-labelledby="embed-label"
|
||||
data-copytext
|
||||
data-copytext-label="{% trans 'Copy embed code' %}"
|
||||
data-copytext-success="{% trans 'Copied!' %}"
|
||||
><iframe style="border-width:0;" id="bookwyrm_list_embed" width="400" height="600" title="{% blocktrans trimmed with list_name=list.name site_name=site.name owner=list.user.display_name %}
|
||||
{{ list_name }}, a list by {{owner}} on {{ site_name }}
|
||||
{% endblocktrans %}" src="{{ embed_url }}"></iframe></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
@ -1,12 +1,15 @@
|
||||
{% load bookwyrm_tags %}
|
||||
{% related_status notification as related_status %}
|
||||
<div class="notification is-clickable {% if notification.id in unread %} is-primary{% endif %}" data-href="{% block primary_link %}{% endblock %}">
|
||||
<div class="box is-shadowless has-background-white-ter {% if notification.id in unread %} is-primary{% endif %}">
|
||||
<div class="columns is-mobile">
|
||||
<div class="column is-narrow is-size-3 {% if notification.id in unread%}has-text-white{% else %}has-text-grey{% endif %}">
|
||||
{% block icon %}{% endblock %}
|
||||
<a class="has-text-dark" href="{% block primary_link %}{% endblock %}">
|
||||
{% block icon %}{% endblock %}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="column is-clipped">
|
||||
<div class="block">
|
||||
<div class="block content">
|
||||
<p>
|
||||
{% if notification.related_user %}
|
||||
<a href="{{ notification.related_user.local_path }}">{% include 'snippets/avatar.html' with user=notification.related_user %}
|
||||
@ -15,6 +18,7 @@
|
||||
{% block description %}{% endblock %}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% if related_status %}
|
||||
<div class="block">
|
||||
{% block preview %}{% endblock %}
|
||||
|
@ -46,7 +46,3 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script src="{% static "js/block_href.js" %}?v={{ js_cache }}"></script>
|
||||
{% endblock %}
|
||||
|
@ -8,7 +8,7 @@
|
||||
<ul class="block">
|
||||
{% for result in local_results.results %}
|
||||
<li class="pd-4 mb-5">
|
||||
<div class="columns is-mobile is-gapless">
|
||||
<div class="columns is-mobile is-gapless mb-0">
|
||||
<div class="column is-cover">
|
||||
{% include 'snippets/book_cover.html' with book=result cover_class='is-w-xs is-h-xs' %}
|
||||
</div>
|
||||
@ -34,34 +34,28 @@
|
||||
<div class="block">
|
||||
{% for result_set in results|slice:"1:" %}
|
||||
{% if result_set.results %}
|
||||
<section class="box has-background-white-bis">
|
||||
<section class="mb-5">
|
||||
{% if not result_set.connector.local %}
|
||||
<header class="columns is-mobile">
|
||||
<div class="column">
|
||||
<h3 class="title is-5">
|
||||
<details class="details-panel box" {% if forloop.first %}open{% endif %}>
|
||||
{% endif %}
|
||||
{% if not result_set.connector.local %}
|
||||
<summary class="is-flex is-align-items-center is-flex-wrap-wrap is-gap-2">
|
||||
<span class="mb-0 title is-5">
|
||||
{% trans 'Results from' %}
|
||||
<a href="{{ result_set.connector.base_url }}" target="_blank">{{ result_set.connector.name|default:result_set.connector.identifier }}</a>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="column is-narrow">
|
||||
{% trans "Open" as button_text %}
|
||||
{% include 'snippets/toggle/open_button.html' with text=button_text controls_text="more_results_panel" controls_uid=result_set.connector.identifier class="is-small" icon_with_text="arrow-down" pressed=forloop.first %}
|
||||
{% trans "Close" as button_text %}
|
||||
{% include 'snippets/toggle/close_button.html' with text=button_text controls_text="more_results_panel" controls_uid=result_set.connector.identifier class="is-small" icon_with_text="arrow-up" pressed=forloop.first %}
|
||||
</div>
|
||||
</header>
|
||||
{% endif %}
|
||||
</span>
|
||||
|
||||
<div class="box has-background-white is-shadowless{% if not forloop.first %} is-hidden{% endif %}" id="more_results_panel_{{ result_set.connector.identifier }}">
|
||||
<span class="details-close icon icon-x" aria-hidden></span>
|
||||
</summary>
|
||||
{% endif %}
|
||||
|
||||
<div class="mt-5">
|
||||
<div class="is-flex is-flex-direction-row-reverse">
|
||||
<div>
|
||||
</div>
|
||||
|
||||
<ul class="is-flex-grow-1">
|
||||
{% for result in result_set.results %}
|
||||
<li class="mb-5">
|
||||
<li class="{% if not forloop.last %}mb-5{% endif %}">
|
||||
<div class="columns is-mobile is-gapless">
|
||||
<div class="columns is-mobile is-gapless">
|
||||
<div class="column is-1 is-cover">
|
||||
{% include 'snippets/book_cover.html' with book=result cover_class='is-w-xs is-h-xs' external_path=True %}
|
||||
</div>
|
||||
<div class="column is-10 ml-3">
|
||||
@ -92,6 +86,9 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% if not result_set.connector.local %}
|
||||
</details>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
@ -13,7 +13,7 @@
|
||||
<form class="block" action="{% url 'search' %}" method="GET">
|
||||
<div class="field has-addons">
|
||||
<div class="control">
|
||||
<input type="input" class="input" name="q" value="{{ query }}" aria-label="{% trans 'Search query' %}">
|
||||
<input type="text" class="input" name="q" value="{{ query }}" aria-label="{% trans 'Search query' %}">
|
||||
</div>
|
||||
<div class="control">
|
||||
<div class="select" aria-label="{% trans 'Search type' %}">
|
||||
|
@ -31,35 +31,29 @@
|
||||
|
||||
<div class="block content">
|
||||
<dl>
|
||||
<div class="is-flex notification pt-1 pb-1 mb-0 {% if announcement in active_announcements %}is-success{% else %}is-danger{% endif %}">
|
||||
<dt class="mr-1 has-text-weight-bold">{% trans "Visible:" %}</dt>
|
||||
<dd>
|
||||
{% if announcement in active_announcements %}
|
||||
{% trans "True" %}
|
||||
{% else %}
|
||||
{% trans "False" %}
|
||||
{% endif %}
|
||||
</dd>
|
||||
</div>
|
||||
<dt class="is-pulled-left mr-5 has-text-weight-bold">{% trans "Visible:" %}</dt>
|
||||
<dd>
|
||||
<span class="tag {% if announcement in active_announcements %}is-success{% else %}is-danger{% endif %}">
|
||||
{% if announcement in active_announcements %}
|
||||
{% trans "True" %}
|
||||
{% else %}
|
||||
{% trans "False" %}
|
||||
{% endif %}
|
||||
</span>
|
||||
</dd>
|
||||
|
||||
{% if announcement.start_date %}
|
||||
<div class="is-flex notificationi pt-1 pb-1 mb-0 has-background-white">
|
||||
<dt class="mr-1 has-text-weight-bold">{% trans "Start date:" %}</dt>
|
||||
<dd>{{ announcement.start_date|naturalday }}</dd>
|
||||
</div>
|
||||
<dt class="is-pulled-left mr-5 has-text-weight-bold">{% trans "Start date:" %}</dt>
|
||||
<dd>{{ announcement.start_date|naturalday }}</dd>
|
||||
{% endif %}
|
||||
|
||||
{% if announcement.end_date %}
|
||||
<div class="is-flex notification pt-1 pb-1 mb-0 has-background-white">
|
||||
<dt class="mr-1 has-text-weight-bold">{% trans "End date:" %}</dt>
|
||||
<dd>{{ announcement.end_date|naturalday }}</dd>
|
||||
</div>
|
||||
<dt class="is-pulled-left mr-5 has-text-weight-bold">{% trans "End date:" %}</dt>
|
||||
<dd>{{ announcement.end_date|naturalday }}</dd>
|
||||
{% endif %}
|
||||
|
||||
<div class="is-flex notification pt-1 pb-1 has-background-white">
|
||||
<dt class="mr-1 has-text-weight-bold">{% trans "Active:" %}</dt>
|
||||
<dd>{{ announcement.active }}</dd>
|
||||
</div>
|
||||
<dt class="is-pulled-left mr-5 has-text-weight-bold">{% trans "Active:" %}</dt>
|
||||
<dd>{{ announcement.active }}</dd>
|
||||
</dl>
|
||||
|
||||
<hr aria-hidden="true">
|
||||
|
@ -3,5 +3,7 @@
|
||||
|
||||
{% block filter %}
|
||||
<label class="label" for="id_server">{% trans "Instance name" %}</label>
|
||||
<input type="text" class="input" name="server" value="{{ request.GET.server|default:'' }}" id="id_server" placeholder="example.server.com">
|
||||
<div class="control">
|
||||
<input type="text" class="input" name="server" value="{{ request.GET.server|default:'' }}" id="id_server" placeholder="example.server.com">
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
{% block filter %}
|
||||
<label class="label" for="id_username">{% trans "Username" %}</label>
|
||||
<input type="text" class="input" name="username" value="{{ request.GET.username|default:'' }}" id="id_username" placeholder="user@domain.com">
|
||||
<div class="control">
|
||||
<input type="text" class="input" name="username" value="{{ request.GET.username|default:'' }}" id="id_username" placeholder="user@domain.com">
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<div class="columns">
|
||||
<div class="column is-narrow is-hidden-mobile">
|
||||
<figure class="block is-w-xl">
|
||||
<figure class="block is-w-{% if size %}{{ size }}{% else %}xl{% endif %}">
|
||||
<img src="{% if site.logo %}{% get_media_prefix %}{{ site.logo }}{% else %}{% static "images/logo.png" %}{% endif %}" alt="BookWyrm logo">
|
||||
</figure>
|
||||
</div>
|
||||
|
@ -13,7 +13,7 @@
|
||||
{% for author in book.authors.all|slice:limit %}
|
||||
<a
|
||||
href="{{ author.local_path }}"
|
||||
class="author"
|
||||
class="author {{ link_class }}"
|
||||
itemprop="author"
|
||||
itemscope
|
||||
itemtype="https://schema.org/Thing"
|
||||
|
@ -1,7 +1,11 @@
|
||||
{% load i18n %}
|
||||
{% load utilities %}
|
||||
{% load cache %}
|
||||
{% spaceless %}
|
||||
|
||||
{# 6 month cache #}
|
||||
{% cache 15552000 titleby book.id %}
|
||||
|
||||
{% if book.authors.exists %}
|
||||
{% blocktrans trimmed with path=book.local_path title=book|book_title %}
|
||||
<a href="{{ path }}">{{ title }}</a> by
|
||||
@ -10,4 +14,6 @@
|
||||
{% else %}
|
||||
<a href="{{ book.local_path }}">{{ book|book_title }}</a>
|
||||
{% endif %}
|
||||
|
||||
{% endcache %}
|
||||
{% endspaceless %}
|
||||
|
@ -1,6 +1,4 @@
|
||||
<div class="column is-flex">
|
||||
<div class="box is-flex-grow-1">
|
||||
{% block filter %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
<div class="filters-field column">
|
||||
{% block filter %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
@ -1,28 +1,47 @@
|
||||
{% load i18n %}
|
||||
<div class="notification content">
|
||||
<h2 class="columns is-mobile mb-0">
|
||||
<span class="column pb-0">Filters</span>
|
||||
<details class="details-panel box is-size-{{ size|default:'normal' }}" {% if filters_applied %}open{% endif %}>
|
||||
<summary class="is-flex is-align-items-center is-flex-wrap-wrap is-gap-2">
|
||||
<span class="mb-0 title {% if size == 'small' %}is-6{% else %}is-5{% endif %} is-flex-shrink-0">
|
||||
{% trans "Filters" %}
|
||||
|
||||
<span class="column is-narrow pb-0">
|
||||
{% trans "Show filters" as text %}
|
||||
{% include 'snippets/toggle/open_button.html' with text=text controls_text="filters" icon_with_text="arrow-down" class="is-small" focus="filters" %}
|
||||
{% trans "Hide filters" as text %}
|
||||
{% include 'snippets/toggle/close_button.html' with text=text controls_text="filters" icon_with_text="arrow-up" class="is-small" %}
|
||||
</span>
|
||||
</h2>
|
||||
|
||||
<form class="is-hidden mt-3" id="filters" method="get" action="{{ request.path }}" tabindex="0">
|
||||
{% if sort %}
|
||||
<input type="hidden" name="sort" value="{{ sort }}">
|
||||
{% if filters_applied %}
|
||||
<span class="tag is-success is-light ml-2 mb-0 is-{{ size|default:'normal' }}">
|
||||
{{ _("Filters are applied") }}
|
||||
</span>
|
||||
{% endif %}
|
||||
<div class="columns">
|
||||
{% block filter_fields %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
<button class="button is-primary">{% trans "Apply filters" %}</button>
|
||||
</form>
|
||||
|
||||
{% if request.GET %}
|
||||
<a class="help" href="{{ request.path }}">{% trans "Clear filters" %}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if request.GET %}
|
||||
<span class="mb-0 tags has-addons">
|
||||
<span class="mb-0 tag is-success is-light is-{{ size|default:'normal' }}">
|
||||
{% trans "Filters are applied" %}
|
||||
</span>
|
||||
<a class="mb-0 tag is-success is-{{ size|default:'normal' }}" href="{{ request.path }}">
|
||||
{% trans "Clear filters" %}
|
||||
</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
<span class="details-close icon icon-x is-{{ size|default:'normal' }}" aria-hidden></span>
|
||||
</summary>
|
||||
|
||||
<div class="mt-3">
|
||||
<form id="filters" method="{{ method|default:'get' }}" action="{{ action|default:request.path }}">
|
||||
{% if method == 'post' %}
|
||||
{% csrf_token %}
|
||||
{% endif %}
|
||||
|
||||
{% if sort %}
|
||||
<input type="hidden" name="sort" value="{{ sort }}">
|
||||
{% endif %}
|
||||
<div class="mt-3 columns filters-fields is-align-items-stretch">
|
||||
{% block filter_fields %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
<button type="submit" class="button is-primary is-small">
|
||||
{% trans "Apply filters" %}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</details>
|
||||
|
@ -1,4 +1,5 @@
|
||||
{% load i18n %}
|
||||
|
||||
{% if request.user == user or not request.user.is_authenticated %}
|
||||
{% elif user in request.user.blocks.all %}
|
||||
{% include 'snippets/block_button.html' with blocks=True %}
|
||||
|
@ -5,7 +5,7 @@
|
||||
type="number"
|
||||
name="progress"
|
||||
class="input"
|
||||
id="id_progress_{{ readthrough.id }}{{ controls_uid }}"
|
||||
id="{{ field_id }}"
|
||||
value="{{ readthrough.progress }}"
|
||||
{% if progress_required %}required{% endif %}
|
||||
>
|
||||
|
@ -9,7 +9,7 @@ Finish "<em>{{ book_title }}</em>"
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="finish-reading" action="{% url 'reading-status' 'finish' book.id %}" method="post" {% if not refresh %}class="submit-status"{% endif %}>
|
||||
<form name="finish-reading-{{ uuid }}" action="{% url 'reading-status' 'finish' book.id %}" method="post" {% if not refresh %}class="submit-status"{% endif %}>
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="id" value="{{ readthrough.id }}">
|
||||
<input type="hidden" name="reading_status" value="read">
|
||||
|
@ -1,19 +1,21 @@
|
||||
{% extends 'snippets/reading_modals/layout.html' %}
|
||||
{% load i18n %}
|
||||
{% load utilities %}
|
||||
|
||||
{% block modal-title %}
|
||||
{% trans "Update progress" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="reading-progress" action="{% url 'reading-status-update' book.id %}" method="POST" class="submit-status">
|
||||
<form name="reading-progress-{{ uuid }}" action="{% url 'reading-status-update' book.id %}" method="POST" class="submit-status">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="id" value="{{ readthrough.id }}">
|
||||
{% endblock %}
|
||||
|
||||
{% block reading-dates %}
|
||||
<label for="id_progress_{{ readthrough.id }}{{ controls_uid }}" class="label">{% trans "Progress:" %}</label>
|
||||
{% include "snippets/progress_field.html" with progress_required=True %}
|
||||
{% join "id_progress" uuid as field_id %}
|
||||
<label for="{{ field_id }}" class="label">{% trans "Progress:" %}</label>
|
||||
{% include "snippets/progress_field.html" with progress_required=True id=field_id %}
|
||||
{% endblock %}
|
||||
|
||||
{% block form %}
|
||||
|
@ -9,9 +9,9 @@ Start "<em>{{ book_title }}</em>"
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="start-reading" action="{% url 'reading-status' 'start' book.id %}" method="post" {% if not refresh %}class="submit-status"{% endif %}>
|
||||
<form name="start-reading-{{ uuid }}" action="{% url 'reading-status' 'start' book.id %}" method="post" {% if not refresh %}class="submit-status"{% endif %}>
|
||||
<input type="hidden" name="reading_status" value="reading">
|
||||
<input type="hidden" name="shelf" value="{{ move_from }}">
|
||||
<input type="hidden" name="shelf" value="{{ move_from }}">
|
||||
{% csrf_token %}
|
||||
{% endblock %}
|
||||
|
||||
|
@ -9,7 +9,7 @@ Want to Read "<em>{{ book_title }}</em>"
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-form-open %}
|
||||
<form name="shelve" action="{% url 'reading-status' 'want' book.id %}" method="post" {% if not refresh %}class="submit-status"{% endif %}>
|
||||
<form name="want-to-read-{{ uuid }}" action="{% url 'reading-status' 'want' book.id %}" method="post" {% if not refresh %}class="submit-status"{% endif %}>
|
||||
<input type="hidden" name="reading_status" value="to-read">
|
||||
<input type="hidden" name="shelf" value="{{ move_from }}">
|
||||
{% csrf_token %}
|
||||
|
@ -1,4 +1,6 @@
|
||||
{% load i18n %}
|
||||
{% load utilities %}
|
||||
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="id" value="{{ readthrough.id }}">
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
@ -10,10 +12,11 @@
|
||||
</div>
|
||||
{# Only show progress for editing existing readthroughs #}
|
||||
{% if readthrough.id and not readthrough.finish_date %}
|
||||
<label class="label" for="id_progress_{{ readthrough.id }}{{ controls_uid }}">
|
||||
{% join "id_progress" readthrough.id as field_id %}
|
||||
<label class="label" for="{{ field_id }}">
|
||||
{% trans "Progress" %}
|
||||
</label>
|
||||
{% include "snippets/progress_field.html" %}
|
||||
{% include "snippets/progress_field.html" with id=field_id %}
|
||||
{% endif %}
|
||||
<div class="field">
|
||||
<label class="label" for="id_finish_date_{{ readthrough.id }}">
|
||||
|
@ -3,9 +3,15 @@
|
||||
|
||||
{% 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 'snippets/report_modal.html' with user=user reporter=request.user controls_text="report" controls_uid=report_uuid %}
|
||||
{% join "report" report_uuid as modal_id %}
|
||||
<button
|
||||
class="button is-small is-danger is-light is-fullwidth"
|
||||
type="button"
|
||||
data-modal-open="{{ modal_id }}"
|
||||
{% if is_current %}disabled{% endif %}
|
||||
>
|
||||
{% trans "Report" %}
|
||||
</button>
|
||||
{% include 'snippets/report_modal.html' with user=user reporter=request.user id=modal_id %}
|
||||
|
||||
{% endwith %}
|
||||
|
@ -21,8 +21,12 @@
|
||||
|
||||
<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>
|
||||
<div class="control">
|
||||
<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>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{% endblock %}
|
||||
@ -31,9 +35,9 @@
|
||||
{% 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="" %}
|
||||
<button type="button" class="button" data-modal-close>{% trans "Cancel" %}</button>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block modal-form-close %}</form>{% endblock %}
|
||||
|
||||
|
@ -63,16 +63,18 @@
|
||||
{% endfor %}
|
||||
|
||||
{% if shelf.identifier == 'all' %}
|
||||
{% for shelved_in in book.shelves.all %}
|
||||
{% for user_shelf in user_shelves %}
|
||||
{% if user_shelf in book.shelves.all %}
|
||||
<li class="navbar-divider m-0" role="separator" ></li>
|
||||
<li role="menuitem" class="dropdown-item p-0">
|
||||
<form name="shelve" action="/unshelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ book.id }}">
|
||||
<input type="hidden" name="shelf" value="{{ shelved_in.id }}">
|
||||
<button class="button is-fullwidth is-small is-radiusless is-danger is-light" type="submit">{% trans "Remove from" %} {{ shelved_in.name }}</button>
|
||||
<input type="hidden" name="shelf" value="{{ user_shelf.id }}">
|
||||
<button class="button is-fullwidth is-small is-radiusless is-danger is-light" type="submit">{% trans "Remove from" %} {{ user_shelf.name }}</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<li class="navbar-divider" role="separator" ></li>
|
||||
@ -86,11 +88,14 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% include 'snippets/reading_modals/want_to_read_modal.html' with book=active_shelf.book controls_text="want_to_read" controls_uid=uuid move_from=current.id refresh=True class="" %}
|
||||
{% join "want_to_read" uuid as modal_id %}
|
||||
{% include 'snippets/reading_modals/want_to_read_modal.html' with book=active_shelf.book id=modal_id move_from=current.id refresh=True class="" %}
|
||||
|
||||
{% include 'snippets/reading_modals/start_reading_modal.html' with book=active_shelf.book controls_text="start_reading" controls_uid=uuid move_from=current.id refresh=True class="" %}
|
||||
{% join "start_reading" uuid as modal_id %}
|
||||
{% include 'snippets/reading_modals/start_reading_modal.html' with book=active_shelf.book id=modal_id move_from=current.id refresh=True class="" %}
|
||||
|
||||
{% include 'snippets/reading_modals/finish_reading_modal.html' with book=active_shelf.book controls_text="finish_reading" controls_uid=uuid move_from=current.id readthrough=readthrough refresh=True class="" %}
|
||||
{% join "finish_reading" uuid as modal_id %}
|
||||
{% include 'snippets/reading_modals/finish_reading_modal.html' with book=active_shelf.book id=modal_id move_from=current.id readthrough=readthrough refresh=True class="" %}
|
||||
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
10
bookwyrm/templates/snippets/shelve_button/modal_button.html
Normal file
10
bookwyrm/templates/snippets/shelve_button/modal_button.html
Normal file
@ -0,0 +1,10 @@
|
||||
{% load utilities %}
|
||||
<form name="fallback_form_{{ 0|uuid }}" method="GET" action="{{ fallback_url }}" autocomplete="off">
|
||||
<button
|
||||
type="submit"
|
||||
class="button {{ class }}"
|
||||
data-modal-open="{{ modal_id }}"
|
||||
>
|
||||
{{ button_text }}
|
||||
</button>
|
||||
</form>
|
@ -6,7 +6,7 @@
|
||||
{% with book.id|uuid as uuid %}
|
||||
{% active_shelf book as active_shelf %}
|
||||
{% latest_read_through book request.user as readthrough %}
|
||||
<div class="field has-addons mb-0" data-shelve-button-book="{{ book.id }}">
|
||||
<div class="field has-addons mb-0 has-text-weight-normal" data-shelve-button-book="{{ book.id }}">
|
||||
{% if switch_mode and active_shelf.book != book %}
|
||||
<div class="control">
|
||||
{% include 'snippets/switch_edition_button.html' with edition=book size='is-small' %}
|
||||
@ -19,13 +19,17 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% include 'snippets/reading_modals/want_to_read_modal.html' with book=active_shelf.book controls_text="want_to_read" controls_uid=uuid %}
|
||||
{% join "want_to_read" uuid as modal_id %}
|
||||
{% include 'snippets/reading_modals/want_to_read_modal.html' with book=active_shelf.book id=modal_id class="" %}
|
||||
|
||||
{% include 'snippets/reading_modals/start_reading_modal.html' with book=active_shelf.book controls_text="start_reading" controls_uid=uuid %}
|
||||
{% join "start_reading" uuid as modal_id %}
|
||||
{% include 'snippets/reading_modals/start_reading_modal.html' with book=active_shelf.book id=modal_id class="" %}
|
||||
|
||||
{% include 'snippets/reading_modals/finish_reading_modal.html' with book=active_shelf.book controls_text="finish_reading" controls_uid=uuid readthrough=readthrough %}
|
||||
{% join "finish_reading" uuid as modal_id %}
|
||||
{% include 'snippets/reading_modals/finish_reading_modal.html' with book=active_shelf.book id=modal_id readthrough=readthrough class="" %}
|
||||
|
||||
{% include 'snippets/reading_modals/progress_update_modal.html' with book=active_shelf.book controls_text="progress_update" controls_uid=uuid readthrough=readthrough %}
|
||||
{% join "progress_update" uuid as modal_id %}
|
||||
{% include 'snippets/reading_modals/progress_update_modal.html' with book=active_shelf.book id=modal_id readthrough=readthrough class="" %}
|
||||
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
|
@ -16,23 +16,26 @@
|
||||
|
||||
{% trans "Start reading" as button_text %}
|
||||
{% url 'reading-status' 'start' book.id as fallback_url %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with class=class text=button_text controls_text="start_reading" controls_uid=button_uuid focus="modal_title_start_reading" disabled=is_current fallback_url=fallback_url %}
|
||||
{% join "start_reading" button_uuid as modal_id %}
|
||||
{% include 'snippets/shelve_button/modal_button.html' with class=class fallback_url=fallback_url %}
|
||||
|
||||
{% elif shelf.identifier == 'read' %}
|
||||
|
||||
{% trans "Read" as button_text %}
|
||||
{% url 'reading-status' 'finish' book.id as fallback_url %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with class=class text=button_text controls_text="finish_reading" controls_uid=button_uuid focus="modal_title_finish_reading" disabled=is_current fallback_url=fallback_url %}
|
||||
{% join "finish_reading" button_uuid as modal_id %}
|
||||
{% include 'snippets/shelve_button/modal_button.html' with class=class fallback_url=fallback_url %}
|
||||
|
||||
{% elif shelf.identifier == 'to-read' %}
|
||||
|
||||
{% trans "Want to read" as button_text %}
|
||||
{% url 'reading-status' 'want' book.id as fallback_url %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with class=class text=button_text controls_text="want_to_read" controls_uid=button_uuid focus="modal_title_want_to_read" disabled=is_current fallback_url=fallback_url %}
|
||||
{% join "want_to_read" button_uuid as modal_id %}
|
||||
{% include 'snippets/shelve_button/modal_button.html' with class=class fallback_url=fallback_url %}
|
||||
|
||||
{% elif shelf.editable %}
|
||||
|
||||
<form name="shelve" action="/shelve/" method="post" autocomplete="off">
|
||||
<form name="shelve-{{ uuid }}-{{ shelf.identifier }}" action="/shelve/" method="post" autocomplete="off">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ active_shelf.book.id }}">
|
||||
<button class="button {{ class }}" name="shelf" type="submit" value="{{ shelf.identifier }}" {% if shelf in book.shelf_set.all %} disabled {% endif %}>
|
||||
@ -47,8 +50,9 @@
|
||||
|
||||
{% if readthrough and active_shelf.shelf.identifier != 'read' %}
|
||||
<li role="menuitem" class="dropdown-item p-0" data-extra-options>
|
||||
{% trans "Update progress" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with class=class text=button_text controls_text="progress_update" controls_uid=button_uuid focus="modal_title_progress_update" %}
|
||||
<button type="submit" class="button {{ class }}" data-modal-open="progress_update_{{ button_uuid }}">
|
||||
{% trans "Update progress" %}
|
||||
</button>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
|
@ -23,23 +23,26 @@
|
||||
|
||||
{% trans "Start reading" as button_text %}
|
||||
{% url 'reading-status' 'start' book.id as fallback_url %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with class=class text=button_text controls_text="start_reading" controls_uid=button_uuid focus="modal_title_start_reading" fallback_url=fallback_url %}
|
||||
{% join "start_reading" button_uuid as modal_id %}
|
||||
{% include 'snippets/shelve_button/modal_button.html' with class=class fallback_url=fallback_url %}
|
||||
|
||||
{% elif shelf.identifier == 'read' %}
|
||||
|
||||
{% trans "Finish reading" as button_text %}
|
||||
{% url 'reading-status' 'finish' book.id as fallback_url %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with class=class text=button_text controls_text="finish_reading" controls_uid=button_uuid focus="modal_title_finish_reading" fallback_url=fallback_url %}
|
||||
{% join "finish_reading" button_uuid as modal_id %}
|
||||
{% include 'snippets/shelve_button/modal_button.html' with class=class fallback_url=fallback_url %}
|
||||
|
||||
{% elif shelf.identifier == 'to-read' %}
|
||||
|
||||
{% trans "Want to read" as button_text %}
|
||||
{% url 'reading-status' 'want' book.id as fallback_url %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with class=class text=button_text controls_text="want_to_read" controls_uid=button_uuid focus="modal_title_want_to_read" fallback_url=fallback_url %}
|
||||
{% join "want_to_read" button_uuid as modal_id %}
|
||||
{% include 'snippets/shelve_button/modal_button.html' with class=class fallback_url=fallback_url %}
|
||||
|
||||
{% elif shelf.editable %}
|
||||
|
||||
<form name="shelve" action="/shelve/" method="post">
|
||||
<form name="shelve-{{ uuid }}-{{ shelf.identifier }}" action="/shelve/" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="book" value="{{ active_shelf.book.id }}">
|
||||
<button class="button {{ class }}" name="shelf" type="submit" value="{{ shelf.identifier }}" {% if shelf in book.shelf_set.all %} disabled {% endif %}>
|
||||
|
@ -3,6 +3,7 @@
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
{% load humanize %}
|
||||
{% load cache %}
|
||||
|
||||
{% with status_type=status.status_type %}
|
||||
<div
|
||||
@ -15,6 +16,7 @@
|
||||
|
||||
<div class="columns is-gapless">
|
||||
{% if not hide_book %}
|
||||
{% cache 259200 content_status_book status.id %}
|
||||
{% with book=status.book|default:status.mention_books.first %}
|
||||
{% if book %}
|
||||
<div class="column is-cover">
|
||||
@ -34,6 +36,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endcache %}
|
||||
{% endif %}
|
||||
|
||||
<article class="column ml-3-tablet my-3-mobile">
|
||||
|
@ -3,8 +3,10 @@
|
||||
{% load bookwyrm_tags %}
|
||||
{% load markdown %}
|
||||
{% load i18n %}
|
||||
{% load cache %}
|
||||
|
||||
{% if not hide_book %}
|
||||
{% cache 259200 generated_status_book status.id %}
|
||||
{% with book=status.book|default:status.mention_books.first %}
|
||||
<div class="columns is-mobile is-gapless">
|
||||
<a class="column is-cover is-narrow" href="{{ book.local_path }}">
|
||||
@ -24,6 +26,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endwith %}
|
||||
{% endcache %}
|
||||
{% endif %}
|
||||
|
||||
{% endspaceless %}
|
||||
|
@ -1,11 +1,14 @@
|
||||
{% load cache %}
|
||||
|
||||
{# Three day cache #}
|
||||
{% cache 259200 generated_note_header status.id %}
|
||||
{% if status.content == 'wants to read' %}
|
||||
{% include 'snippets/status/headers/to_read.html' with book=status.mention_books.first %}
|
||||
{% endif %}
|
||||
|
||||
{% if status.content == 'finished reading' %}
|
||||
{% elif status.content == 'finished reading' %}
|
||||
{% include 'snippets/status/headers/read.html' with book=status.mention_books.first %}
|
||||
{% endif %}
|
||||
|
||||
{% if status.content == 'started reading' %}
|
||||
{% elif status.content == 'started reading' %}
|
||||
{% include 'snippets/status/headers/reading.html' with book=status.mention_books.first %}
|
||||
{% else %}
|
||||
{{ status.content }}
|
||||
{% endif %}
|
||||
{% endcache %}
|
||||
|
@ -1,5 +0,0 @@
|
||||
{% spaceless %}
|
||||
{% load i18n %}{% load humanize %}
|
||||
|
||||
{{ status.content }}
|
||||
{% endspaceless %}
|
@ -30,38 +30,39 @@
|
||||
{# nothing here #}
|
||||
{% elif request.user.is_authenticated %}
|
||||
|
||||
<div class="card-footer-item">
|
||||
{% trans "Reply" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with controls_text="show_comment" controls_uid=status.id text=button_text icon_with_text="comment" class="is-small is-light is-transparent toggle-button" focus="id_content_reply" %}
|
||||
</div>
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/boost_button.html' with status=status %}
|
||||
</div>
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/fav_button.html' with status=status %}
|
||||
</div>
|
||||
{% if not moderation_mode %}
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/status/status_options.html' with class="is-small is-light is-transparent" right=True %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="card-footer-item">
|
||||
{% trans "Reply" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with controls_text="show_comment" controls_uid=status.id text=button_text icon_with_text="comment" class="is-small is-light is-transparent toggle-button" focus="id_content_reply" %}
|
||||
</div>
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/boost_button.html' with status=status %}
|
||||
</div>
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/fav_button.html' with status=status %}
|
||||
</div>
|
||||
{% if not moderation_mode %}
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/status/status_options.html' with class="is-small is-light is-transparent" right=True %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% else %}
|
||||
<div class="card-footer-item">
|
||||
<a href="{% url 'login' %}">
|
||||
<span class="icon icon-comment is-small" title="{% trans 'Reply' %}">
|
||||
<span class="is-sr-only">{% trans "Reply" %}</span>
|
||||
</span>
|
||||
|
||||
<span class="icon icon-boost is-small ml-4" title="{% trans 'Boost status' %}">
|
||||
<span class="is-sr-only">{% trans "Boost status" %}</span>
|
||||
</span>
|
||||
<div class="card-footer-item">
|
||||
<a href="{% url 'login' %}">
|
||||
<span class="icon icon-comment is-small" title="{% trans 'Reply' %}">
|
||||
<span class="is-sr-only">{% trans "Reply" %}</span>
|
||||
</span>
|
||||
|
||||
<span class="icon icon-heart is-small ml-4" title="{% trans 'Like status' %}">
|
||||
<span class="is-sr-only">{% trans "Like status" %}</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<span class="icon icon-boost is-small ml-4" title="{% trans 'Boost status' %}">
|
||||
<span class="is-sr-only">{% trans "Boost status" %}</span>
|
||||
</span>
|
||||
|
||||
<span class="icon icon-heart is-small ml-4" title="{% trans 'Like status' %}">
|
||||
<span class="is-sr-only">{% trans "Like status" %}</span>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
@ -20,17 +20,21 @@
|
||||
</li>
|
||||
{% if status.status_type != 'GeneratedNote' and status.status_type != 'Rating' %}
|
||||
<li role="menuitem" class="dropdown-item p-0">
|
||||
<a href="{% url 'edit-status' status.id %}" class="button is-radiusless is-fullwidth is-small" type="submit">
|
||||
{% trans "Edit" %}
|
||||
</a>
|
||||
<span class="control">
|
||||
<a href="{% url 'edit-status' status.id %}" class="button is-radiusless is-fullwidth is-small" type="submit">
|
||||
{% trans "Edit" %}
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{# things you can do to other people's statuses #}
|
||||
<li role="menuitem" class="dropdown-item p-0">
|
||||
<a href="{% url 'direct-messages-user' status.user|username %}" class="button is-small is-white is-radiusless is-fullwidth">
|
||||
{% trans "Send direct message" %}
|
||||
</a>
|
||||
<span class="control">
|
||||
<a href="{% url 'direct-messages-user' status.user|username %}" class="button is-small is-white is-radiusless is-fullwidth">
|
||||
{% trans "Send direct message" %}
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
<li role="menuitem" class="dropdown-item p-0">
|
||||
{% include 'snippets/report_button.html' with user=status.user status=status %}
|
||||
|
@ -21,23 +21,23 @@
|
||||
<p><a href="{{ user.remote_id }}">{{ user.username }}</a></p>
|
||||
<p>{% blocktrans with date=user.created_date|naturaltime %}Joined {{ date }}{% endblocktrans %}</p>
|
||||
<p>
|
||||
{% if is_self %}
|
||||
{% if request.user.id == user.id %}
|
||||
|
||||
<a href="{% url 'user-followers' user|username %}">{% blocktrans count counter=user.followers.count %}{{ counter }} follower{% plural %}{{ counter }} followers{% endblocktrans %}</a>,
|
||||
<a href="{% url 'user-following' user|username %}">{% blocktrans with counter=user.following.count %}{{ counter }} following{% endblocktrans %}</a>
|
||||
<a href="{% url 'user-followers' user|username %}">{% blocktrans count counter=user.followers.count %}{{ counter }} follower{% plural %}{{ counter }} followers{% endblocktrans %}</a>,
|
||||
<a href="{% url 'user-following' user|username %}">{% blocktrans with counter=user.following.count %}{{ counter }} following{% endblocktrans %}</a>
|
||||
|
||||
{% elif request.user.is_authenticated %}
|
||||
|
||||
{% mutuals_count user as mutuals %}
|
||||
<a href="{% url 'user-followers' user|username %}">
|
||||
{% if mutuals %}
|
||||
{% blocktrans with mutuals_display=mutuals|intcomma count counter=mutuals %}{{ mutuals_display }} follower you follow{% plural %}{{ mutuals_display }} followers you follow{% endblocktrans %}
|
||||
{% elif request.user in user.following.all %}
|
||||
{% trans "Follows you" %}
|
||||
{% else %}
|
||||
{% trans "No followers you follow" %}
|
||||
{% endif %}
|
||||
</a>
|
||||
{% mutuals_count user as mutuals %}
|
||||
<a href="{% url 'user-followers' user|username %}">
|
||||
{% if mutuals %}
|
||||
{% blocktrans with mutuals_display=mutuals|intcomma count counter=mutuals %}{{ mutuals_display }} follower you follow{% plural %}{{ mutuals_display }} followers you follow{% endblocktrans %}
|
||||
{% elif request.user in user.following.all %}
|
||||
{% trans "Follows you" %}
|
||||
{% else %}
|
||||
{% trans "No followers you follow" %}
|
||||
{% endif %}
|
||||
</a>
|
||||
|
||||
{% endif %}
|
||||
</p>
|
||||
|
Reference in New Issue
Block a user