You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bazarr/views/series.html

124 lines
5.4 KiB

{% extends '_main.html' %}
{% block title %}Series - Bazarr{% endblock %}
5 years ago
{% block head %}
{% endblock head %}
5 years ago
{% block body %}
5 years ago
<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>
5 years ago
<th>Path Exist</th>
5 years ago
<th>Audio Language</th>
<th>Subtitles Languages</th>
<th>Hearing-Impaired</th>
<th>Forced</th>
<th>Subtitles</th>
</tr>
</thead>
</table>
</div>
{% endblock body %}
5 years ago
{% block tail %}
5 years ago
<script>
$(document).ready(function () {
var table = $('#series').DataTable({
5 years ago
"processing": false,
5 years ago
"serverSide": true,
"searching": false,
"ordering": false,
"lengthChange": false,
5 years ago
"responsive": true,
5 years ago
"ajax": "{{ url_for('api.series') }}",
"columns": [
{"data": "title"},
{
5 years ago
"data": null,
"className": "dt-center",
5 years ago
"responsivePriority": 1,
5 years ago
"render": function (data) {
5 years ago
if (data.exist === false) {
5 years ago
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>';
5 years ago
} else if (data.exist === true) {
5 years ago
return '<i class="fas fa-check" data-toggle="tooltip" data-placement="right" title="This path seems to be valid: '+data.mapped_path+'"></i>';
5 years ago
}
}
},
{"data": "audio_language.name"},
{
"data": "languages",
"render": function (data) {
if (data !== 'None') {
var languages = '';
data.forEach(appendFunc);
return languages;
} else {
return null;
}
5 years ago
5 years ago
function appendFunc(value) {
languages = languages + '<span class="badge badge-secondary" data-toggle="tooltip" data-placement="right" title="' + value.name + '">' + value.code2 + '</span> ';
}
}
},
5 years ago
{"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>';
}
}
},
5 years ago
{
"data": null,
5 years ago
"responsivePriority": 2,
5 years ago
"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>
{% endblock tail %}