Commit 528bf212 authored by David Seaward's avatar David Seaward

update profile links to a simple tree

parent 6c8ea6e6
...@@ -108,8 +108,17 @@ SPDX-License-Identifier: AGPL-3.0 ...@@ -108,8 +108,17 @@ SPDX-License-Identifier: AGPL-3.0
<nav> <nav>
<ul> <ul>
{% for name, link in link_profile_dict %} {% for section, link_ordered_dict in link_profile_ordered_dict.items() %}
<li><a href="{{ link }}" class="page">{{ name }}</a> <li>
{{ section }}
<ul>
{% for name, link in link_ordered_dict.items() %}
<li><a href="{{ link }}" class="page">{{ name }}</a></li>
{% endfor %}
</ul>
</li>
{% endfor %} {% endfor %}
</ul> </ul>
......
...@@ -32,7 +32,7 @@ def userlimit(request): ...@@ -32,7 +32,7 @@ def userlimit(request):
"limits": limits, "limits": limits,
"has_limit": has_limit, "has_limit": has_limit,
"link_subscription": settings.LINK_SUBSCRIPTION, "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) return render(request, 'limitmonitor/userlimit.html', render_data)
......
...@@ -17,8 +17,7 @@ config = Config(RepositoryIni(CONFIG_PATH)) ...@@ -17,8 +17,7 @@ config = Config(RepositoryIni(CONFIG_PATH))
secret_config = Config(RepositoryIni(SECRET_PATH)) secret_config = Config(RepositoryIni(SECRET_PATH))
with open(LINK_PROFILE_PATH, 'r') as stream: with open(LINK_PROFILE_PATH, 'r') as stream:
data = strictyaml.load(stream.read()).data LINK_PROFILE_ORDERED_DICT = strictyaml.load(stream.read()).data
LINK_PROFILE_DICT = sorted(data.items())
# #
# SECURITY # 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