diff options
author | 2018-04-12 16:28:54 +0100 | |
---|---|---|
committer | 2018-04-12 16:28:54 +0100 | |
commit | deb1cb5d24c3d483d27c7bab8abb0383c25d5323 (patch) | |
tree | 3b53b458444951c094322d03824608fc879d242e /templates/wiki | |
parent | [Wiki] Fix dodgy staff edit redirect query param (diff) |
[Wiki] Some excellent shitcode for document TOCs
Diffstat (limited to 'templates/wiki')
-rw-r--r-- | templates/wiki/base.html | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/templates/wiki/base.html b/templates/wiki/base.html index e400be02..60f031b9 100644 --- a/templates/wiki/base.html +++ b/templates/wiki/base.html @@ -33,6 +33,26 @@ <div class="uk-flex uk-flex-row uk-flex-1"> <div class="uk-card uk-card-body uk-flex-left uk-flex uk-card-primary"> <ul class="uk-nav-default uk-nav-parent-icon" uk-nav> + {% if data is defined %} + {% if "headers" in data %} + <li class="uk-nav-header">Contents</li> + {% for header in data.headers %} + {% if "sub_headers" in header %} + <li class="uk-parent"> + <a href="{{ header.id }}">{{ header.title }}</a> + <ul class="uk-nav-sub"> + {% for sub in header.sub_headers %} + <li><a href="{{ sub.id }}"><i class="uk-icon fas fa-diamond fa-fw" style="font-size: 0.5rem; vertical-align: 1px"></i> {{ sub.title }}</a></li> + {% endfor %} + </ul> + </li> + {% else %} + <li><a href="{{ header.id }}">{{ header.title }}</a></li> + {% endif %} + {% endfor %} + {% endif %} + <li class="uk-nav-divider"></li> + {% endif %} <li><a href="{{ url_for("wiki.page", page="home") }}"> <i class="uk-icon fas fa-fw fa-home"></i> Home </a></li> |