diff --git a/dashboard/templates/cards/feeding_last_method.html b/dashboard/templates/cards/feeding_last_method.html new file mode 100644 index 00000000..ab96b245 --- /dev/null +++ b/dashboard/templates/cards/feeding_last_method.html @@ -0,0 +1,15 @@ +{% extends 'cards/feeding.html' %} + +{% block header %}Last Feeding Method{% endblock %} + +{% block title %} +

{{ feeding.method }}

+{% endblock %} + +{% block content %} + {% if feeding.amount %} +
Amount: {{ feeding.amount }}oz.
+ {% endif %} +{% endblock %} + +{% block footer %}{{ feeding.end }}{% endblock %} \ No newline at end of file diff --git a/dashboard/templates/dashboard/child.html b/dashboard/templates/dashboard/child.html index e9bc07c2..94897946 100644 --- a/dashboard/templates/dashboard/child.html +++ b/dashboard/templates/dashboard/child.html @@ -32,19 +32,20 @@
- {% card_diaperchange_last object %} {% card_feeding_last object %} + {% card_feeding_last_method object %}
- {% card_tummytime_last object %} {% card_sleep_last object %}
+ {% card_tummytime_last object %} {% card_tummytime_day object %}
+ {% card_diaperchange_last object %} {% card_diaperchange_types object %}
diff --git a/dashboard/templatetags/dashboard.py b/dashboard/templatetags/dashboard.py index 6871f1ca..4087151c 100644 --- a/dashboard/templatetags/dashboard.py +++ b/dashboard/templatetags/dashboard.py @@ -20,6 +20,14 @@ def card_feeding_last(child): return {'feeding': instance} +@register.inclusion_tag('cards/feeding_last_method.html') +def card_feeding_last_method(child): + """Information about the most recent feeding _method_. + """ + instance = Feeding.objects.filter(child=child).order_by('-end').first() + return {'feeding': instance} + + @register.inclusion_tag('cards/diaperchange_last.html') def card_diaperchange_last(child): """Information about the most recent diaper change.