2021-01-16 19:34:19 +00:00
|
|
|
{% extends 'layout.html' %}
|
|
|
|
{% block content %}
|
|
|
|
|
|
|
|
<section class="block">
|
|
|
|
<h1 class="title">{{ year }} Reading Progress</h1>
|
2021-01-16 20:39:51 +00:00
|
|
|
{% if user == request.user %}
|
|
|
|
<div class="block">
|
|
|
|
{% if goal %}
|
|
|
|
<input type="radio" class="toggle-control" name="edit-goal" id="hide-edit-goal" checked>
|
|
|
|
<div class="toggle-content hidden">
|
|
|
|
{% include 'snippets/toggle/toggle_button.html' with text="Edit goal" controls_text="show-edit-goal" %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<div class="block">
|
2021-01-16 22:33:43 +00:00
|
|
|
<input type="radio" class="toggle-control" name="edit-goal" id="show-edit-goal" data-hover-target="edit-form-header">
|
2021-01-16 20:39:51 +00:00
|
|
|
<div class="toggle-content{% if goal %} hidden{% endif %}">
|
|
|
|
{% now 'Y' as year %}
|
2021-01-16 22:33:43 +00:00
|
|
|
<section class="card">
|
2021-01-16 20:39:51 +00:00
|
|
|
<header class="card-header">
|
2021-01-16 22:33:43 +00:00
|
|
|
<h2 class="card-header-title has-background-primary has-text-white" tabindex="0" id="edit-form-header">
|
2021-01-16 20:39:51 +00:00
|
|
|
<span class="icon icon-book is-size-3 mr-2" aria-hidden="true"></span> {{ year }} reading goal
|
|
|
|
</h2>
|
|
|
|
</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' with goal=goal year=year %}
|
|
|
|
</section>
|
2021-01-16 22:33:43 +00:00
|
|
|
</section>
|
2021-01-16 20:39:51 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2021-01-16 19:34:19 +00:00
|
|
|
|
2021-01-16 20:39:51 +00:00
|
|
|
{% if not goal and user != request.user %}
|
2021-01-16 19:34:19 +00:00
|
|
|
<p>{{ user.display_name }} hasn't set a reading goal for {{ year }}.</p>
|
2021-01-16 20:39:51 +00:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if goal %}
|
2021-01-16 19:34:19 +00:00
|
|
|
{% include 'snippets/goal_progress.html' with goal=goal %}
|
|
|
|
{% endif %}
|
|
|
|
</section>
|
|
|
|
|
|
|
|
{% if goal.books %}
|
|
|
|
<section>
|
|
|
|
<h2 class="title">{% if goal.user == request.user %}Your{% else %}{{ goal.user.display_name }}'s{% endif %} {{ year }} Books</h2>
|
|
|
|
<div class="columns is-multiline">
|
|
|
|
{% for book in goal.books %}
|
|
|
|
<div class="column is-narrow">
|
|
|
|
<div class="box">
|
|
|
|
<a href="{{ book.book.local_path }}">
|
|
|
|
{% include 'snippets/discover/small-book.html' with book=book.book rating=goal.ratings %}
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|