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

{% load site_setting_tags %}
{% load i18n %}

{% block title %}{{ scope_category|title }} {% trans 'Settings' %}{% endblock %}

{% block extra_head %}
{{ block.super }}
<link rel="stylesheet" href="{{ STATIC_URL }}css/settings.css">
{% endblock%}

{% block body %}
{% settings_nav request.user scope_category %}
<h1>{{ scope_category|title }} {% trans 'Settings' %}</h1>
<form class="settings-form" method="post" enctype="multipart/form-data">{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Update Settings" name="submit" />
</form>
{% endblock %}

{% block extra_body %}
{{ block.super }}
<script type="text/javascript">
$(document).ready(function() {
    $('a.setting-toggle').click(function() {
        var id = $(this).attr('id').replace('toggle','');
        $('#description'+id).toggle();
        if ($("#toggle"+id+":contains('Show')").length > 0) {
        $(this).text($(this).text().replace('Show', 'Hide')); }
        else { $(this).text($(this).text().replace('Hide', 'Show')); }
    });
});
</script>
{% endblock extra_body %}