2019-12-27 22:15:56 +00:00
{% extends '_main.html' %}
2018-12-09 20:23:51 +00:00
2019-12-27 22:15:56 +00:00
{% block title %}Series - Bazarr{% endblock %}
2018-12-09 20:23:51 +00:00
2019-12-28 16:43:48 +00:00
{% block head %}
2018-12-09 20:23:51 +00:00
2019-12-27 22:15:56 +00:00
{% endblock head %}
2018-12-09 20:23:51 +00:00
2019-12-28 16:43:48 +00:00
{% block body %}
2019-12-29 10:56:34 +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 >
< table id = "series" class = "table table-striped" style = "width:100%" >
< thead >
< tr >
< th > Name< / th >
2019-12-29 16:29:07 +00:00
< th > Path Exist< / th >
2019-12-29 10:56:34 +00:00
< th > Audio Language< / th >
< th > Subtitles Languages< / th >
< th > Hearing-Impaired< / th >
< th > Forced< / th >
< th > Subtitles< / th >
< / tr >
< / thead >
< / table >
< / div >
2019-12-27 22:15:56 +00:00
{% endblock body %}
2018-12-09 20:23:51 +00:00
2019-12-28 16:43:48 +00:00
{% block tail %}
2019-12-29 10:56:34 +00:00
< script >
$(document).ready(function () {
var table = $('#series').DataTable({
2019-12-29 16:29:07 +00:00
"processing": false,
2019-12-29 10:56:34 +00:00
"serverSide": true,
"searching": false,
"ordering": false,
"lengthChange": false,
2019-12-30 14:07:49 +00:00
"responsive": true,
2019-12-29 10:56:34 +00:00
"ajax": "{{ url_for('api.series') }}",
"columns": [
{"data": "title"},
{
2019-12-29 16:29:07 +00:00
"data": null,
"className": "dt-center",
2019-12-30 14:07:49 +00:00
"responsivePriority": 1,
2019-12-29 10:56:34 +00:00
"render": function (data) {
2019-12-29 16:29:07 +00:00
if (data.exist === false) {
2019-12-30 14:07:49 +00:00
return '< i class = "fas fa-exclamation-triangle" data-toggle = "tooltip" data-placement = "right" title = "This path doesn\'t seem to be valid: '+data.mapped_path+'" > < / i > ';
2019-12-29 16:29:07 +00:00
} else if (data.exist === true) {
2019-12-30 14:07:49 +00:00
return '< i class = "fas fa-check" data-toggle = "tooltip" data-placement = "right" title = "This path seems to be valid: '+data.mapped_path+'" > < / i > ';
2019-12-29 10:56:34 +00:00
}
}
},
{"data": "audio_language.name"},
{
"data": "languages",
"render": function (data) {
if (data !== 'None') {
var languages = '';
data.forEach(appendFunc);
return languages;
} else {
return null;
}
2019-12-29 04:39:13 +00:00
2019-12-29 10:56:34 +00:00
function appendFunc(value) {
languages = languages + '< span class = "badge badge-secondary" data-toggle = "tooltip" data-placement = "right" title = "' + value.name + '" > ' + value.code2 + '< / span > ';
}
}
},
2019-12-29 16:29:07 +00:00
{"data": "hearing_impaired",
"className": "dt-center",
"render": function (data) {
if (data === 'False') {
return '< i class = "far fa-square" > < / i > ';
} else if (data === 'True') {
return '< i class = "far fa-check-square" > < / i > ';
}
}
},
{"data": "forced",
"className": "dt-center",
"render": function (data) {
if (data === 'False') {
return '< i class = "far fa-square" > < / i > ';
} else if (data === 'True') {
return '< i class = "far fa-check-square" > < / i > ';
}
}
},
2019-12-29 10:56:34 +00:00
{
"data": null,
2019-12-30 14:07:49 +00:00
"responsivePriority": 2,
2019-12-29 10:56:34 +00:00
"render": function (data) {
var total = data.episodeFileCount;
var completed = data.episodeFileCount - data.episodeMissingCount;
var completed_style = '';
var completed_text = '';
if (completed / total * 100 > 0 & & data.languages !== 'None') {
completed_style = ' style="width: ' + completed / total * 100 + '%;"';
completed_text = completed + '/' + total;
}
return '< div class = "progress" > < div class = "progress-bar" role = "progressbar" ' + completed_style + ' aria-valuenow = "' + completed + '" aria-valuemin = "0" aria-valuemax = "' + total + '" > ' + completed_text + '< / div > < / div > '
}
}
]
});
});
< / script >
2019-12-27 22:15:56 +00:00
{% endblock tail %}