bookwyrm-mastodon/bookwyrm/templates/snippets/goal_progress.html

25 lines
1.0 KiB
HTML
Raw Permalink Normal View History

2021-02-27 21:48:10 -05:00
{% load i18n %}
2021-02-11 11:24:20 -05:00
{% load humanize %}
{% with goal.progress as progress %}
2021-01-16 14:34:19 -05:00
<p>
{% if progress.percent >= 100 %}
{% trans "Success!" context "Goal successfully completed" %}
{% elif progress.percent %}
{% blocktrans with percent=progress.percent %}{{ percent }}% complete!{% endblocktrans %}
{% endif %}
{% if goal.user == request.user %}
{% blocktrans with read_count=progress.count|intcomma goal_count=goal.goal|intcomma path=goal.local_path %}You've read <a href="{{ path }}">{{ read_count }} of {{ goal_count}} books</a>.{% endblocktrans %}
{% else %}
{% blocktrans with username=goal.user.display_name read_count=progress.count|intcomma goal_count=goal.goal|intcomma path=goal.local_path %}{{ username }} has read <a href="{{ path }}">{{ read_count }} of {{ goal_count}} books</a>.{% endblocktrans %}
2021-01-16 14:34:19 -05:00
{% endif %}
</p>
2022-03-26 14:38:00 -04:00
<progress
class="progress is-large is-primary"
value="{{ progress.count }}"
max="{{ goal.goal }}"
aria-hidden="true"
>{{ progress.percent }}%</progress>
2021-01-16 14:34:19 -05:00
{% endwith %}