This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/resources/views/yuuno/settings/master.twig

67 lines
2.2 KiB
Twig

{% extends '@yuuno/master.twig' %}
{% set title = category ~ ' / ' ~ mode %}
{% block js %}
<script>
function updateSettings(form, action, text) {
var dialogue = new Sakura.Dialogue,
updater = new Sakura.AJAX;
updater.SetUrl(action);
updater.SetFormData(new FormData(form));
updater.AddCallback(0, function () {
var resp = updater.JSON();
dialogue.Title = resp.error ? "Error" : "Information";
dialogue.Text = resp.error || text || 'Updated!';
dialogue.AddCallback(Sakura.DialogueButton.Ok, function () {
if (resp.go) {
window.location.assign(resp.go);
}
this.Close();
});
dialogue.Display();
});
updater.Start(Sakura.HTTPMethod.POST);
return false;
}
function updateSettingsConfirm(form, action) {
var dialogue = new Sakura.Dialogue;
dialogue.Title = "Confirmation";
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 %}
{% block content %}
<div class="content settings">
<div class="content--right settings--right">
<div class="content__header content__header--alt">
Navigation
</div>
<div class="settings__navigation">
{% for name, links in navigation %}
<div class="settings__navigation-header">{{ name }}</div>
{% for name,link in links %}
<a href="{{ link }}" class="settings__navigation-link">{{ name }}</a>
{% endfor %}
{% endfor %}
</div>
</div>
<div class="content--left settings--left">
<div class="content__header">{{ title }}</div>
<div class="settings__explanation">{{ block('description') }}</div>
{{ block('settingsContent') }}
</div>
<div class="clear"></div>
</div>
{% endblock %}