mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
#182 - Eliminate duplicates in the selection list for max rating in user screen
This commit is contained in:
parent
fe459feef2
commit
6e0c8a0fee
3 changed files with 13 additions and 27 deletions
|
@ -12,7 +12,7 @@
|
||||||
<a href="#" data-role="button" class="ui-btn-active">Profile</a>
|
<a href="#" data-role="button" class="ui-btn-active">Profile</a>
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('userimage.html', true);">Image</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('userimage.html', true);">Image</a>
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('updatepassword.html', true);">Password</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('updatepassword.html', true);">Password</a>
|
||||||
<a href="#" data-role="button" onclick="Dashboard.navigate('library.html', true);" class="lnkMediaLibrary" style="display:none;">Media Library</a>
|
<a href="#" data-role="button" onclick="Dashboard.navigate('library.html', true);" class="lnkMediaLibrary" style="display: none;">Media Library</a>
|
||||||
</div>
|
</div>
|
||||||
<form id="editUserProfileForm">
|
<form id="editUserProfileForm">
|
||||||
<ul data-role="listview" class="ulForm">
|
<ul data-role="listview" class="ulForm">
|
||||||
|
@ -22,7 +22,14 @@
|
||||||
</li>
|
</li>
|
||||||
<li id="fldMaxParentalRating" style="display: none;">
|
<li id="fldMaxParentalRating" style="display: none;">
|
||||||
<label for="selectMaxParentalRating">Max parental rating:</label>
|
<label for="selectMaxParentalRating">Max parental rating:</label>
|
||||||
<select name="selectMaxParentalRating" id="selectMaxParentalRating"></select>
|
<select name="selectMaxParentalRating" id="selectMaxParentalRating">
|
||||||
|
<option value="">None</option>
|
||||||
|
<option value="G">G</option>
|
||||||
|
<option value="PG">PG</option>
|
||||||
|
<option value="PG-13">PG-13</option>
|
||||||
|
<option value="R">R</option>
|
||||||
|
<option value="NC-17">NC-17</option>
|
||||||
|
</select>
|
||||||
</li>
|
</li>
|
||||||
<li id="fldIsAdmin" style="display: none;">
|
<li id="fldIsAdmin" style="display: none;">
|
||||||
<input type="checkbox" id="chkIsAdmin" name="chkIsAdmin" />
|
<input type="checkbox" id="chkIsAdmin" name="chkIsAdmin" />
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
$('#selectMaxParentalRating', page).html(html).selectmenu("refresh");
|
$('#selectMaxParentalRating', page).html(html).selectmenu("refresh");
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadUser(page, user, loggedInUser, parentalRatingsPromise, allCulturesPromise) {
|
function loadUser(page, user, loggedInUser, allCulturesPromise) {
|
||||||
|
|
||||||
if (!loggedInUser.Configuration.IsAdministrator || user.Id == loggedInUser.Id) {
|
if (!loggedInUser.Configuration.IsAdministrator || user.Id == loggedInUser.Id) {
|
||||||
|
|
||||||
|
@ -47,26 +47,7 @@
|
||||||
|
|
||||||
$('#txtUserName', page).val(user.Name);
|
$('#txtUserName', page).val(user.Name);
|
||||||
|
|
||||||
parentalRatingsPromise.done(function (allParentalRatings) {
|
$('#selectMaxParentalRating', page).val(user.Configuration.MaxParentalRating).selectmenu("refresh");
|
||||||
|
|
||||||
populateRatings(allParentalRatings, page);
|
|
||||||
|
|
||||||
var ratingValue = "";
|
|
||||||
|
|
||||||
if (user.Configuration.MaxParentalRating) {
|
|
||||||
|
|
||||||
for (var i = 0, length = allParentalRatings.length; i < length; i++) {
|
|
||||||
|
|
||||||
var rating = allParentalRatings[i];
|
|
||||||
|
|
||||||
if (user.Configuration.MaxParentalRating >= rating.Value) {
|
|
||||||
ratingValue = rating.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#selectMaxParentalRating', page).val(ratingValue).selectmenu("refresh");
|
|
||||||
});
|
|
||||||
|
|
||||||
allCulturesPromise.done(function (allCultures) {
|
allCulturesPromise.done(function (allCultures) {
|
||||||
|
|
||||||
|
@ -198,13 +179,11 @@
|
||||||
|
|
||||||
var promise2 = Dashboard.getCurrentUser();
|
var promise2 = Dashboard.getCurrentUser();
|
||||||
|
|
||||||
var parentalRatingsPromise = ApiClient.getParentalRatings();
|
|
||||||
|
|
||||||
var allCulturesPromise = ApiClient.getCultures();
|
var allCulturesPromise = ApiClient.getCultures();
|
||||||
|
|
||||||
$.when(promise1, promise2).done(function (response1, response2) {
|
$.when(promise1, promise2).done(function (response1, response2) {
|
||||||
|
|
||||||
loadUser(page, response1[0] || response1, response2[0], parentalRatingsPromise, allCulturesPromise);
|
loadUser(page, response1[0] || response1, response2[0], allCulturesPromise);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -936,7 +936,7 @@
|
||||||
tag: item.ImageTags.Disc
|
tag: item.ImageTags.Disc
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if (item.MediaType == "Audio") {
|
else if (item.MediaType == "Audio" || item.Type == "MusicAlbum") {
|
||||||
url = "css/images/items/detail/audio.png";
|
url = "css/images/items/detail/audio.png";
|
||||||
useBackgroundColor = true;
|
useBackgroundColor = true;
|
||||||
maxwidth = 150;
|
maxwidth = 150;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue