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

74 lines
2.4 KiB
Twig
Raw Normal View History

2016-07-31 19:36:13 +00:00
{% extends 'master.twig' %}
{% 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 %}
{% 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">
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>
{% endfor %}
{% endfor %}
</div>
</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>
{{ block('settingsContent') }}
</div>
<div class="clear"></div>
</div>
{% endblock %}