Rudimentary but fully-functional entry permalink pages :3
This commit is contained in:
parent
d267df337f
commit
2b6691f8a5
13 changed files with 133 additions and 73 deletions
|
@ -1,7 +1,7 @@
|
|||
breadcrumbs = {}
|
||||
|
||||
|
||||
def add(route, label, parent=None):
|
||||
def add(route, label=None, parent=None):
|
||||
breadcrumbs[route] = {'label': label, 'route': route, 'parent': parent}
|
||||
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
</div>
|
||||
</nav>
|
||||
{% if request.resolver_match.view_name %}
|
||||
{% nav_crumbs request.resolver_match.view_name %}
|
||||
{% nav_crumbs request.resolver_match.view_name title %}
|
||||
{% endif %}
|
||||
</header>
|
||||
|
||||
|
|
|
@ -2,13 +2,9 @@
|
|||
<nav class="breadcrumbs" aria-label="breadcrumb" role="navigation">
|
||||
<ol class="breadcrumb">
|
||||
{% for crumb in crumbs %}
|
||||
<li class="breadcrumb-item">
|
||||
<a href="{% url crumb.route %}">{{ crumb.label }}</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item"><a href="{% url crumb.route %}">{{ crumb.label }}</a></li>
|
||||
{% endfor %}
|
||||
<li class="breadcrumb-item active" aria-current="page">
|
||||
{{ current.label }}
|
||||
</li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{% firstof current.label title %}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
{% endif %}
|
||||
|
|
|
@ -68,7 +68,7 @@ def nav_right(request):
|
|||
|
||||
|
||||
@register.inclusion_tag('lemoncurry/tags/breadcrumbs.html')
|
||||
def nav_crumbs(route):
|
||||
def nav_crumbs(route, title):
|
||||
crumbs = breadcrumbs.find(route)
|
||||
current = crumbs.pop()
|
||||
return {'crumbs': crumbs, 'current': current}
|
||||
return {'crumbs': crumbs, 'current': current, 'title': title}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue