mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add column sorting to reports
This commit is contained in:
parent
67f909cd87
commit
fce65d5942
8 changed files with 246 additions and 87 deletions
|
@ -36,13 +36,6 @@
|
|||
$('#editButtonContainer', page).hide();
|
||||
}
|
||||
|
||||
if (user.Configuration.IsAdministrator && item.Type == "BoxSet") {
|
||||
$('#btnEditCollectionTitles', page).show().attr('href', 'editcollectionitems.html?id=' + item.Id);
|
||||
|
||||
} else {
|
||||
$('#btnEditCollectionTitles', page).hide();
|
||||
}
|
||||
|
||||
if (MediaPlayer.canPlay(item, user)) {
|
||||
|
||||
var url = MediaPlayer.getPlayUrl(item);
|
||||
|
@ -184,8 +177,15 @@
|
|||
|
||||
function setInitialCollapsibleState(page, item, context, user) {
|
||||
|
||||
$('.collectionItems', page).empty();
|
||||
|
||||
if (item.IsFolder) {
|
||||
$('#childrenCollapsible', page).removeClass('hide');
|
||||
|
||||
if (item.Type == "BoxSet") {
|
||||
$('#childrenCollapsible', page).addClass('hide');
|
||||
} else {
|
||||
$('#childrenCollapsible', page).removeClass('hide');
|
||||
}
|
||||
renderChildren(page, item, user);
|
||||
}
|
||||
else {
|
||||
|
@ -579,7 +579,7 @@
|
|||
|
||||
var html = '';
|
||||
|
||||
if (item.Type == "Series" || item.Type == "BoxSet") {
|
||||
if (item.Type == "Series") {
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: "portrait",
|
||||
|
@ -608,9 +608,20 @@
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
$('#childrenContent', page).html(html).createPosterItemHoverMenu();
|
||||
|
||||
if (item.Type == "BoxSet") {
|
||||
|
||||
var collectionItemTypes = [
|
||||
{ name: 'Movies', type: 'Movie' },
|
||||
{ name: 'Series', type: 'Series' },
|
||||
{ name: 'Albums', type: 'MusicAlbum' },
|
||||
{ name: 'Games', type: 'Game' },
|
||||
{ name: 'Books', type: 'Book' }
|
||||
];
|
||||
|
||||
renderCollectionItems(page, collectionItemTypes, result.Items, user);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -620,9 +631,6 @@
|
|||
else if (item.Type == "Series") {
|
||||
$('#childrenTitle', page).html('Seasons');
|
||||
}
|
||||
else if (item.Type == "BoxSet") {
|
||||
$('#childrenTitle', page).html('Titles');
|
||||
}
|
||||
else if (item.Type == "MusicAlbum") {
|
||||
$('#childrenTitle', page).html('Tracks');
|
||||
}
|
||||
|
@ -633,6 +641,82 @@
|
|||
$('#childrenTitle', page).html('Items');
|
||||
}
|
||||
}
|
||||
|
||||
function renderCollectionItems(page, types, items, user) {
|
||||
|
||||
for (var i = 0, length = types.length; i < length; i++) {
|
||||
|
||||
var type = types[i];
|
||||
|
||||
var typeItems = items.filter(function (curr) {
|
||||
|
||||
return curr.Type == type.type;
|
||||
|
||||
});
|
||||
|
||||
if (!typeItems.length) {
|
||||
continue;
|
||||
}
|
||||
|
||||
renderCollectionItemType(page, type, typeItems, user);
|
||||
}
|
||||
|
||||
var otherType = { name: 'Other Items' };
|
||||
|
||||
var otherTypeItems = items.filter(function (curr) {
|
||||
|
||||
return !types.filter(function(t) {
|
||||
|
||||
return t.type == curr.Type;
|
||||
|
||||
}).length;
|
||||
|
||||
});
|
||||
|
||||
if (otherTypeItems.length) {
|
||||
renderCollectionItemType(page, otherType, otherTypeItems, user);
|
||||
}
|
||||
|
||||
if (!items.length) {
|
||||
renderCollectionItemType(page, {name: 'Titles'}, items, user);
|
||||
}
|
||||
|
||||
$('.collectionItems', page).trigger('create').createPosterItemHoverMenu();
|
||||
}
|
||||
|
||||
function renderCollectionItemType(page, type, items, user) {
|
||||
|
||||
var html = '';
|
||||
|
||||
html += '<div class="detailSection">';
|
||||
|
||||
html += '<div class="detailSectionHeader" style="position: relative;">';
|
||||
html += '<span>' + type.name + '</span>';
|
||||
|
||||
if (user.Configuration.IsAdministrator) {
|
||||
html += '<a href="editcollectionitems.html?id=' + currentItem.Id + '" data-role="button" data-icon="edit" data-iconpos="notext" data-inline="true" style="position: absolute; right: 0; top: 6px; margin-top: 0; margin-bottom: 0;">Edit</a>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="detailSectionContent">';
|
||||
|
||||
var shape = type.type == 'MusicAlbum' ? 'square' : 'portrait';
|
||||
|
||||
html += LibraryBrowser.getPosterViewHtml({
|
||||
items: items,
|
||||
shape: shape,
|
||||
useAverageAspectRatio: true,
|
||||
showTitle: true,
|
||||
centerText: true
|
||||
});
|
||||
html += '</div>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
$('.collectionItems', page).append(html);
|
||||
}
|
||||
|
||||
function renderUserDataIcons(page, item) {
|
||||
$('.userDataIcons', page).html(LibraryBrowser.getUserDataIconsHtml(item));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue