2019-12-16 13:58:10 +00:00
|
|
|
{% extends '_main.html' %}
|
|
|
|
{%- from 'settings_general.html' import settings_general with context %}
|
|
|
|
{%- from 'settings_subtitles.html' import settings_subtitles with context %}
|
|
|
|
{%- from 'settings_notifications.html' import settings_notifications with context %}
|
|
|
|
{%- from 'settings_radarr.html' import settings_radarr with context %}
|
|
|
|
{%- from 'settings_sonarr.html' import settings_sonarr with context %}
|
|
|
|
{%- from 'providers.html' import settings_providers1 with context %}
|
|
|
|
|
|
|
|
{% block title %}Settings - Bazarr{% endblock %}
|
|
|
|
{% block body %}
|
|
|
|
|
2019-12-27 22:15:56 +00:00
|
|
|
<div class="container-fluid">
|
|
|
|
<!-- ============================================================== -->
|
|
|
|
<!-- Bread crumb and right sidebar toggle -->
|
|
|
|
<!-- ============================================================== -->
|
|
|
|
<div class="row page-titles">
|
|
|
|
<div class="col-md-5 col-8 align-self-center">
|
|
|
|
<h3 class="text-themecolor m-b-0 m-t-0"><i class="fas fa-sync"></i></h3>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-7 col-4 align-self-center">
|
|
|
|
<div class="d-flex m-t-10 justify-content-end">
|
|
|
|
<div class="d-flex m-r-20 m-l-10 hidden-md-down">
|
|
|
|
<div class="chart-text m-r-10">
|
|
|
|
<h5 class="m-t-0 text-white">Some page settings</h5></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- ============================================================== -->
|
|
|
|
<!-- End Bread crumb and right sidebar toggle -->
|
|
|
|
<!-- ============================================================== -->
|
2019-12-16 13:58:10 +00:00
|
|
|
<form name="settings_form" id="settings_form" action="{{ base_url }}save_settings" method="post" class="ui form"
|
|
|
|
autocomplete="off">
|
2018-09-16 12:38:00 +00:00
|
|
|
<div id="form_validation_error" class="ui error message">
|
2019-12-16 13:58:10 +00:00
|
|
|
<p>Some fields are in error and you can't save settings until you have corrected them. Be sure to check
|
|
|
|
in
|
|
|
|
every tabs.</p>
|
2018-09-16 12:38:00 +00:00
|
|
|
</div>
|
|
|
|
<div class="ui top attached tabular menu">
|
|
|
|
<a class="tabs item active" data-tab="general">General</a>
|
|
|
|
<a class="tabs item" id="sonarr_tab" data-tab="sonarr">Sonarr</a>
|
|
|
|
<a class="tabs item" id="radarr_tab" data-tab="radarr">Radarr</a>
|
2019-05-30 03:45:33 +00:00
|
|
|
<a class="tabs item" data-tab="subtitles">Subtitles</a>
|
2018-09-16 12:38:00 +00:00
|
|
|
<a class="tabs item" data-tab="notifier">Notifications</a>
|
|
|
|
</div>
|
|
|
|
<div class="ui bottom attached tab segment active" data-tab="general">
|
2019-12-16 13:58:10 +00:00
|
|
|
<div class="ui container">
|
|
|
|
<button class="submit ui blue right floated button" type="submit" value="Submit"
|
|
|
|
form="settings_form">
|
|
|
|
Save
|
|
|
|
</button>
|
|
|
|
</div>
|
2019-11-28 11:34:37 +00:00
|
|
|
{% include 'settings_general.html' %}
|
2018-09-16 12:38:00 +00:00
|
|
|
</div>
|
|
|
|
<div class="ui bottom attached tab segment" data-tab="sonarr">
|
2019-12-16 13:58:10 +00:00
|
|
|
<div class="ui container">
|
|
|
|
<button class="submit ui blue right floated button" type="submit" value="Submit"
|
|
|
|
form="settings_form">
|
|
|
|
Save
|
|
|
|
</button>
|
|
|
|
</div>
|
2019-11-28 11:34:37 +00:00
|
|
|
{% include 'settings_sonarr.html' %}
|
2018-09-16 12:38:00 +00:00
|
|
|
</div>
|
|
|
|
<div class="ui bottom attached tab segment" data-tab="radarr">
|
2019-12-16 13:58:10 +00:00
|
|
|
<div class="ui container">
|
|
|
|
<button class="submit ui blue right floated button" type="submit" value="Submit"
|
|
|
|
form="settings_form">
|
|
|
|
Save
|
|
|
|
</button>
|
|
|
|
</div>
|
2019-11-28 11:34:37 +00:00
|
|
|
{% include 'settings_radarr.html' %}
|
2018-09-16 12:38:00 +00:00
|
|
|
</div>
|
2019-05-30 03:45:33 +00:00
|
|
|
<div class="ui bottom attached tab segment" data-tab="subtitles">
|
2019-12-16 13:58:10 +00:00
|
|
|
<div class="ui container">
|
|
|
|
<button class="submit ui blue right floated button" type="submit" value="Submit"
|
|
|
|
form="settings_form">
|
|
|
|
Save
|
|
|
|
</button>
|
|
|
|
</div>
|
2019-11-28 11:34:37 +00:00
|
|
|
{% include 'settings_subtitles.html' %}
|
2018-09-16 12:38:00 +00:00
|
|
|
</div>
|
|
|
|
<div class="ui bottom attached tab segment" data-tab="notifier">
|
2019-12-16 13:58:10 +00:00
|
|
|
<div class="ui container">
|
|
|
|
<button class="submit ui blue right floated button" type="submit" value="Submit"
|
|
|
|
form="settings_form">
|
|
|
|
Save
|
|
|
|
</button>
|
|
|
|
</div>
|
2019-11-28 11:34:37 +00:00
|
|
|
{% include 'settings_notifications.html' %}
|
2018-09-16 12:38:00 +00:00
|
|
|
</div>
|
2019-12-16 13:58:10 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{% endblock body %}
|
|
|
|
{% block tail %}
|
|
|
|
|
|
|
|
<script src="{{ url_for('static',filename='js/settings_validation.js') }}" type="text/javascript"></script>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
function getQueryVariable(variable) {
|
|
|
|
var query = window.location.search.substring(1);
|
|
|
|
var vars = query.split("&");
|
|
|
|
for (var i = 0; i < vars.length; i++) {
|
|
|
|
var pair = vars[i].split("=");
|
|
|
|
if (pair[0] == variable) {
|
|
|
|
return pair[1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return (false);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (getQueryVariable("saved") == 'true') {
|
|
|
|
new Noty({
|
|
|
|
text: 'Settings saved.',
|
|
|
|
timeout: 5000,
|
|
|
|
progressBar: false,
|
|
|
|
animation: {
|
|
|
|
open: null,
|
|
|
|
close: null
|
|
|
|
},
|
|
|
|
killer: true,
|
|
|
|
type: 'info',
|
|
|
|
layout: 'bottomRight',
|
|
|
|
theme: 'semanticui'
|
|
|
|
}).show();
|
|
|
|
}
|
|
|
|
|
|
|
|
$('.menu .item')
|
|
|
|
.tab()
|
|
|
|
;
|
|
|
|
|
|
|
|
$('a:not(.tabs), button:not(.cancel, .test, .no_loader)').on('click', function () {
|
|
|
|
$('#loader').addClass('active');
|
|
|
|
});
|
|
|
|
|
|
|
|
$('a[target="_blank"]').on('click', function () {
|
|
|
|
$('#loader').removeClass('active');
|
|
|
|
});
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
$('.form').form('validate form');
|
|
|
|
$('#loader').removeClass('active');
|
|
|
|
});
|
|
|
|
|
|
|
|
$(".form :input").on('change paste keyup focusout', function () {
|
|
|
|
$('.form').form('validate form');
|
|
|
|
$('#loader').removeClass('active');
|
|
|
|
});
|
|
|
|
|
|
|
|
// Don't move this part to settings_general.tpl as #settings_form is undefined in this template
|
2018-12-09 20:23:51 +00:00
|
|
|
if ($('#settings_proxy_type').val() === "None") {
|
2018-09-16 12:38:00 +00:00
|
|
|
$('.proxy_option').hide();
|
2018-12-09 20:23:51 +00:00
|
|
|
$('#settings_form').form('remove rule', 'settings_proxy_url', 'empty');
|
2019-05-30 10:33:35 +00:00
|
|
|
$('#settings_form').form('remove rule', 'settings_proxy_port', 'empty');
|
2018-12-09 20:23:51 +00:00
|
|
|
$('#settings_form').form('remove rule', 'settings_proxy_port', 'integer[1..65535]');
|
2018-09-16 12:38:00 +00:00
|
|
|
} else {
|
2019-12-16 13:58:10 +00:00
|
|
|
$('#settings_form').form('add rule', 'settings_proxy_url', {
|
|
|
|
rules: [{
|
|
|
|
type: 'empty',
|
|
|
|
prompt: '"General / Proxy settings / Hostname" must have a value'
|
|
|
|
}]
|
|
|
|
});
|
|
|
|
$('#settings_form').form('add rule', 'settings_proxy_port', {
|
|
|
|
rules: [{
|
|
|
|
type: 'empty',
|
|
|
|
prompt: '"General / Proxy settings / Port" must have a value'
|
|
|
|
}]
|
|
|
|
});
|
|
|
|
$('#settings_form').form('add rule', 'settings_proxy_port', {
|
|
|
|
rules: [{
|
|
|
|
type: 'integer[1..65535]',
|
|
|
|
prompt: '"General / Proxy settings / Port" must be an integer between 1 and 65535'
|
|
|
|
}]
|
|
|
|
});
|
2018-09-16 12:38:00 +00:00
|
|
|
}
|
2019-12-16 13:58:10 +00:00
|
|
|
|
|
|
|
// Don't move this part to settings_general.tpl as #settings_form is undefined in this template
|
|
|
|
$('#settings_proxy_type').dropdown('setting', 'onChange', function () {
|
|
|
|
if ($('#settings_proxy_type').val() === "None") {
|
|
|
|
$('.proxy_option').hide();
|
|
|
|
$('#settings_form').form('remove rule', 'settings_proxy_url', 'empty');
|
|
|
|
$('#settings_form').form('remove rule', 'settings_proxy_port', 'empty');
|
|
|
|
$('#settings_form').form('remove rule', 'settings_proxy_port', 'integer[1..65535]');
|
|
|
|
$('.form').form('validate form');
|
|
|
|
$('#loader').removeClass('active');
|
|
|
|
} else {
|
|
|
|
$('.proxy_option').show();
|
|
|
|
$('#settings_form').form('add rule', 'settings_proxy_url', {
|
|
|
|
rules: [{
|
|
|
|
type: 'empty',
|
|
|
|
prompt: '"General / Proxy settings / Hostname" must have a value'
|
|
|
|
}]
|
|
|
|
});
|
|
|
|
$('#settings_form').form('add rule', 'settings_proxy_port', {
|
|
|
|
rules: [{
|
|
|
|
type: 'empty',
|
|
|
|
prompt: '"General / Proxy settings / Port" must have a value'
|
|
|
|
}]
|
|
|
|
});
|
|
|
|
$('#settings_form').form('add rule', 'settings_proxy_port', {
|
|
|
|
rules: [{
|
|
|
|
type: 'integer[1..65535]',
|
|
|
|
prompt: '"General / Proxy settings / Port" must be an integer between 1 and 65535'
|
|
|
|
}]
|
|
|
|
});
|
|
|
|
$('.form').form('validate form');
|
|
|
|
$('#loader').removeClass('active');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{{ settings_general() }}
|
|
|
|
{{ settings_subtitles() }}
|
|
|
|
{{ settings_notifications() }}
|
|
|
|
{{ settings_radarr() }}
|
|
|
|
{{ settings_sonarr() }}
|
|
|
|
{{ settings_providers1() }}
|
|
|
|
{% endblock tail %}
|