Make the dashboard cards layout more opinionated.

This puts all the "last" cards in one row consistently, assuming that the tummy time and diaper change cards should always have fairly large heights. The shifting heights were causing cards to appear in different places with the masonry setup.
This commit is contained in:
Christopher Charbonneau Wells 2017-08-21 19:53:21 -04:00
parent 51946dd28a
commit faaa67995f
3 changed files with 21 additions and 9 deletions

View File

@ -3,7 +3,7 @@
{% block header %}Diaper Changes{% endblock %}
{% block title %}
<strong>Past 5 Days</strong>
<strong>Past Week</strong>
{% endblock %}
{% block content %}

View File

@ -5,12 +5,24 @@
{% block content %}
<h1 class="text-center">{{ object }}</h1>
<div class="card-columns">
{% card_feeding_last object %}
{% card_diaperchange_last object %}
{% card_tummytime_last object %}
{% card_tummytime_day object %}
{% card_sleep_last object %}
{% card_diaperchange_types object %}
<div class="row align-items-start">
<div class="col-lg-4 col-sm-12">
<div class="row">
<div class="col-lg-12 col-sm-6">
{% card_diaperchange_last object %}
{% card_feeding_last object %}
</div>
<div class="col-lg-12 col-sm-6">
{% card_tummytime_last object %}
{% card_sleep_last object %}
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 col-sm-12">
{% card_tummytime_day object %}
</div>
<div class="col-lg-4 col-md-6 col-sm-12">
{% card_diaperchange_types object %}
</div>
</div>
{% endblock %}

View File

@ -29,7 +29,7 @@ def card_diaperchange_last(child):
def card_diaperchange_types(child):
"""Diaper change statistics for the last seven days including today."""
stats = OrderedDict()
for x in range(0, 5):
for x in range(0, 7):
date = (timezone.now() - timezone.timedelta(days=x)).date()
stats[date] = {'wet': 0, 'solid': 0}