adding middleware and use in readthrough template

This commit is contained in:
Pablo Barton
2021-03-29 08:20:35 -04:00
parent 224c7e4f0e
commit 765e6b542f
4 changed files with 21 additions and 3 deletions

View File

@ -1,5 +1,6 @@
{% load i18n %}
{% load humanize %}
{% load tz %}
<div class="content block">
<div id="hide-edit-readthrough-{{ readthrough.id }}">
<div class="columns">
@ -8,7 +9,7 @@
</dl>
<ul>
{% if readthrough.finish_date or readthrough.progress %}
<li>{% if readthrough.finish_date %} {{ readthrough.finish_date | naturalday }}: {% trans "finished" %} {% else %}{% if readthrough.progress_mode == 'PG' %}on page {{ readthrough.progress }}{% if book.pages %} of {{ book.pages }}{% endif %}
<li>{% if readthrough.finish_date %} {{ readthrough.finish_date | localtime | naturalday }}: {% trans "finished" %} {% else %}{% if readthrough.progress_mode == 'PG' %}on page {{ readthrough.progress }}{% if book.pages %} of {{ book.pages }}{% endif %}
{% else %}{{ readthrough.progress }}%{% endif %}{% endif %}
{% if readthrough.progress %}
{% trans "Show all updates" as button_text %}
@ -37,7 +38,7 @@
{% endif %}
</li>
{% endif %}
<li>{{ readthrough.start_date | naturalday }}: {% trans "started" %}</li>
<li>{{ readthrough.start_date | localtime | naturalday }}: {% trans "started" %}</li>
</ul>
</div>
<div class="column is-narrow">