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" %}" /> <link rel="stylesheet" href="{% static "babyblotter/css/vendor.min.css" %}" />
{% endif %} {% endif %}
</head> </head>
<body style="padding-top: 5rem;"> <body style="padding-top: 3rem;">
{% block nav %}{% endblock %} {% block nav %}{% endblock %}
{% block page %}{% 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' %} {% extends 'babyblotter/base.html' %}
{% load timers %} {% load babyblotter timers %}
{% block nav %} {% block nav %}
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top"> <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
@ -153,4 +153,7 @@
{% endif %} {% endif %}
</div> </div>
</nav> </nav>
{% breadcrumbs %}
{% endblock %} {% 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 %} {% block title %}
{% if request.resolver_match.url_name == 'child-update' %} {% if request.resolver_match.url_name == 'child-update' %}
Update a Child {{ object }}
{% else %} {% else %}
Add a Child Add a Child
{% endif %} {% endif %}

View File

@ -5,9 +5,6 @@
{% block content %} {% block content %}
<div class="rounded text-center pb-2">
<h1 class="display-4">{{ object }}</h1>
<div class="dropdown"> <div class="dropdown">
<button id="reports-dropdown" <button id="reports-dropdown"
class="btn btn-success dropdown-toggle" class="btn btn-success dropdown-toggle"
@ -23,7 +20,6 @@
<a class="dropdown-item" href="{% url 'reports:report-timeline-child' object.slug %}">Timeline</a> <a class="dropdown-item" href="{% url 'reports:report-timeline-child' object.slug %}">Timeline</a>
</div> </div>
</div> </div>
</div>
<div class="row align-items-start mt-4"> <div class="row align-items-start mt-4">
<div class="col-lg-4 col-md-6 col-sm-12"> <div class="col-lg-4 col-md-6 col-sm-12">