BirdNET-stream/www/templates/stats.html.twig

50 lines
2.0 KiB
Twig
Raw Normal View History

2022-08-15 11:42:28 +02:00
<div id="stats">
2022-08-16 05:21:53 +02:00
<h2>{{ "Quick Stats" | trans }}</h2>
2022-08-15 11:42:28 +02:00
<ul>
<li class="most-recorded-species">
{{ "Most recorded species" | trans }}:
{% if stats["most-recorded-species"] is defined and stats["most-recorded-species"]|length > 0 %}
2022-08-15 11:42:28 +02:00
<span class="scientific-name">
{{ stats["most-recorded-species"]["scientific_name"] }}
</span>
(<span class="common_name">{{ stats["most-recorded-species"]["common_name"] }}</span>)
{{ "with" | trans }}
<span class="observation-count">
{{ stats["most-recorded-species"]["contact_count"] }}
</span>
{{ "contacts" | trans }}.
{% else %}
{{ "No species in database." | trans }}
{% endif %}
2022-08-15 11:42:28 +02:00
</li>
<li class="last-recorded-species">
{{ "Last detected species" | trans }}:
{% if stats["last-detected-species"] is defined and stats["last-detected-species"]|length > 0 %}
2022-08-15 11:42:28 +02:00
<span class="scientific-name">
{{ stats["last-detected-species"]["scientific_name"] }}
</span>
(<span class="common_name">{{ stats["last-detected-species"]["common_name"] }}</span>)
{{ "with" | trans }}
<span class="confidence">
{{ stats["last-detected-species"]["confidence"] }}
</span>
{{ "AI confidence" | trans }}
<span class="datetime">
{% set date = stats["last-detected-species"]["date"] %}
{% if date | date("Y-m-d") == "now" | date("Y-m-d") %}
{{ "today" | trans }}
{% else %}
{{ "on" | trans }}
{{ date | format_datetime("full", "none") }}
{% endif %}
at
<span class="time">
{{ date | date("H:i") }}
</span>
</span>.
{% else %}
{{ "No species in database" | trans }}
{% endif %}
2022-08-15 11:42:28 +02:00
</li>
</ul>
</div>