2021-04-30 15:40:47 +00:00
|
|
|
{% extends 'user/layout.html' %}
|
2021-02-28 02:48:10 +00:00
|
|
|
{% load i18n %}
|
2021-09-29 16:39:23 +00:00
|
|
|
{% load utilities %}
|
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 %}
|
2021-08-09 01:40:47 +00:00
|
|
|
{% include 'snippets/toggle/open_button.html' with text=button_text icon_with_text="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-08-04 19:05:24 +00:00
|
|
|
{% now 'Y' as current_year %}
|
2021-08-09 01:40:47 +00:00
|
|
|
{% if user == request.user and year|add:0 == current_year|add:0 %}
|
2021-09-29 16:39:23 +00:00
|
|
|
{% comparison_bool goal None as visible %}
|
|
|
|
{% include 'user/goal_form.html' with goal=goal year=year visible=visible controls_text="show_edit_goal" class="block" %}
|
2021-01-16 20:39:51 +00:00
|
|
|
{% 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-04-27 19:07:54 +00:00
|
|
|
<section>
|
|
|
|
<h2 class="title is-4">
|
2021-03-01 01:10:30 +00:00
|
|
|
{% 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-04-27 19:07:54 +00:00
|
|
|
|
|
|
|
<div class="columns is-mobile is-multiline">
|
2021-01-16 19:34:19 +00:00
|
|
|
{% for book in goal.books %}
|
2021-04-27 19:07:54 +00:00
|
|
|
<div class="column is-cover">
|
|
|
|
<a href="{{ book.book.local_path }}">
|
|
|
|
{% include 'snippets/book_cover.html' with book=book.book cover_class='is-h-xl is-h-l-mobile' %}
|
|
|
|
</a>
|
2021-01-16 19:34:19 +00:00
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|