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/movies.html

86 lines
2.5 KiB

5 years ago
{% extends '_main.html' %}
{% block title %}Movies - Bazarr{% endblock %}
{% block head %}
{% endblock head %}
{% block body %}
<table id="movies" class="mdl-data-table" style="width:100%">
<thead>
<tr>
5 years ago
<th></th>
5 years ago
<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>
</tr>
</thead>
</table>
{% endblock body %}
{% block tail %}
6 years ago
<script>
5 years ago
$(document).ready(function() {
var table = $('#movies').DataTable( {
"processing": true,
"serverSide": true,
"searching": false,
"ordering": false,
"lengthChange": false,
"ajax": "/api/movies",
"columns": [
5 years ago
{ "data": "monitored",
"render": function ( data, type, row ) {
if (data === 'False') {
return '<i class="far fa-bookmark" data-toggle="tooltip" data-placement="right" title="Movie unmonitored in Radarr"></i>';
} else if (data === 'True') {
return '<i class="fas fa-bookmark" data-toggle="tooltip" data-placement="right" title="Movie monitored in Radarr"></i>';
}
}
},
{ "data": null,
"render": function ( data ) {
if (data.sceneName) {
return '<i class="fas fa-info-circle" data-toggle="tooltip" data-placement="right" title="' + data.sceneName + '"></i> ' + data.title;
} else {
return data.title;
}
}
},
{ "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" },
{ "data": "forced" }
]
} );
} );
</script>
5 years ago
{% endblock tail %}