Commit 96a19785 authored by echel0n's avatar echel0n
Browse files

Fixed IMDb star ratings for display show view

parent 9c41f4b3
# Changelog
- * 8dde2ec - 2018-07-26: Fixed genre row alignment for display show view Fixed small poster sizing for shows view
- * 19d235e - 2018-07-26: Fixed IMDb star ratings for display show view
- * 9c41f4b - 2018-07-26: Fixed genre row alignment for display show view Fixed small poster sizing for shows view
- * c702306 - 2018-07-26: Fixed missing icons in navbar Migrated misc css classes to bootstrap 4
- * 45d2074 - 2018-07-26: Pre-Release v9.3.56.dev3
- * e12e04f - 2018-07-26: Removed bootbox jquery package Fixed confirmation dialog boxes for history and mass update views Changed text color from white to dark for episode statuses view Added css for jquery confirm package
......
......@@ -128,11 +128,9 @@
<td class="showLegend">${_('Rating:')}</td>
<td>
% if show.imdb_info and 'imdbRating' in show.imdb_info:
<% rating_tip = str(show.imdb_info['imdbRating']) + " / 10" + " Stars" + "<br />" + str(show.imdb_info['imdbVotes']) + " Votes" %>
<span id="imdbstars" class="text-warning fas fa-star"
title="${rating_tip}">
${show.imdb_info['imdbRating']}
</span>
<% rating_tip = str(show.imdb_info['imdbRating']) + " / 10" + " Stars and " + str(show.imdb_info['imdbVotes']) + " Votes" %>
<span id="imdbstars" data-imdb-rating="${show.imdb_info['imdbRating']}"
title="${rating_tip}"></span>
% endif
</td>
</tr>
......
......@@ -190,7 +190,7 @@ $(document).ready(function ($) {
return $li.appendTo(ul);
};
$("#quicksearchcancel").click(function() {
$("#quicksearchcancel").click(function () {
$('#quicksearch').autocomplete('close').val('');
$("#quicksearchcancel").addClass('d-none');
});
......@@ -1462,15 +1462,13 @@ $(document).ready(function ($) {
display_show: {
init: function () {
SICKRAGE.home.display_show.imdbRating();
if (SICKRAGE.metaToBool('sickrage.FANART_BACKGROUND')) {
$.backstretch(SICKRAGE.srWebRoot + '/images/' + $('#showID').attr('value') + '.fanart.jpg');
$('.backstretch').css("opacity", SICKRAGE.getMeta('sickrage.FANART_BACKGROUND_OPACITY')).fadeIn("500");
}
$('#imdbstars').each(function (i, e) {
$(e).html($('<span>').width($(e).text() * 12));
});
$('#seasonJump').on('change', function () {
var id = $('#seasonJump option:selected').val();
if (id && id !== 'jump') {
......@@ -1673,6 +1671,15 @@ $(document).ready(function ($) {
});
},
imdbRating: function () {
let imdbstars = $('#imdbstars');
const rating = imdbstars.data('imdb-rating');
const rating_star = $('<i>').addClass('fas fa-star text-warning');
for (var i = 0; i < rating; i++) {
imdbstars.append(rating_star.clone());
}
},
setEpisodeSceneNumbering: function (forSeason, forEpisode, sceneSeason, sceneEpisode) {
var showId = $('#showID').val();
var indexer = $('#indexer').val();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment