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

82 lines
2.5 KiB

{% extends '_main.html' %}
{% block title %}Series - Bazarr{% endblock %}
5 years ago
{% block head %}
{% endblock head %}
5 years ago
{% block body %}
<table id="series" class="mdl-data-table" style="width:100%">
<thead>
<tr>
<th>Name</th>
5 years ago
<th>Exist</th>
5 years ago
<th>Audio Language</th>
<th>Subtitles Languages</th>
<th>Hearing-Impaired</th>
<th>Forced</th>
5 years ago
<th>Subtitles</th>
5 years ago
</tr>
</thead>
</table>
{% endblock body %}
5 years ago
{% block tail %}
<script>
$(document).ready(function() {
var table = $('#series').DataTable( {
"processing": true,
"serverSide": true,
"searching": false,
"ordering": false,
"lengthChange": false,
"ajax": "/api/series",
"columns": [
{ "data": "title" },
5 years ago
{ "data": "exist",
"render": function ( data ) {
if (data === false) {
return '<i class="fas fa-exclamation-triangle" data-toggle="tooltip" data-placement="right" title="This path doesn\'t seem to be valid."></i>';
} else if (data === true) {
return '<i class="fas fa-check" data-toggle="tooltip" data-placement="right" title="This path seems to be valid."></i>';
}
}
},
5 years ago
{ "data": "audio_language.name" },
5 years ago
{ "data": "languages",
"render": function ( data ) {
if (data !== 'None') {
var languages = '';
data.forEach(appendFunc);
return languages;
} else {
return null;
}
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" },
5 years ago
{ "data": "forced" },
{ "data": null,
"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>'
}
}
5 years ago
]
} );
} );
</script>
{% endblock tail %}