mirror of https://github.com/snachodog/mybuddy.git
81 lines
3.1 KiB
HTML
81 lines
3.1 KiB
HTML
{% extends 'babybuddy/page.html' %}
|
|
{% load duration timers %}
|
|
|
|
{% block title %}{{ object }}{% endblock %}
|
|
|
|
{% block breadcrumbs %}
|
|
<li class="breadcrumb-item"><a href="{% url 'timer-list' %}">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">
|
|
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-secondary"
|
|
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">
|
|
BabyBuddy.Timer.run({{ timer.id }}, 'timer-status');
|
|
</script>
|
|
{% endif %}
|
|
{% endblock %} |