2021-02-01 19:34:08 +00:00
{% extends 'user/user_layout.html' %}
2021-02-28 02:48:10 +00:00
{% load i18n %}
2021-01-16 19:34:19 +00:00
2021-02-01 19:34:08 +00:00
{% block header %}
< div class = "columns is-mobile" >
< div class = "column" >
2021-02-27 22:22:39 +00:00
< h1 class = "title" > {% blocktrans %}{{ year }} Reading Progress{% endblocktrans %}< / h1 >
2021-02-01 19:34:08 +00:00
< / div >
{% if is_self and goal %}
< div class = "column is-narrow" >
2021-03-01 01:10:30 +00:00
{% trans "Edit Goal" as button_text %}
{% include 'snippets/toggle/open_button.html' with text=button_text icon="pencil" controls_text="show-edit-goal" focus="edit-form-header" %}
2021-02-01 19:34:08 +00:00
< / div >
{% endif %}
< / div >
{% endblock %}
{% block panel %}
2021-01-16 19:34:19 +00:00
< section class = "block" >
2021-01-16 20:39:51 +00:00
{% if user == request.user %}
< div class = "block" >
2021-01-17 16:26:28 +00:00
{% now 'Y' as year %}
< section class = "card {% if goal %}hidden{% endif %}" id = "show-edit-goal" >
< header class = "card-header" >
< h2 class = "card-header-title has-background-primary has-text-white" tabindex = "0" id = "edit-form-header" >
2021-02-28 18:09:56 +00:00
< span class = "icon icon-book is-size-3 mr-2" aria-hidden = "true" > < / span > {% blocktrans %}{{ year }} Reading Goal{% endblocktrans %}
2021-01-17 16:26:28 +00:00
< / h2 >
< / header >
< section class = "card-content content" >
2021-02-27 22:22:39 +00:00
< p > {% blocktrans %}Set a goal for how many books you'll finish reading in {{ year }}, and track your progress throughout the year.{% endblocktrans %}< / p >
2021-01-16 20:39:51 +00:00
2021-01-17 16:26:28 +00:00
{% include 'snippets/goal_form.html' with goal=goal year=year %}
2021-01-16 22:33:43 +00:00
< / section >
2021-01-17 16:26:28 +00:00
< / section >
2021-01-16 20:39:51 +00:00
< / 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-02-28 02:48:10 +00:00
< p > {% blocktrans with name=user.display_name %}{{ name }} hasn't set a reading goal for {{ year }}.{% endblocktrans %}< / 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 %}
2021-02-01 19:34:08 +00:00
< section class = "content" >
2021-03-01 01:10:30 +00:00
< h2 >
{% if goal.user == request.user %}
{% blocktrans %}Your {{ year }} Books{% endblocktrans %}
{% else %}
{% blocktrans with username=goal.user.display_name %}{{ username }}'s {{ year }} Books{% endblocktrans %}
{% endif %}
< / h2 >
2021-01-16 19:34:19 +00:00
< div class = "columns is-multiline" >
{% for book in goal.books %}
< div class = "column is-narrow" >
< div class = "box" >
< a href = "{{ book.book.local_path }}" >
2021-02-24 06:07:13 +00:00
{% include 'discover/small-book.html' with book=book.book rating=goal.ratings %}
2021-01-16 19:34:19 +00:00
< / a >
< / div >
< / div >
{% endfor %}
< / div >
< / section >
{% endif %}
{% endblock %}