Add active timers to children dashboard (#73)

This commit is contained in:
Christopher C. Wells 2020-01-04 06:14:40 -08:00
parent 1798707271
commit fc820eb242
2 changed files with 30 additions and 23 deletions

View File

@ -1,6 +1,6 @@
{% load i18n %}
<div class="child-actions btn-group btn-group-lg center-block" role="group" aria-label="{% trans "Child actions" %}">
<div class="child-actions btn-group btn-group-md center-block" role="group" aria-label="{% trans "Child actions" %}">
{% if perms.core.view_child %}
<a href="{% url 'dashboard:dashboard-child' object.slug %}" class="btn btn-success">

View File

@ -1,5 +1,5 @@
{% extends 'babybuddy/page.html' %}
{% load i18n static thumbnail %}
{% load cards i18n static thumbnail %}
{% block title %}{% trans "Dashboard" %}{% endblock %}
@ -8,30 +8,37 @@
{% endblock %}
{% block content %}
<div class="row">
{% for object in objects %}
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-2 mb-4">
<div class="card">
<a class="text-center" href="{% url 'core:child' object.slug %}">
{% if object.picture %}
{% thumbnail object.picture 300x300 upscale crop as thumb %}
<img src="{{ thumb.url }}" class="child-photo img-fluid" />
{% else %}
<img src="{% static 'babybuddy/img/core/child-placeholder.png' %}" class="child-photo img-fluid" />
{% endif %}
</a>
<div class="card-body text-center">
<h4 class="card-title">{{ object }}</h4>
<div class="card-text">
<p class="lead">
{% trans "Born" %} <span class="text-secondary">{{ object.birth_date }}</span><br/>
{% trans "Age" %} <span class="text-secondary">{{ object.birth_date|timesince }}</span>
</p>
{% include 'dashboard/child_button_group.html' %}
<div class="row row-cols-2">
<div class="col-lg-4 col-md-4 col-sm-12">
{% card_timer_list %}
</div>
<div class="col-lg-8 col-md-8 col-sm-12">
<div class="row">
{% for object in objects %}
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-2 mb-4">
<div class="card">
<a class="text-center" href="{% url 'core:child' object.slug %}">
{% if object.picture %}
{% thumbnail object.picture 300x300 upscale crop as thumb %}
<img src="{{ thumb.url }}" class="child-photo img-fluid" />
{% else %}
<img src="{% static 'babybuddy/img/core/child-placeholder.png' %}" class="child-photo img-fluid" />
{% endif %}
</a>
<div class="card-body text-center">
<h4 class="card-title">{{ object }}</h4>
<div class="card-text">
<p>
{% trans "Born" %} <span class="text-secondary">{{ object.birth_date }}</span><br/>
{% trans "Age" %} <span class="text-secondary">{{ object.birth_date|timesince }}</span>
</p>
{% include 'dashboard/child_button_group.html' %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
{% endblock %}