2022-06-28 02:39:45 +00:00
|
|
|
{% extends 'cards/base.html' %}
|
|
|
|
{% load duration i18n %}
|
|
|
|
|
|
|
|
{% block header %}
|
|
|
|
<a href="{% url "core:sleep-list" %}">
|
|
|
|
{% trans "Recent Sleep" %}
|
|
|
|
</a>
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block title %}
|
|
|
|
{% if sleeps|length > 0 %}
|
2023-07-17 13:50:09 +00:00
|
|
|
<div id="sleep-days-carousel" class="carousel slide" data-bs-interval="false">
|
2022-06-28 02:39:45 +00:00
|
|
|
<div class="carousel-inner">
|
|
|
|
{% for sleep in sleeps %}
|
|
|
|
<div class="carousel-item{% if forloop.counter == 1 %} active{% endif %}">
|
|
|
|
<div class="last-sleep-method text-center">
|
|
|
|
{% if sleep.total %}
|
|
|
|
{{ sleep.total|duration_string:"m" }}
|
|
|
|
{% else %}
|
|
|
|
{% trans "None" %}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<div class="text-center small">
|
|
|
|
{% if sleep.count > 0 %}
|
|
|
|
{% blocktrans trimmed count counter=sleep.count %}
|
|
|
|
{{ counter }} sleep
|
|
|
|
{% plural %}
|
2023-10-14 13:19:32 +00:00
|
|
|
{{ counter }} sleeps
|
2022-06-28 02:39:45 +00:00
|
|
|
{% endblocktrans %}
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% blocktrans trimmed with since=sleep.date.date|dayssince %}
|
2023-07-09 16:26:13 +00:00
|
|
|
<div class="text-center small text-body-secondary">
|
2022-06-28 02:39:45 +00:00
|
|
|
{{ since }}
|
|
|
|
</div>
|
|
|
|
{% endblocktrans %}
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% if sleeps|length > 1 %}
|
2023-07-17 13:50:09 +00:00
|
|
|
<a class="carousel-control-prev" href="#sleep-days-carousel" role="button" data-bs-slide="prev">
|
2022-06-28 02:39:45 +00:00
|
|
|
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
2023-03-25 20:54:25 +00:00
|
|
|
<span class="visually-hidden">{% trans "Previous" %}</span>
|
2022-06-28 02:39:45 +00:00
|
|
|
</a>
|
2023-07-17 13:50:09 +00:00
|
|
|
<a class="carousel-control-next" href="#sleep-days-carousel" role="button" data-bs-slide="next">
|
2022-06-28 02:39:45 +00:00
|
|
|
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
2023-03-25 20:54:25 +00:00
|
|
|
<span class="visually-hidden">{% trans "Next" %}</span>
|
2022-06-28 02:39:45 +00:00
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
{% trans "None" %}
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|