mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add placeholder image to detail pages
This commit is contained in:
parent
e3de93dae6
commit
d989d7b007
4 changed files with 318 additions and 41 deletions
|
@ -542,6 +542,16 @@
|
|||
-webkit-box-shadow: 0 0.0725em 0.29em 0 rgba(0, 0, 0, 0.37);
|
||||
}
|
||||
|
||||
.itemDetailGalleryLink.defaultCardBackground {
|
||||
height: 23vw; /* Dirty hack to get it to look somewhat square. Less than ideal. */
|
||||
}
|
||||
|
||||
.itemDetailGalleryLink.defaultCardBackground > i {
|
||||
font-size: 15vw;
|
||||
margin-top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
@media all and (max-width: 62.5em) {
|
||||
.detailPageContent {
|
||||
position: relative;
|
||||
|
|
|
@ -1397,7 +1397,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
|
|||
//}
|
||||
|
||||
if (!imgUrl) {
|
||||
cardImageContainerOpen += getCardDefaultText(item, options);
|
||||
cardImageContainerOpen += getDefaultText(item, options);
|
||||
}
|
||||
|
||||
var tagName = (layoutManager.tv) && !overlayButtons ? 'button' : 'div';
|
||||
|
@ -1485,17 +1485,24 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
|
|||
return html;
|
||||
}
|
||||
|
||||
function getCardDefaultText(item, options) {
|
||||
function getDefaultText(item, options) {
|
||||
if (item.CollectionType) {
|
||||
return '<i class="cardImageIcon material-icons">' + imageHelper.getLibraryIcon(item.CollectionType) + '</i>'
|
||||
}
|
||||
if (item.Type === 'MusicAlbum') {
|
||||
return '<i class="cardImageIcon material-icons">album</i>';
|
||||
|
||||
switch (item.Type) {
|
||||
case 'MusicAlbum':
|
||||
return '<i class="cardImageIcon material-icons">album</i>';
|
||||
case 'MusicArtist':
|
||||
case 'Person':
|
||||
return '<i class="cardImageIcon material-icons">person</i>';
|
||||
case 'Movie':
|
||||
return '<i class="cardImageIcon material-icons">movie</i>'
|
||||
case 'Series':
|
||||
return '<i class="cardImageIcon material-icons">tv</i>'
|
||||
}
|
||||
if (item.Type === 'MusicArtist' || item.Type === 'Person') {
|
||||
return '<i class="cardImageIcon material-icons">person</i>';
|
||||
}
|
||||
if (options.defaultCardImageIcon) {
|
||||
|
||||
if (options && options.defaultCardImageIcon) {
|
||||
return '<i class="cardImageIcon material-icons">' + options.defaultCardImageIcon + '</i>';
|
||||
}
|
||||
|
||||
|
@ -1702,6 +1709,8 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'focusMana
|
|||
|
||||
return {
|
||||
getCardsHtml: getCardsHtml,
|
||||
getDefaultBackgroundClass: getDefaultBackgroundClass,
|
||||
getDefaultText: getDefaultText,
|
||||
buildCards: buildCards,
|
||||
onUserDataChanged: onUserDataChanged,
|
||||
onTimerCreated: onTimerCreated,
|
||||
|
|
|
@ -795,7 +795,9 @@ define(["loading", "appRouter", "layoutManager", "connectionManager", "cardBuild
|
|||
});
|
||||
}
|
||||
|
||||
if (editable) {
|
||||
if (editable && url === undefined) {
|
||||
html += "<a class='itemDetailGalleryLink itemDetailImage defaultCardBackground defaultCardBackground"+ cardBuilder.getDefaultBackgroundClass(item.Name) + "' is='emby-linkbutton' style='display:block;margin:0;padding:0;' href='#'>";
|
||||
} else if (editable) {
|
||||
html += "<a class='itemDetailGalleryLink' is='emby-linkbutton' style='display:block;margin:0;padding:0;' href='#'>";
|
||||
}
|
||||
|
||||
|
@ -807,7 +809,13 @@ define(["loading", "appRouter", "layoutManager", "connectionManager", "cardBuild
|
|||
}
|
||||
}
|
||||
|
||||
html += "<img class='itemDetailImage lazy' src='data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=' />";
|
||||
if (url) {
|
||||
html += "<img class='itemDetailImage lazy' src='data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=' />";
|
||||
}
|
||||
|
||||
if (url === undefined) {
|
||||
html += cardBuilder.getDefaultText(item);
|
||||
}
|
||||
|
||||
if (editable) {
|
||||
html += "</a>";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue