feat: book progress bars
This commit is contained in:
parent
cc2ca7d134
commit
d31ce9b2cd
6 changed files with 24 additions and 5 deletions
|
@ -38,7 +38,13 @@ schema: book
|
|||
{% if book.author %}
|
||||
<p class="sub-meta">By {{ book.author }}</p>
|
||||
{% endif %}
|
||||
{% if book.status == 'finished' %}<p class="sub-meta">Finished on: {{ book.date | date: "%B %e, %Y" }}</p>{% endif %}
|
||||
{% if book.status == 'finished' %}
|
||||
<p class="sub-meta">Finished on: {{ book.date | date: "%B %e, %Y" }}</p>
|
||||
{% endif %}
|
||||
{% unless book.status == 'finished' %}
|
||||
{%- assign percentage = book.progress | append: '%' -%}
|
||||
{% render "partials/media/progress-bar.liquid", percentage:percentage %}
|
||||
{% endunless %}
|
||||
<p class="sub-meta"><a href="https://openlibrary.org/isbn/{{ book.isbn }}" title="View {{ book.title | escape }} on Open Library">View on Open Library</a></p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -44,6 +44,10 @@ schema: books
|
|||
{% if book.author %}
|
||||
<p class="sub-meta">By {{ book.author }}</p>
|
||||
{% endif %}
|
||||
{% if book.progress %}
|
||||
{%- assign percentage = book.progress | append: '%' -%}
|
||||
{% render "partials/media/progress-bar.liquid", percentage:percentage %}
|
||||
{% endif %}
|
||||
{% if book.description %}<blockquote class="description">{{ book.description }}</blockquote>{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
|
|
Reference in a new issue