1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-24 08:43:01 +00:00
This commit is contained in:
Louis Vézina 2020-02-09 22:36:40 -05:00
parent e2b65c2468
commit d32bb22e2d
4 changed files with 86 additions and 53 deletions

View file

@ -426,7 +426,7 @@
sonarrEpisodeId: $(this).attr("data-sonarrEpisodeId"),
tvdbid: seriesDetails['tvdbId']
};
var cell = $(this).closest('td');
var cell = $(this).parent();
$.ajax({
url: "{{ url_for('api.episodessubtitlesdelete') }}",
type: "DELETE",
@ -451,7 +451,7 @@
sonarrEpisodeId: $(this).attr('data-sonarrepisodeid'),
title: seriesDetails['title']
};
var cell = $(this).closest('td');
var cell = $(this).parent();
$.ajax({
url: "{{ url_for('api.episodessubtitlesdownload') }}",
type: "POST",
@ -588,7 +588,7 @@
sonarrEpisodeId: $(this).attr('data-sonarrepisodeid'),
title: seriesDetails['title']
};
var cell = $(this).closest('td');
var cell = $(this).parent();
$.ajax({
url: "{{ url_for('api.episodessubtitlesmanualdownload') }}",
type: "POST",

View file

@ -1,20 +1,13 @@
{% extends '_main.html' %}
{% block title %}History (Series) - Bazarr{% endblock %}
{% block title %}History (Movies) - Bazarr{% endblock %}
{% 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 %}
{% 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 %}
{% block body %}
@ -34,21 +27,45 @@
<script>
$(document).ready(function () {
var table = $('#history_movies').DataTable({
"dom":"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
"processing": false,
"serverSide": true,
"searching": false,
"ordering": false,
"responsive": true,
"lengthChange": true,
"lengthChange": false,
"pageLength": {{ settings.general.page_size }},
"ajax": "{{ url_for('api.historymovies') }}",
"columns": [
{"data": "action"},
{"data": "title"},
{"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>';
}
},
{"data": "timestamp"},
{"data": "description"}
{"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;
}
}
}
]
});
});

View file

@ -3,31 +3,24 @@
{% block title %}History (Series) - Bazarr{% endblock %}
{% 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 %}
{% 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 %}
{% block body %}
<table id="history_series" class="table table-striped" style="width:100%">
<thead>
<tr>
<th>Action</th>
<th>Name</th>
<th>Episode</th>
<th>Episode Title</th>
<th>Date</th>
<th>Description</th>
</tr>
<tr>
<th>Action</th>
<th>Name</th>
<th>Episode</th>
<th>Episode Title</th>
<th>Date</th>
<th>Description</th>
</tr>
</thead>
</table>
{% endblock body %}
@ -36,23 +29,46 @@
<script>
$(document).ready(function () {
var table = $('#history_series').DataTable({
"dom":
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
"processing": true,
"serverSide": true,
"searching": false,
"ordering": false,
"lengthChange": true,
"lengthChange": false,
"pageLength": {{ settings.general.page_size }},
"ajax": "{{ url_for('api.historyseries') }}",
"columns": [
{"data": "action"},
{"data": "seriesTitle"},
{"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( 'episodes', no='tempvalue' ) }}".replace("tempvalue", data.sonarrSeriesId) + '">' + data.seriesTitle + '</a>';
}
},
{"data": "episode_number"},
{"data": "episodeTitle"},
{"data": "timestamp"},
{"data": "description"}
{"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;
}
}
}
]
});
});

View file

@ -18,16 +18,16 @@
{% block body %}
<table id="series" class="table table-striped" style="width:100%">
<thead>
<tr>
<th>Name</th>
<th>Path Exist</th>
<th>Audio Language</th>
<th>Subtitles Languages</th>
<th>Hearing-Impaired</th>
<th>Forced</th>
<th>Subtitles</th>
<th></th>
</tr>
<tr>
<th>Name</th>
<th>Path Exist</th>
<th>Audio Language</th>
<th>Subtitles Languages</th>
<th>Hearing-Impaired</th>
<th>Forced</th>
<th>Subtitles</th>
<th></th>
</tr>
</thead>
</table>