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) {
|
2016-12-09 18:09:33 +00:00
|
|
|
var dialogue = new Sakura.Dialogue,
|
2016-09-22 20:14:28 +00:00
|
|
|
updater = new Sakura.AJAX;
|
|
|
|
|
|
|
|
updater.SetUrl(action);
|
2016-12-09 18:09:33 +00:00
|
|
|
updater.SetFormData(new FormData(form));
|
2016-09-22 20:14:28 +00:00
|
|
|
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!';
|
2016-12-09 18:09:33 +00:00
|
|
|
dialogue.AddCallback(Sakura.DialogueButton.Ok, function () {
|
|
|
|
if (resp.go) {
|
|
|
|
window.location.assign(resp.go);
|
|
|
|
}
|
|
|
|
|
|
|
|
this.Close();
|
|
|
|
});
|
2016-09-22 20:14:28 +00:00
|
|
|
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.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 %}
|