2020-01-25 23:25:19 +00:00
|
|
|
{% extends 'layout.html' %}
|
2020-12-13 02:25:04 +00:00
|
|
|
{% load bookwyrm_tags %}
|
2020-01-25 23:25:19 +00:00
|
|
|
{% block content %}
|
2020-02-21 23:39:25 +00:00
|
|
|
|
2020-09-30 00:43:30 +00:00
|
|
|
<div class="columns">
|
2020-09-30 22:00:46 +00:00
|
|
|
<div class="column is-one-third">
|
2020-11-07 04:36:52 +00:00
|
|
|
<h2 class="title is-5">Your books</h2>
|
2020-10-02 22:06:42 +00:00
|
|
|
{% if not suggested_books %}
|
|
|
|
<p>There are no books here right now! Try searching for a book to get started</p>
|
|
|
|
{% else %}
|
2020-11-07 04:36:52 +00:00
|
|
|
<div class="tabs is-small">
|
2020-09-30 00:43:30 +00:00
|
|
|
<ul>
|
2020-11-07 04:36:52 +00:00
|
|
|
{% for shelf in suggested_books %}
|
2020-11-07 04:51:11 +00:00
|
|
|
{% if shelf.books %}
|
2020-11-07 04:36:52 +00:00
|
|
|
{% with shelf_counter=forloop.counter %}
|
|
|
|
<li>
|
2020-11-07 19:54:32 +00:00
|
|
|
<p>
|
|
|
|
{{ shelf.name }}
|
|
|
|
</p>
|
2020-11-09 21:24:11 +00:00
|
|
|
<div class="tabs is-small is-toggle" role="tablist">
|
2020-11-07 04:36:52 +00:00
|
|
|
<ul>
|
|
|
|
{% for book in shelf.books %}
|
|
|
|
<li class="{% if shelf_counter == 1 and forloop.first %}is-active{% endif %}" data-id="tab-book-{{ book.id }}">
|
2021-01-14 23:29:37 +00:00
|
|
|
<label for="book-{{ book.id }}" class="tab-change-nested">
|
2020-11-09 21:24:11 +00:00
|
|
|
<div role="tab" tabindex="0" aria-selected="{% if shelf_counter == 1 and forloop.first %}true{% else %}false{% endif %}" aria-controls="book-{{ book.id }}-panel">
|
2020-11-09 03:34:41 +00:00
|
|
|
<a>
|
|
|
|
{% include 'snippets/book_cover.html' with book=book size="medium" %}
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</label>
|
2020-11-07 04:36:52 +00:00
|
|
|
</li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</div>
|
2020-09-30 00:43:30 +00:00
|
|
|
</li>
|
2020-11-07 04:36:52 +00:00
|
|
|
{% endwith %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2020-09-30 00:43:30 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
2020-11-07 04:36:52 +00:00
|
|
|
{% for shelf in suggested_books %}
|
|
|
|
{% with shelf_counter=forloop.counter %}
|
|
|
|
{% for book in shelf.books %}
|
2020-09-30 00:43:30 +00:00
|
|
|
<div>
|
2020-11-07 04:36:52 +00:00
|
|
|
<input class="toggle-control" type="radio" name="recent-books" id="book-{{ book.id }}" {% if shelf_counter == 1 and forloop.first %}checked{% endif %}>
|
2020-11-09 21:24:11 +00:00
|
|
|
<div class="toggle-content hidden" role="tabpanel" id="book-{{ book.id }}-panel">
|
2020-12-22 16:21:43 +00:00
|
|
|
<div class="card">
|
|
|
|
<div class="card-header">
|
|
|
|
<p class="card-header-title">
|
2021-01-16 16:19:54 +00:00
|
|
|
<span>{% include 'snippets/book_titleby.html' with book=book %}</span>
|
|
|
|
</p>
|
2020-12-22 16:21:43 +00:00
|
|
|
<div class="card-header-icon is-hidden-tablet">
|
2021-01-14 22:19:30 +00:00
|
|
|
{% include 'snippets/toggle/toggle_button.html' with label="close" controls_text="no-book" class="delete" %}
|
2020-12-22 16:21:43 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="card-content">
|
|
|
|
{% include 'snippets/shelve_button.html' with book=book %}
|
|
|
|
{% include 'snippets/create_status.html' with book=book %}
|
2020-12-17 22:13:13 +00:00
|
|
|
</div>
|
2020-09-30 19:19:23 +00:00
|
|
|
</div>
|
2020-09-30 00:43:30 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
2020-11-07 04:36:52 +00:00
|
|
|
{% endwith %}
|
|
|
|
{% endfor %}
|
2020-12-22 18:12:41 +00:00
|
|
|
<div>
|
|
|
|
<input class="toggle-control" type="radio" name="recent-books" id="no-book">
|
|
|
|
</div>
|
2020-10-02 22:06:42 +00:00
|
|
|
{% endif %}
|
2021-01-16 16:19:54 +00:00
|
|
|
|
|
|
|
{% if goal %}
|
|
|
|
<section class="section">
|
|
|
|
<div class="block">
|
2021-01-16 19:34:19 +00:00
|
|
|
<h3 class="title is-4">{{ goal.year }} Reading Goal</h3>
|
|
|
|
{% include 'snippets/goal_progress.html' with goal=goal %}
|
2021-01-16 16:19:54 +00:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
{% endif %}
|
2020-09-29 17:21:10 +00:00
|
|
|
</div>
|
2020-01-25 23:25:19 +00:00
|
|
|
|
2020-09-30 00:51:57 +00:00
|
|
|
<div class="column is-two-thirds" id="feed">
|
2020-11-18 20:31:53 +00:00
|
|
|
<h1 class="title">{{ tab | title }} Timeline</h1>
|
2020-10-05 20:34:43 +00:00
|
|
|
<div class="tabs">
|
|
|
|
<ul>
|
|
|
|
<li class="{% if tab == 'home' %}is-active{% endif %}">
|
|
|
|
<a href="/#feed">Home</a>
|
|
|
|
</li>
|
|
|
|
<li class="{% if tab == 'local' %}is-active{% endif %}">
|
|
|
|
<a href="/local#feed">Local</a>
|
|
|
|
</li>
|
|
|
|
<li class="{% if tab == 'federated' %}is-active{% endif %}">
|
|
|
|
<a href="/federated#feed">Federated</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
2021-01-16 16:19:54 +00:00
|
|
|
{# announcements and system messages #}
|
|
|
|
{% if not goal and tab == 'home' %}
|
2021-01-16 17:21:19 +00:00
|
|
|
{% now 'Y' as year %}
|
|
|
|
<section class="block hidden" aria-title="Announcements" data-hide="hide-{{ year }}-reading-goal">
|
2021-01-16 16:19:54 +00:00
|
|
|
<article class="card">
|
|
|
|
<header class="card-header">
|
|
|
|
<h3 class="card-header-title has-background-primary has-text-white">
|
2021-01-16 16:54:16 +00:00
|
|
|
<span class="icon icon-book is-size-3 mr-2" aria-hidden="true"></span> {{ year }} reading goal
|
2021-01-16 16:19:54 +00:00
|
|
|
</h3>
|
|
|
|
</header>
|
|
|
|
<section class="card-content content">
|
|
|
|
<p>Set a goal for how many books you'll finish reading in {{ year }}, and track your progress throughout the year.</p>
|
|
|
|
|
|
|
|
{% include 'snippets/goal_form.html' %}
|
|
|
|
</section>
|
|
|
|
<footer class="card-footer has-background-white-bis">
|
|
|
|
<div class="card-footer-item is-flex-direction-column">
|
2021-01-16 17:21:19 +00:00
|
|
|
<button class="button is-danger is-light is-block set-display" data-id="hide-{{ year }}-reading-goal" data-value="true">Dismiss message</button>
|
2021-01-16 16:19:54 +00:00
|
|
|
<p class="help">You can set or change your reading goal any time from your <a href="{{ request.user.local_path }}">profile page</a></p>
|
|
|
|
</div>
|
|
|
|
</footer>
|
|
|
|
</article>
|
2021-01-16 17:21:19 +00:00
|
|
|
<hr>
|
2021-01-16 16:19:54 +00:00
|
|
|
</section>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{# activity feed #}
|
2020-10-02 22:06:42 +00:00
|
|
|
{% if not activities %}
|
|
|
|
<p>There aren't any activities right now! Try following a user to get started</p>
|
|
|
|
{% endif %}
|
2020-09-30 00:43:30 +00:00
|
|
|
{% for activity in activities %}
|
|
|
|
<div class="block">
|
|
|
|
{% include 'snippets/status.html' with status=activity %}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
2020-02-23 22:26:03 +00:00
|
|
|
|
2021-01-13 17:42:54 +00:00
|
|
|
{% include 'snippets/pagination.html' with page=activities path='/'|add:tab anchor="#feed" %}
|
2020-09-30 00:43:30 +00:00
|
|
|
</div>
|
2020-09-29 17:21:10 +00:00
|
|
|
</div>
|
2020-01-25 23:25:19 +00:00
|
|
|
{% endblock %}
|