mirror of https://github.com/snachodog/mybuddy.git
87 lines
3.4 KiB
HTML
87 lines
3.4 KiB
HTML
{% extends 'babybuddy/page.html' %}
|
|
{% load duration i18n timers %}
|
|
|
|
{% block title %}{{ object }}{% endblock %}
|
|
|
|
{% block breadcrumbs %}
|
|
<li class="breadcrumb-item"><a href="{% url 'core:timer-list' %}">{% trans "Timers" %}</a></li>
|
|
<li class="breadcrumb-item font-weight-bold">{{ object }}</li>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="jumbotron text-center">
|
|
|
|
<div class="h1{% if not object.active %} timer-stopped{% endif %}" id="timer-status">
|
|
<span class="timer-hours">{{ object.duration|hours }}</span>h
|
|
<span class="timer-minutes">{{ object.duration|minutes }}</span>m
|
|
<span class="timer-seconds">{{ object.duration|seconds }}</span>s
|
|
</div>
|
|
<p class="lead text-secondary">
|
|
{% trans "Started" %} {{ object.start }}
|
|
{% if not object.active %}
|
|
/ {% trans "Stopped" %} {{ object.end }}
|
|
{% endif %}
|
|
</p>
|
|
<p class="text-muted">
|
|
{% blocktrans %}{{ timer }} created by {{ object.user }}{% endblocktrans %}
|
|
</p>
|
|
|
|
{% if perms.core.add_feeding %}
|
|
<a class="btn btn-success btn-lg btn-block mb-3"
|
|
href="{% url 'core:feeding-add' %}?timer={{ timer.id }}"
|
|
role="button"><i class="icon icon-feeding" aria-hidden="true"></i>
|
|
{% trans "Feeding" %}
|
|
</a>
|
|
{% endif %}
|
|
|
|
{% if perms.core.add_sleep %}
|
|
<a class="btn btn-success btn-lg btn-block mb-3"
|
|
href="{% url 'core:sleep-add' %}?timer={{ timer.id }}"
|
|
role="button"><i class="icon icon-sleep" aria-hidden="true"></i>
|
|
{% trans "Sleep" %}
|
|
</a>
|
|
{% endif %}
|
|
|
|
{% if perms.core.add_tummytime %}
|
|
<a class="btn btn-success btn-lg btn-block mb-3"
|
|
href="{% url 'core:tummytime-add' %}?timer={{ timer.id }}"
|
|
role="button"><i class="icon icon-tummytime" aria-hidden="true"></i>
|
|
{% trans "Tummy Time" %}
|
|
</a>
|
|
{% endif %}
|
|
|
|
<div class="btn-group btn-group-lg center-block" role="group" aria-label="{% trans "Timer actions" %}">
|
|
|
|
{% if perms.core.delete_timer %}
|
|
<a class="btn btn-danger"
|
|
href="{% url 'core: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 'core:timer-update' timer.id %}"
|
|
role="button"><i class="icon icon-update" aria-hidden="true"></i></a>
|
|
|
|
<a class="btn btn-secondary"
|
|
href="{% url 'core: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 'core: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">
|
|
BabyBuddy.Timer.run({{ timer.id }}, 'timer-status');
|
|
</script>
|
|
{% endif %}
|
|
{% endblock %} |