2019-12-28 16:43:48 +00:00
{% extends '_main.html' %}
2018-05-02 10:25:42 +00:00
2020-02-10 03:36:40 +00:00
{% block title %}History (Movies) - Bazarr{% endblock %}
2018-05-02 10:25:42 +00:00
2020-01-01 22:15:50 +00:00
{% block bcleft %}
2020-02-10 03:36:40 +00:00
2020-01-01 22:15:50 +00:00
{% endblock bcleft %}
2018-05-02 10:25:42 +00:00
2020-01-01 22:15:50 +00:00
{% block bcright %}
2020-02-10 03:36:40 +00:00
2020-01-01 22:15:50 +00:00
{% endblock bcright %}
2018-05-02 10:25:42 +00:00
2019-12-28 16:43:48 +00:00
{% block body %}
2020-01-01 22:15:50 +00:00
< table id = "history_movies" class = "table table-striped" style = "width:100%" >
< thead >
< tr >
< th > action< / th >
< th > title< / th >
< th > timestamp< / th >
< th > description< / th >
< / tr >
< / thead >
< / table >
2019-12-28 16:43:48 +00:00
{% endblock body %}
2018-05-02 10:25:42 +00:00
2019-12-28 16:43:48 +00:00
{% block tail %}
2019-12-29 10:56:34 +00:00
< script >
$(document).ready(function () {
var table = $('#history_movies').DataTable({
2020-01-01 22:15:50 +00:00
"processing": false,
2019-12-29 10:56:34 +00:00
"serverSide": true,
2020-02-12 17:41:40 +00:00
language: {
zeroRecords: 'Nothing Found In Movies History',
processing: "Loading Movies History..."
},
2019-12-29 10:56:34 +00:00
"searching": false,
"ordering": false,
2020-01-01 22:15:50 +00:00
"responsive": true,
2020-02-10 03:36:40 +00:00
"lengthChange": false,
2020-01-01 22:15:50 +00:00
"pageLength": {{ settings.general.page_size }},
2019-12-29 10:56:34 +00:00
"ajax": "{{ url_for('api.historymovies') }}",
"columns": [
2020-02-10 03:36:40 +00:00
{"data": "action",
"render": function(data) {
if (data === 0) {
return "< i class = 'fas fa-trash' title = 'Subtitle file has been erased.' data-toggle = 'tooltip' data-placement = 'right' > < / i > ";
} else if (data === 1) {
return "< i class = 'fas fa-download' title = 'Subtitle file has been downloaded.' data-toggle = 'tooltip' data-placement = 'right' > < / i > ";
} else if (data === 2) {
return "< i class = 'fas fa-user' title = 'Subtitle file has been manually downloaded.' data-toggle = 'tooltip' data-placement = 'right' > < / i > ";
} else if (data === 3) {
return "< i class = 'fas fa-recycle' title = 'Subtitle file has been upgraded.' data-toggle = 'tooltip' data-placement = 'right' > < / i > ";
} else if (data === 4) {
return "< i class = 'fas fa-cloud-upload-alt' title = 'Subtitle file has been manually uploaded.' data-toggle = 'tooltip' data-placement = 'right' > < / i > ";
}
}
},
{"data": null,
"render": function (data) {
return '< a href = "' + " { { url_for ( ' movie ' , no = 'tempvalue' ) } } " . replace ( " tempvalue " , data . radarrId ) + ' " > ' + data.title + '< / a > ';
}
},
2019-12-29 10:56:34 +00:00
{"data": "timestamp"},
2020-02-10 03:36:40 +00:00
{"data": null,
"render": function (data) {
if (data.upgradable) {
return "< i class = 'fas fa-recycle' title = 'This Subtitles File Is Eligible For An Upgrade.' style = 'color: green;' data-toggle = 'tooltip' data-placement = 'right' > < / i > " + data.description;
} else {
return data.description;
}
}
}
2019-12-29 10:56:34 +00:00
]
});
2020-02-12 17:41:40 +00:00
events.on('event', function(event) {
var event_json = JSON.parse(event);
if (event_json.type === 'movieHistory') {
$('#history_movies').DataTable().ajax.reload(resetPaging=false);
$('[data-toggle="tooltip"]').tooltip({html: true});
}
});
});
2019-12-29 10:56:34 +00:00
< / script >
2019-12-28 16:43:48 +00:00
{% endblock tail %}