mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
display rotten tomatoes icon
This commit is contained in:
parent
bcda81a83d
commit
4c30399fde
BIN
dashboard-ui/css/images/fresh.png
Normal file
BIN
dashboard-ui/css/images/fresh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.0 KiB |
BIN
dashboard-ui/css/images/rotten.png
Normal file
BIN
dashboard-ui/css/images/rotten.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -15,8 +15,19 @@
|
||||
}
|
||||
|
||||
.tileItem .starRating {
|
||||
width: 15px;
|
||||
height: 13px;
|
||||
width: 16px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.tileItem .rottentomatoesicon {
|
||||
height: 14px;
|
||||
width: 14px;
|
||||
}
|
||||
|
||||
.tileItem .criticRating {
|
||||
position: relative;
|
||||
top: -1px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.tileImage {
|
||||
|
@ -39,11 +39,11 @@
|
||||
<input type="number" id="txtIndexNumber" name="txtIndexNumber" data-mini="true" pattern="[0-9]*" />
|
||||
</div>
|
||||
<div data-role="fieldcontain">
|
||||
<label for="txtCommunityRating">Community rating (0-10):</label>
|
||||
<label for="txtCommunityRating">Community rating:</label>
|
||||
<input type="number" id="txtCommunityRating" name="txtCommunityRating" step=".1" data-mini="true" min="0" max="10" />
|
||||
</div>
|
||||
<div data-role="fieldcontain">
|
||||
<label for="txtCriticRating">Critic rating (0-10):</label>
|
||||
<label for="txtCriticRating">Critic rating:</label>
|
||||
<input type="number" id="txtCriticRating" name="txtCriticRating" step=".1" data-mini="true" min="0" max="10" />
|
||||
</div>
|
||||
<div data-role="fieldcontain">
|
||||
|
@ -115,13 +115,15 @@
|
||||
|
||||
<h1 id="grandParentName" class="detailPageName hide"></h1>
|
||||
<h1 id="parentName" class="detailPageName hide"></h1>
|
||||
<h1 id="itemName" class="detailPageName"></h1>
|
||||
<h1 class="detailPageName">
|
||||
<span id="itemName" style="display: inline;"></span>
|
||||
<span id="itemMiscInfo" class="itemMiscInfo" style="display: inline;"></span>
|
||||
</h1>
|
||||
|
||||
<p id="itemMiscInfo" class="itemMiscInfo"></p>
|
||||
<p id="itemCommunityRating"></p>
|
||||
<p id="itemTagline" style="font-style: italic;"></p>
|
||||
<p id="itemOverview"></p>
|
||||
<p id="itemRatings" class="userDataIcons"></p>
|
||||
<p id="itemCommunityRating"></p>
|
||||
|
||||
<p id="itemPremiereDate"></p>
|
||||
<p id="itemBudget"></p>
|
||||
|
@ -204,7 +204,7 @@
|
||||
LibraryBrowser.renderOverview($('#itemOverview', page), item);
|
||||
|
||||
if (item.CommunityRating) {
|
||||
$('#itemCommunityRating', page).html(LibraryBrowser.getStarRatingHtml(item)).show().attr('title', item.CommunityRating);
|
||||
$('#itemCommunityRating', page).html(LibraryBrowser.getRatingHtml(item)).show();
|
||||
} else {
|
||||
$('#itemCommunityRating', page).hide();
|
||||
}
|
||||
|
@ -147,7 +147,7 @@
|
||||
html += '<div class="tileName">' + name + '</div>';
|
||||
|
||||
if (item.CommunityRating) {
|
||||
html += '<p>' + LibraryBrowser.getFiveStarRatingHtml(item) + '</p>';
|
||||
html += '<p>' + LibraryBrowser.getRatingHtml(item) + '</p>';
|
||||
}
|
||||
|
||||
var childText;
|
||||
@ -811,42 +811,35 @@
|
||||
return html;
|
||||
},
|
||||
|
||||
getStarRatingHtml: function (item) {
|
||||
var rating = item.CommunityRating;
|
||||
|
||||
var html = "";
|
||||
for (var i = 1; i <= 10; i++) {
|
||||
if (rating < i - 1) {
|
||||
html += "<div class='starRating emptyStarRating'></div>";
|
||||
}
|
||||
else if (rating < i) {
|
||||
html += "<div class='starRating halfStarRating'></div>";
|
||||
}
|
||||
else {
|
||||
html += "<div class='starRating'></div>";
|
||||
}
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
getFiveStarRatingHtml: function (item) {
|
||||
getRatingHtml: function (item) {
|
||||
|
||||
var rating = item.CommunityRating / 2;
|
||||
|
||||
var html = "";
|
||||
for (var i = 1; i <= 5; i++) {
|
||||
if (rating < i - 1) {
|
||||
html += "<div class='starRating emptyStarRating'></div>";
|
||||
html += "<div class='starRating emptyStarRating' title='" + item.CommunityRating + "'></div>";
|
||||
}
|
||||
else if (rating < i) {
|
||||
html += "<div class='starRating halfStarRating'></div>";
|
||||
html += "<div class='starRating halfStarRating' title='" + item.CommunityRating + "'></div>";
|
||||
}
|
||||
else {
|
||||
html += "<div class='starRating'></div>";
|
||||
html += "<div class='starRating' title='" + item.CommunityRating + "'></div>";
|
||||
}
|
||||
}
|
||||
|
||||
if (item.Type == "Movie" && item.CriticRating != null) {
|
||||
|
||||
if (item.CriticRating >= 60) {
|
||||
html += '<div class="fresh rottentomatoesicon"></div>';
|
||||
} else {
|
||||
html += '<div class="rotten rottentomatoesicon"></div>';
|
||||
}
|
||||
|
||||
html += '<div class="criticRating">' + item.CriticRating + '%</div>';
|
||||
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
@ -1344,7 +1337,7 @@
|
||||
miscInfo.push(item.VideoFormat);
|
||||
}
|
||||
|
||||
return miscInfo.join(' ');
|
||||
return miscInfo.join(' ');
|
||||
},
|
||||
|
||||
renderOverview: function (elem, item) {
|
||||
|
Loading…
Reference in New Issue
Block a user