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

68 lines
2.2 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) {
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 %}
{% 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 %}