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

127 lines
5.2 KiB

5 years ago
{% extends '_main.html' %}
{% block title %}Movies - Bazarr{% endblock %}
5 years ago
{% block bcleft %}
<div class="d-flex">
<button class="btn btn-outline">
<i class="fas fa-sync align-top text-themecolor text-center" aria-hidden="true"></i>
<span class="align-bottom">Update</span>
</button>
</div>
{% endblock bcleft %}
5 years ago
5 years ago
{% block bcright %}
<div class="d-flex m-t-5 justify-content-end">
<h5 class="m-t-0 text-themecolor">Some page settings</h5>
</div>
{% endblock bcright %}
5 years ago
{% block body %}
5 years ago
<table id="movies" class="table table-striped" style="width:100%">
<thead>
<tr>
<th></th>
<th>Name</th>
<th>Path Exist</th>
<th>Audio Language</th>
<th>Subtitles Languages</th>
<th>Hearing-Impaired</th>
<th>Forced</th>
</tr>
</thead>
</table>
5 years ago
{% endblock body %}
{% block tail %}
5 years ago
<script>
$(document).ready(function () {
var table = $('#movies').DataTable({
5 years ago
"dom":
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
5 years ago
"processing": false,
5 years ago
"serverSide": true,
"searching": false,
"ordering": false,
5 years ago
"lengthChange": true,
5 years ago
"responsive": true,
5 years ago
"pageLength": {{ settings.general.page_size }},
5 years ago
"ajax": "{{ url_for('api.movies') }}",
"columns": [
{
"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;
}
}
},
{
5 years ago
"data": null,
"className": "dt-center",
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",
5 years ago
"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": "forced",
5 years ago
"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
]
});
});
</script>
5 years ago
{% endblock tail %}