mybuddy/core/templates/core/timer_detail.html

77 lines
2.9 KiB
HTML

{% extends 'babyblotter/page.html' %}
{% load timers %}
{% load duration %}
{% block title %}{{ object }}{% endblock %}
{% block content %}
<div class="jumbotron text-center{% if not object.active %} text-danger{% endif %}">
<div class="h1" id="timer-status">
<span class="timer-hours">{{ object.current_duration|hours }}</span>h
<span class="timer-minutes">{{ object.current_duration|minutes }}</span>m
<span class="timer-seconds">{{ object.current_duration|seconds }}</span>s
</div>
<p class="lead text-secondary">
Started {{ object.start }}
{% if not object.active %}
/ Stopped {{ object.end }}
{% endif %}
</p>
<p class="text-muted">
{{ timer }} created by {{ object.user }}
</p>
{% if perms.core.add_feeding %}
<a class="btn btn-success btn-lg btn-block mb-3"
href="{% url 'feeding-add' %}?timer={{ timer.id }}"
role="button"><i class="icon icon-feeding" aria-hidden="true"></i> Feeding</a>
{% endif %}
{% if perms.core.add_sleep %}
<a class="btn btn-success btn-lg btn-block mb-3"
href="{% url 'sleep-add' %}?timer={{ timer.id }}"
role="button"><i class="icon icon-sleep" aria-hidden="true"></i> Sleep</a>
{% endif %}
{% if perms.core.add_tummytime %}
<a class="btn btn-success btn-lg btn-block mb-3"
href="{% url 'tummytime-add' %}?timer={{ timer.id }}"
role="button"><i class="icon icon-tummytime" aria-hidden="true"></i> Tummy Time</a>
{% endif %}
<div class="btn-group btn-group-lg center-block" role="group" aria-label="Timer actions">
{% if perms.core.delete_timer %}
<a class="btn btn-danger"
href="{% url 'timer-delete' timer.id %}"
role="button"><i class="icon icon-delete" aria-hidden="true"></i></a>
{% endif %}
{% if perms.core.change_timer %}
<a class="btn btn-primary"
href="{% url 'timer-update' timer.id %}"
role="button"><i class="icon icon-update" aria-hidden="true"></i></a>
<a class="btn btn-dark"
href="{% url 'timer-restart' timer.id %}"
role="button"><i class="icon icon-refresh" aria-hidden="true"></i></a>
{% if object.active %}
<a class="btn btn-warning"
href="{% url 'timer-stop' timer.id %}"
role="button"><i class="icon icon-stop" aria-hidden="true"></i></a>
{% endif %}
{% endif %}
</div>
</div>
{% endblock %}
{% block javascript %}
{% if object.active %}
<script type="application/javascript">
BabyBlotter.Timer.run('timer-status');
</script>
{% endif %}
{% endblock %}