mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-27 18:17:46 +00:00
107 lines
4 KiB
HTML
107 lines
4 KiB
HTML
{% extends '_main.html' %}
|
|
|
|
{% block title %}Blacklist (Movies) - Bazarr{% endblock %}
|
|
|
|
{% block bcleft %}
|
|
<button class="btn btn-outline" id="remove_all_button">
|
|
<div><i class="fas fa-trash-alt align-top text-themecolor text-center font-20" aria-hidden="true"></i></div>
|
|
<div class="align-bottom text-themecolor small text-center">Remove All</div>
|
|
</button>
|
|
{% endblock bcleft %}
|
|
|
|
{% block bcright %}
|
|
|
|
{% endblock bcright %}
|
|
|
|
{% block body %}
|
|
<table id="blacklist_movies" class="table table-striped" style="width:100%">
|
|
<thead>
|
|
<tr>
|
|
<th>Title</th>
|
|
<th>Language</th>
|
|
<th>Provider</th>
|
|
<th>Date</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
{% endblock body %}
|
|
|
|
{% block tail %}
|
|
<script>
|
|
$(document).ready(function () {
|
|
var table = $('#blacklist_movies').DataTable({
|
|
processing: true,
|
|
serverSide: true,
|
|
language: {
|
|
zeroRecords: 'No Blacklisted Movies Subtitles',
|
|
processing: "Loading Blacklisted Movies Subtitles..."
|
|
},
|
|
searching: false,
|
|
ordering: false,
|
|
lengthChange: false,
|
|
responsive: true,
|
|
pageLength: {{ settings.general.page_size }},
|
|
ajax: "{{ url_for('api.blacklistmovies') }}",
|
|
columns: [
|
|
{
|
|
data: null,
|
|
render: function (data) {
|
|
return '<a href="' + "{{ url_for( 'movie', no='tempvalue' ) }}".replace("tempvalue", data.radarrId) + '">' + data.title + '</a>';
|
|
}
|
|
},
|
|
{
|
|
data: 'language',
|
|
render: function (value) {
|
|
return value.name + ((value.forced) ? ' forced' : '')
|
|
}
|
|
},
|
|
{data: "provider"},
|
|
{data: "timestamp"},
|
|
{data: null,
|
|
render: function (data) {
|
|
return '<a href="" class="blacklist_delete badge badge-secondary" data-toggle="tooltip" data-placement="right" title="Remove this subtitles from blacklist" data-provider="' + data.provider + '" data-subs_id=' + data.subs_id + '><i class="fas fa-trash-alt"></i></a>';
|
|
}
|
|
}
|
|
]
|
|
});
|
|
|
|
$('#remove_all_button').on('click', function (e) {
|
|
e.preventDefault();
|
|
$.ajax({
|
|
url: "{{ url_for('api.blacklistmoviesubtitlesremoveall') }}",
|
|
type: 'DELETE',
|
|
beforeSend: function () {
|
|
$('#remove_all_button').find("i").addClass('fa-spin');
|
|
},
|
|
complete: function () {
|
|
$('#remove_all_button').find("i").removeClass('fa-spin');
|
|
}
|
|
});
|
|
});
|
|
|
|
$('#blacklist_movies').on('click', '.blacklist_delete', function (e) {
|
|
$(this).tooltip('dispose');
|
|
e.preventDefault();
|
|
const values = {
|
|
provider: $(this).attr('data-provider'),
|
|
subs_id: $(this).attr('data-subs_id')
|
|
};
|
|
$.ajax({
|
|
url: "{{ url_for('api.blacklistmoviesubtitlesremove') }}",
|
|
type: "DELETE",
|
|
dataType: "json",
|
|
data: values
|
|
});
|
|
});
|
|
|
|
events.on('event', function (event) {
|
|
var event_json = JSON.parse(event);
|
|
if (event_json.type === 'movieBlacklist') {
|
|
$('#blacklist_movies').DataTable().ajax.reload(resetPaging = false);
|
|
$('[data-toggle="tooltip"]').tooltip({html: true});
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock tail %}
|