mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Use Card component as poster on details page
This commit is contained in:
parent
d54e30cfda
commit
de0e45c0c0
3 changed files with 57 additions and 189 deletions
|
@ -1380,7 +1380,6 @@ import 'programStyles';
|
|||
}
|
||||
|
||||
if (layoutManager.tv) {
|
||||
|
||||
// Don't use the IMG tag with safari because it puts a white border around it
|
||||
cardImageContainerOpen = imgUrl ? ('<div class="' + cardImageContainerClass + ' ' + cardContentClass + ' lazy" data-src="' + imgUrl + '" ' + blurhashAttrib + '>') : ('<div class="' + cardImageContainerClass + ' ' + cardContentClass + '">');
|
||||
|
||||
|
@ -1398,34 +1397,36 @@ import 'programStyles';
|
|||
cardBoxClose = '</div>';
|
||||
cardScalableClose = '</div>';
|
||||
|
||||
let indicatorsHtml = '';
|
||||
if (!options.disableIndicators || options.disableIndicators === false) {
|
||||
let indicatorsHtml = '';
|
||||
|
||||
if (options.missingIndicator !== false) {
|
||||
indicatorsHtml += indicators.getMissingIndicator(item);
|
||||
}
|
||||
if (options.missingIndicator !== false) {
|
||||
indicatorsHtml += indicators.getMissingIndicator(item);
|
||||
}
|
||||
|
||||
indicatorsHtml += indicators.getSyncIndicator(item);
|
||||
indicatorsHtml += indicators.getTimerIndicator(item);
|
||||
indicatorsHtml += indicators.getSyncIndicator(item);
|
||||
indicatorsHtml += indicators.getTimerIndicator(item);
|
||||
|
||||
indicatorsHtml += indicators.getTypeIndicator(item);
|
||||
indicatorsHtml += indicators.getTypeIndicator(item);
|
||||
|
||||
if (options.showGroupCount) {
|
||||
if (options.showGroupCount) {
|
||||
|
||||
indicatorsHtml += indicators.getChildCountIndicatorHtml(item, {
|
||||
minCount: 1
|
||||
});
|
||||
} else {
|
||||
indicatorsHtml += indicators.getPlayedIndicatorHtml(item);
|
||||
}
|
||||
indicatorsHtml += indicators.getChildCountIndicatorHtml(item, {
|
||||
minCount: 1
|
||||
});
|
||||
} else {
|
||||
indicatorsHtml += indicators.getPlayedIndicatorHtml(item);
|
||||
}
|
||||
|
||||
if (item.Type === 'CollectionFolder' || item.CollectionType) {
|
||||
const refreshClass = item.RefreshProgress ? '' : ' class="hide"';
|
||||
indicatorsHtml += '<div is="emby-itemrefreshindicator"' + refreshClass + ' data-progress="' + (item.RefreshProgress || 0) + '" data-status="' + item.RefreshStatus + '"></div>';
|
||||
requireRefreshIndicator();
|
||||
}
|
||||
if (item.Type === 'CollectionFolder' || item.CollectionType) {
|
||||
const refreshClass = item.RefreshProgress ? '' : ' class="hide"';
|
||||
indicatorsHtml += '<div is="emby-itemrefreshindicator"' + refreshClass + ' data-progress="' + (item.RefreshProgress || 0) + '" data-status="' + item.RefreshStatus + '"></div>';
|
||||
requireRefreshIndicator();
|
||||
}
|
||||
|
||||
if (indicatorsHtml) {
|
||||
cardImageContainerOpen += '<div class="cardIndicators">' + indicatorsHtml + '</div>';
|
||||
if (indicatorsHtml) {
|
||||
cardImageContainerOpen += '<div class="cardIndicators">' + indicatorsHtml + '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!imgUrl) {
|
||||
|
@ -1474,7 +1475,7 @@ import 'programStyles';
|
|||
let additionalCardContent = '';
|
||||
|
||||
if (layoutManager.desktop) {
|
||||
additionalCardContent += getHoverMenuHtml(item, action);
|
||||
additionalCardContent += getHoverMenuHtml(item, action, options);
|
||||
}
|
||||
|
||||
return '<' + tagName + ' data-index="' + index + '"' + timerAttributes + actionAttribute + ' data-isfolder="' + (item.IsFolder || false) + '" data-serverid="' + (item.ServerId || options.serverId) + '" data-id="' + (item.Id || item.ItemId) + '" data-type="' + item.Type + '"' + mediaTypeData + collectionTypeData + channelIdData + positionTicksData + collectionIdData + playlistIdData + contextData + parentIdData + ' data-prefix="' + prefix + '" class="' + className + '">' + cardImageContainerOpen + innerCardFooter + cardImageContainerClose + overlayButtons + additionalCardContent + cardScalableClose + outerCardFooter + cardBoxClose + '</' + tagName + '>';
|
||||
|
@ -1484,9 +1485,10 @@ import 'programStyles';
|
|||
* Generates HTML markup for the card overlay.
|
||||
* @param {object} item - Item used to generate the card overlay.
|
||||
* @param {string} action - Action assigned to the overlay.
|
||||
* @param {Array} options - Card builder options.
|
||||
* @returns {string} HTML markup of the card overlay.
|
||||
*/
|
||||
function getHoverMenuHtml(item, action) {
|
||||
function getHoverMenuHtml(item, action, options) {
|
||||
let html = '';
|
||||
|
||||
html += '<div class="cardOverlayContainer itemAction" data-action="' + action + '">';
|
||||
|
@ -1501,12 +1503,12 @@ import 'programStyles';
|
|||
|
||||
const userData = item.UserData || {};
|
||||
|
||||
if (itemHelper.canMarkPlayed(item)) {
|
||||
if (itemHelper.canMarkPlayed(item) && !options.disableHoverMenu) {
|
||||
require(['emby-playstatebutton']);
|
||||
html += '<button is="emby-playstatebutton" type="button" data-action="none" class="' + btnCssClass + '" data-id="' + item.Id + '" data-serverid="' + item.ServerId + '" data-itemtype="' + item.Type + '" data-played="' + (userData.Played) + '"><span class="material-icons cardOverlayButtonIcon cardOverlayButtonIcon-hover check"></span></button>';
|
||||
}
|
||||
|
||||
if (itemHelper.canRate(item)) {
|
||||
if (itemHelper.canRate(item) && !options.disableHoverMenu) {
|
||||
|
||||
const likes = userData.Likes == null ? '' : userData.Likes;
|
||||
|
||||
|
@ -1514,7 +1516,9 @@ import 'programStyles';
|
|||
html += '<button is="emby-ratingbutton" type="button" data-action="none" class="' + btnCssClass + '" data-id="' + item.Id + '" data-serverid="' + item.ServerId + '" data-itemtype="' + item.Type + '" data-likes="' + likes + '" data-isfavorite="' + (userData.IsFavorite) + '"><span class="material-icons cardOverlayButtonIcon cardOverlayButtonIcon-hover favorite"></span></button>';
|
||||
}
|
||||
|
||||
html += '<button is="paper-icon-button-light" class="' + btnCssClass + '" data-action="menu"><span class="material-icons cardOverlayButtonIcon cardOverlayButtonIcon-hover more_vert"></span></button>';
|
||||
if (!options.disableHoverMenu) {
|
||||
html += '<button is="paper-icon-button-light" class="' + btnCssClass + '" data-action="menu"><span class="material-icons cardOverlayButtonIcon cardOverlayButtonIcon-hover more_vert"></span></button>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue