Adds breadcrumbs and navigation, moves QR code to its own page.
This commit is contained in:
parent
d9f4c6d597
commit
947b4ac59a
7 changed files with 93 additions and 27 deletions
15
app/templates/breadcrumbs.html
Normal file
15
app/templates/breadcrumbs.html
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<div class="breadcrumbs">
|
||||
<nav class="breadcrumb" aria-label="breadcrumbs">
|
||||
{% set ns = namespace(crumb_path=request.url_root[:-1])%}
|
||||
{# We use a namespace since jinja 2 variables cannot persist outside loops
|
||||
The crumb_path var dynamically constructs urls for each breadcrumb based on request.path (removing the trailing slash),
|
||||
We need to do this for the file viewer, as it can have many nested directories, but works for all other pages. #}
|
||||
<ul>
|
||||
{% set breadcrumbs = request.path[1:].split('/') %} {# request.path starts with / #}
|
||||
{% for crumb in breadcrumbs %}
|
||||
{% set ns.crumb_path = ns.crumb_path + "/" +crumb %}
|
||||
<li><a href="{{ ns.crumb_path }}">{{crumb}}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue