mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
added user view setting
This commit is contained in:
parent
8a3440f594
commit
ddc966d515
@ -27,7 +27,7 @@
|
||||
<div class="fieldDescription">${LabelSelectFolderGroupsHelp}</div>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
|
||||
<div>
|
||||
<div data-role="controlgroup">
|
||||
<label for="chkDisplayCollectionView">${LabelDisplayCollectionsView}</label>
|
||||
@ -35,7 +35,7 @@
|
||||
</div>
|
||||
<div class="fieldDescription">${LabelDisplayCollectionsViewHelp}</div>
|
||||
</div>
|
||||
|
||||
|
||||
<br />
|
||||
<div data-role="controlgroup">
|
||||
<label for="chkDisplayFolderView">${LabelDisplayFoldersView}</label>
|
||||
@ -54,6 +54,19 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detailSection viewStylesSection" style="display:none;">
|
||||
<div class="detailSectionHeader">
|
||||
${HeaderViewStyles}
|
||||
</div>
|
||||
<div class="detailSectionContent">
|
||||
<p>${LabelSelectViewStyles}</p>
|
||||
<div class="viewStylesList">
|
||||
|
||||
</div>
|
||||
<div class="fieldDescription">${LabelSelectViewStylesHelp}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detailSection">
|
||||
<div class="detailSectionHeader">
|
||||
${HeaderViewOrder}
|
||||
|
@ -1,7 +1,7 @@
|
||||
(function ($, window, document) {
|
||||
|
||||
function renderViews(page, user, result) {
|
||||
|
||||
|
||||
var folderHtml = '';
|
||||
|
||||
folderHtml += '<div data-role="controlgroup">';
|
||||
@ -27,6 +27,39 @@
|
||||
$('.folderGroupList', page).html(folderHtml).trigger('create');
|
||||
}
|
||||
|
||||
function renderViewStyles(page, user, result) {
|
||||
|
||||
var folderHtml = '';
|
||||
|
||||
folderHtml += '<div data-role="controlgroup">';
|
||||
folderHtml += result.map(function (i) {
|
||||
|
||||
var currentHtml = '';
|
||||
|
||||
var id = 'chkPlainFolder' + i.Id;
|
||||
|
||||
currentHtml += '<label for="' + id + '">' + i.Name + '</label>';
|
||||
|
||||
var isChecked = user.Configuration.PlainFolderViews.indexOf(i.Id) == -1;
|
||||
var checkedHtml = isChecked ? ' checked="checked"' : '';
|
||||
|
||||
currentHtml += '<input class="chkPlainFolder" data-folderid="' + i.Id + '" type="checkbox" id="' + id + '"' + checkedHtml + ' />';
|
||||
|
||||
return currentHtml;
|
||||
|
||||
}).join('');
|
||||
|
||||
folderHtml += '</div>';
|
||||
|
||||
$('.viewStylesList', page).html(folderHtml).trigger('create');
|
||||
|
||||
if (result.length) {
|
||||
$('.viewStylesSection', page).show();
|
||||
} else {
|
||||
$('.viewStylesSection', page).hide();
|
||||
}
|
||||
}
|
||||
|
||||
function renderLatestItems(page, user, result) {
|
||||
|
||||
var folderHtml = '';
|
||||
@ -142,13 +175,15 @@
|
||||
UserId: user.Id
|
||||
}));
|
||||
var promise3 = ApiClient.getUserViews(user.Id);
|
||||
var promise4 = ApiClient.getJSON(ApiClient.getUrl("Users/" + user.Id + "/SpecialViewOptions"));
|
||||
|
||||
$.when(promise1, promise2, promise3).done(function (r1, r2, r3) {
|
||||
$.when(promise1, promise2, promise3, promise4).done(function (r1, r2, r3, r4) {
|
||||
|
||||
renderViews(page, user, r1[0]);
|
||||
renderLatestItems(page, user, r1[0]);
|
||||
renderChannels(page, user, r2[0]);
|
||||
renderViewOrder(page, user, r3[0]);
|
||||
renderViewStyles(page, user, r4[0]);
|
||||
|
||||
if (hideMsg !== false) {
|
||||
Dashboard.hideLoadingMsg();
|
||||
@ -179,6 +214,11 @@
|
||||
return i.getAttribute('data-folderid');
|
||||
});
|
||||
|
||||
user.Configuration.PlainFolderViews = $(".chkPlainFolder:not(:checked)", page).get().map(function (i) {
|
||||
|
||||
return i.getAttribute('data-folderid');
|
||||
});
|
||||
|
||||
user.Configuration.DisplayChannelsWithinViews = $(".chkGroupChannel:checked", page).get().map(function (i) {
|
||||
|
||||
return i.getAttribute('data-channelid');
|
||||
|
Loading…
Reference in New Issue
Block a user