mirror of https://github.com/snachodog/mybuddy.git
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:
parent
51946dd28a
commit
faaa67995f
|
@ -3,7 +3,7 @@
|
||||||
{% block header %}Diaper Changes{% endblock %}
|
{% block header %}Diaper Changes{% endblock %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
<strong>Past 5 Days</strong>
|
<strong>Past Week</strong>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
|
@ -5,12 +5,24 @@
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1 class="text-center">{{ object }}</h1>
|
<h1 class="text-center">{{ object }}</h1>
|
||||||
<div class="card-columns">
|
<div class="row align-items-start">
|
||||||
{% card_feeding_last object %}
|
<div class="col-lg-4 col-sm-12">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-12 col-sm-6">
|
||||||
{% card_diaperchange_last object %}
|
{% card_diaperchange_last object %}
|
||||||
|
{% card_feeding_last object %}
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-12 col-sm-6">
|
||||||
{% card_tummytime_last object %}
|
{% card_tummytime_last object %}
|
||||||
{% card_tummytime_day object %}
|
|
||||||
{% card_sleep_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 %}
|
{% card_diaperchange_types object %}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -29,7 +29,7 @@ def card_diaperchange_last(child):
|
||||||
def card_diaperchange_types(child):
|
def card_diaperchange_types(child):
|
||||||
"""Diaper change statistics for the last seven days including today."""
|
"""Diaper change statistics for the last seven days including today."""
|
||||||
stats = OrderedDict()
|
stats = OrderedDict()
|
||||||
for x in range(0, 5):
|
for x in range(0, 7):
|
||||||
date = (timezone.now() - timezone.timedelta(days=x)).date()
|
date = (timezone.now() - timezone.timedelta(days=x)).date()
|
||||||
stats[date] = {'wet': 0, 'solid': 0}
|
stats[date] = {'wet': 0, 'solid': 0}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue