use build-in tera filters

This commit is contained in:
yggverse 2025-08-20 14:37:59 +03:00
parent c1ae25f04b
commit d95cee6c09
7 changed files with 51 additions and 53 deletions

View file

@ -10,8 +10,8 @@
<ul>
<li><span title="Indexed">{{ row.indexed }}</span></li>
{% if row.created %}<li><span title="Created">({{ row.created }})</span></li>{% endif %}
{% if row.size %}<li><span title="Size">{{ row.size }}</span></li>{% endif %}
<li><span title="Files">{{ row.files }}</span></li>
<li><span title="Size">{{ row.size | filesizeformat }}</span></li>
{% if row.files %}<li><span title="Files">{{ row.files }} file{{ row.files | pluralize(plural="s") }}</span></li>{% endif %}
{% if row.scrape %}
<li><span title="Seeders" class="seeders">{{ row.scrape.seeders }}</span></li>
<li><span title="Peers" class="peers">{{ row.scrape.peers }}</span></li>
@ -29,5 +29,9 @@
{% endif %}
{% if next %}<a href="{{ next }}">Next</a>{% endif %}
{% if back %}<a href="{{ back }}">Back</a>{% endif %}
{% if pagination_totals %}<span>{{ pagination_totals }}</span>{% endif %}
{% if total %}
<span>
Page {{ page }} / {{ pages }} ({{ total }} torrent{{ total | pluralize(plural="s") }} total)
</span>
{% endif %}
{% endblock content %}

View file

@ -6,9 +6,13 @@
<div>
<ul>
<li><span title="Indexed">{{ indexed }}</span></li>
{% if created %}<li><span title="Created">({{ created }})</span></li>{% endif %}
<li><span title="Size">{{ size }}</span></li>
<li><span title="Files">{{ files_total }}</span></li>
{% if created %}
<li><span title="Created">({{ created }})</span></li>
{% endif %}
<li><span title="Size">{{ size | filesizeformat }}</span></li>
{% if files_total %}
<li><span title="Files">{{ files_total }} file{{ files_total | pluralize(plural="s") }}</span></li>
{% endif %}
{% if scrape %}
<li><span title="Seeders" class="seeders">{{ scrape.seeders }}</span></li>
<li><span title="Peers" class="peers">{{ scrape.peers }}</span></li>
@ -38,7 +42,7 @@
{{ file.path }}
{% endif %}
</td>
<td>{{ file.size }}</td>
<td>{{ file.size | filesizeformat }}</td>
</tr>
{% endfor %}
</tbody>