Commit f9108547 authored by David Seaward's avatar David Seaward Committed by Gogs

Merge branch 'profile_link_tree' of david.seaward/purist_middleware into master

parents 6c8ea6e6 528bf212
......@@ -108,8 +108,17 @@ SPDX-License-Identifier: AGPL-3.0
<nav>
<ul>
{% for name, link in link_profile_dict %}
<li><a href="{{ link }}" class="page">{{ name }}</a>
{% for section, link_ordered_dict in link_profile_ordered_dict.items() %}
<li>
{{ section }}
<ul>
{% for name, link in link_ordered_dict.items() %}
<li><a href="{{ link }}" class="page">{{ name }}</a></li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
......
......@@ -32,7 +32,7 @@ def userlimit(request):
"limits": limits,
"has_limit": has_limit,
"link_subscription": settings.LINK_SUBSCRIPTION,
"link_profile_dict": settings.LINK_PROFILE_DICT,
"link_profile_ordered_dict": settings.LINK_PROFILE_ORDERED_DICT,
}
return render(request, 'limitmonitor/userlimit.html', render_data)
......
......@@ -17,8 +17,7 @@ config = Config(RepositoryIni(CONFIG_PATH))
secret_config = Config(RepositoryIni(SECRET_PATH))
with open(LINK_PROFILE_PATH, 'r') as stream:
data = strictyaml.load(stream.read()).data
LINK_PROFILE_DICT = sorted(data.items())
LINK_PROFILE_ORDERED_DICT = strictyaml.load(stream.read()).data
#
# SECURITY
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment