Commit b9f49270 authored by David Seaward's avatar David Seaward

add a dynamic flat list of URLs to the profile page

parent 0299715b
......@@ -104,6 +104,17 @@ SPDX-License-Identifier: AGPL-3.0
</ul>
</article>
<nav>
<ul>
{% for name, link in link_profile_dict %}
<li><a href="{{ link }}" class="page">{{ name }}</a>
{% endfor %}
</ul>
</nav>
</main>
<footer>
......
......@@ -32,6 +32,7 @@ def userlimit(request):
"limits": limits,
"has_limit": has_limit,
"link_subscription": settings.LINK_SUBSCRIPTION,
"link_profile_dict": settings.LINK_PROFILE_DICT,
}
return render(request, 'limitmonitor/userlimit.html', render_data)
......
import ldap
import strictyaml
from decouple import Config, Csv, RepositoryIni
from django_auth_ldap.config import LDAPSearch
......@@ -10,10 +11,15 @@ from .settings_original import *
CONFIG_PATH = '/etc/opt/purist/middleware/config.ini'
SECRET_PATH = '/etc/opt/purist/middleware/secret.ini'
LINK_PROFILE_PATH = '/etc/opt/purist/middleware/link_profile.strict.yml'
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())
#
# SECURITY
#
......
......@@ -13,8 +13,10 @@ ordereddict==1.1
pycparser==2.18
pyldap==2.4.37
PyNaCl==1.1.2
python-dateutil==2.6.1
pytz==2017.2
requests==2.18.4
ruamel.yaml==0.15.34
six==1.11.0
urllib3==1.22
vine==1.1.4
......@@ -14,4 +14,5 @@ jinja2-django-tags==0.5
paramiko==2.3.1
pyasn1==0.3.7
python-decouple==3.1
strictyaml==0.8.0
WooCommerce==1.2.1
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