Prep for adding breadcrumbs (WIP).

This commit is contained in:
Christopher Charbonneau Wells 2017-10-20 10:32:27 -04:00
parent 701a18199f
commit 0038a34843
7 changed files with 42 additions and 20 deletions

View File

@ -15,7 +15,7 @@
<link rel="stylesheet" href="{% static "babyblotter/css/vendor.min.css" %}" />
{% endif %}
</head>
<body style="padding-top: 5rem;">
<body style="padding-top: 3rem;">
{% block nav %}{% endblock %}
{% block page %}{% endblock %}

View File

@ -0,0 +1,9 @@
{{ path }}
<nav aria-label="breadcrumb" role="navigation">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Children</a></li>
<li class="breadcrumb-item">Fake</li>
<li class="breadcrumb-item active" aria-current="page">Dashboard</li>
</ol>
</nav>

View File

@ -1,5 +1,5 @@
{% extends 'babyblotter/base.html' %}
{% load timers %}
{% load babyblotter timers %}
{% block nav %}
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
@ -153,4 +153,7 @@
{% endif %}
</div>
</nav>
{% breadcrumbs %}
{% endblock %}

View File

View File

@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import template
register = template.Library()
@register.inclusion_tag('babyblotter/breadcrumbs.html', takes_context=True)
def breadcrumbs(context):
request = context['request'] or None
# TODO: Process path and send breadcrumbs down.
return {'path': request.path}

View File

@ -2,7 +2,7 @@
{% block title %}
{% if request.resolver_match.url_name == 'child-update' %}
Update a Child
{{ object }}
{% else %}
Add a Child
{% endif %}

View File

@ -5,23 +5,19 @@
{% block content %}
<div class="rounded text-center pb-2">
<h1 class="display-4">{{ object }}</h1>
<div class="dropdown">
<button id="reports-dropdown"
class="btn btn-success dropdown-toggle"
type="button"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"><i class="icon icon-graph" aria-hidden="true"></i> Reports</button>
<div class="dropdown-menu" aria-labelledby="reports-dropdown">
<a class="dropdown-item" href="{% url 'reports:report-diaperchange-types-child' object.slug %}">Diaper Change Types</a>
<a class="dropdown-item" href="{% url 'reports:report-diaperchange-lifetimes-child' object.slug %}">Diaper Lifetimes</a>
<a class="dropdown-item" href="{% url 'reports:report-sleep-pattern-child' object.slug %}">Sleep Pattern</a>
<a class="dropdown-item" href="{% url 'reports:report-sleep-totals-child' object.slug %}">Sleep Totals</a>
<a class="dropdown-item" href="{% url 'reports:report-timeline-child' object.slug %}">Timeline</a>
</div>
<div class="dropdown">
<button id="reports-dropdown"
class="btn btn-success dropdown-toggle"
type="button"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"><i class="icon icon-graph" aria-hidden="true"></i> Reports</button>
<div class="dropdown-menu" aria-labelledby="reports-dropdown">
<a class="dropdown-item" href="{% url 'reports:report-diaperchange-types-child' object.slug %}">Diaper Change Types</a>
<a class="dropdown-item" href="{% url 'reports:report-diaperchange-lifetimes-child' object.slug %}">Diaper Lifetimes</a>
<a class="dropdown-item" href="{% url 'reports:report-sleep-pattern-child' object.slug %}">Sleep Pattern</a>
<a class="dropdown-item" href="{% url 'reports:report-sleep-totals-child' object.slug %}">Sleep Totals</a>
<a class="dropdown-item" href="{% url 'reports:report-timeline-child' object.slug %}">Timeline</a>
</div>
</div>