2016-07-31 19:36:13 +00:00
|
|
|
{% extends 'master.twig' %}
|
2016-07-29 19:31:36 +00:00
|
|
|
|
|
|
|
{% set title = category ~ ' / ' ~ mode %}
|
|
|
|
|
2016-09-22 20:14:28 +00:00
|
|
|
{% block js %}
|
|
|
|
<script>
|
|
|
|
function updateSettings(form, action, text) {
|
|
|
|
var forms = {},
|
|
|
|
dialogue = new Sakura.Dialogue,
|
|
|
|
updater = new Sakura.AJAX;
|
|
|
|
|
|
|
|
dialogue.AddCallback(Sakura.DialogueButton.Ok, function () {
|
|
|
|
this.Close();
|
|
|
|
});
|
|
|
|
|
|
|
|
for (var a = 0; a < form.elements.length; a++) {
|
|
|
|
forms[form.elements.item(a).name] = form.elements.item(a).value;
|
|
|
|
}
|
|
|
|
|
|
|
|
updater.SetUrl(action);
|
|
|
|
updater.Form();
|
|
|
|
updater.SetSend(forms);
|
|
|
|
updater.AddCallback(0, function () {
|
|
|
|
var resp = updater.JSON();
|
2016-12-08 23:10:56 +00:00
|
|
|
dialogue.Title = resp.error ? "Error" : "Information";
|
2016-09-22 20:14:28 +00:00
|
|
|
dialogue.Text = resp.error || text || 'Updated!';
|
|
|
|
dialogue.Display();
|
|
|
|
});
|
|
|
|
updater.Start(Sakura.HTTPMethod.POST);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
function updateSettingsConfirm(form, action) {
|
|
|
|
var dialogue = new Sakura.Dialogue;
|
2016-12-08 23:10:56 +00:00
|
|
|
dialogue.Title = "Confirmation";
|
2016-09-22 20:14:28 +00:00
|
|
|
dialogue.Text = "Are you sure?";
|
|
|
|
dialogue.SetType(Sakura.DialogueType.Confirm);
|
|
|
|
dialogue.AddCallback(Sakura.DialogueButton.No, function () {
|
|
|
|
this.Close();
|
|
|
|
});
|
|
|
|
dialogue.AddCallback(Sakura.DialogueButton.Yes, function () {
|
|
|
|
updateSettings(form, action);
|
|
|
|
this.Close();
|
|
|
|
});
|
|
|
|
dialogue.Display();
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|
|
|
|
|
2016-07-29 19:31:36 +00:00
|
|
|
{% block content %}
|
2016-11-09 18:32:23 +00:00
|
|
|
<div class="content settings">
|
2016-11-10 22:32:45 +00:00
|
|
|
<div class="content--right settings--right">
|
2016-11-09 18:32:23 +00:00
|
|
|
<div class="content__header content__header--alt">
|
2016-09-10 13:47:27 +00:00
|
|
|
Navigation
|
|
|
|
</div>
|
2016-11-10 22:32:45 +00:00
|
|
|
<div class="settings__navigation">
|
2016-11-09 18:32:23 +00:00
|
|
|
{% for name, links in navigation %}
|
2016-11-10 22:32:45 +00:00
|
|
|
<div class="settings__navigation-header">{{ name }}</div>
|
|
|
|
{% for name,link in links %}
|
|
|
|
<a href="{{ link }}" class="settings__navigation-link">{{ name }}</a>
|
2016-09-10 13:47:27 +00:00
|
|
|
{% endfor %}
|
2016-07-29 19:31:36 +00:00
|
|
|
{% endfor %}
|
2016-09-10 13:47:27 +00:00
|
|
|
</div>
|
2016-07-29 19:31:36 +00:00
|
|
|
</div>
|
2016-11-10 22:32:45 +00:00
|
|
|
<div class="content--left settings--left">
|
2016-11-09 18:32:23 +00:00
|
|
|
<div class="content__header">{{ title }}</div>
|
2016-11-10 22:32:45 +00:00
|
|
|
<div class="settings__explanation">{{ block('description') }}</div>
|
2016-09-10 13:47:27 +00:00
|
|
|
{{ block('settingsContent') }}
|
|
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
2016-07-29 19:31:36 +00:00
|
|
|
</div>
|
|
|
|
{% endblock %}
|