{% extends "site_settings/base.html" %}

{% load site_setting_tags %}
{% load base_filters %}

{% block title %}Settings{% endblock %}

{% block body %}
{% settings_nav request.user %}

{% regroup settings by scope_category as settings_list %}
{% for settings in settings_list %}
	<h2 id="id_{{ settings.grouper }}">{{ settings.grouper|capfirst }}</h2>
    <ul>
    	{% for setting in settings.list|dictsort:"label" %}
            {% url setting.permalink setting.scope setting.scope_category setting.name|format_string:"#id_%s" as permalink %}
    		{% if not setting.client_editable %}
    			{% if user.is_superuser %}
        			<li><a href="{{ permalink }}">{{ setting.label }}</a></li>
        		{% endif %}
        	{% else %}
        		<li><a href="{{ permalink }}">{{ setting.label }}</a></li>
        	{% endif %}
        {% endfor %}
    </ul>
    {% empty %}
    <p>No settings are currently available</p>
{% endfor %}  

{% endblock %}