diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 40598357fb..b4b403e651 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -175,3 +175,14 @@ .mediaInfoLabel { color: #bbb; } + +.posterRibbon { + display: block; + position: absolute; + top: 0; + right: 0; + text-align: center; + background-color: #008FBB; + padding: 3px 10px; + border-bottom-left-radius: 10px; +} diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index a81cd7085f..8d28c42a8a 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -407,7 +407,7 @@ form, .readOnlyContent { display: inline-block; margin: 5px; text-align: center; - font-size: 15px; + font-size: 14px; padding: 0; position: relative; padding-bottom: 28px; diff --git a/dashboard-ui/scripts/boxsets.js b/dashboard-ui/scripts/boxsets.js index 28ab752e3a..adbc6bd726 100644 --- a/dashboard-ui/scripts/boxsets.js +++ b/dashboard-ui/scripts/boxsets.js @@ -7,7 +7,7 @@ SortOrder: "Ascending", IncludeItemTypes: "BoxSet", Recursive: true, - Fields: "PrimaryImageAspectRatio,ItemCounts" + Fields: "PrimaryImageAspectRatio,ItemCounts,ItemCounts,DateCreated" }; diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 7a82a8732d..a8cd2afae4 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -1,13 +1,13 @@ var LibraryBrowser = { - getDetaultPageSize: function() { + getDetaultPageSize: function () { if (window.location.toString().toLowerCase().indexOf('localhost') != -1) { return 100; } return 25; }, - + getPosterViewHtml: function (options) { var items = options.items; @@ -35,7 +35,7 @@ height: 198, width: 352, tag: item.BackdropImageTags[0] - + }) + "' />"; } else if (hasPrimaryImage) { @@ -47,7 +47,7 @@ height: height, width: width, tag: item.ImageTags.Primary - + }) + "' />"; } else if (item.BackdropImageTags && item.BackdropImageTags.length) { @@ -56,7 +56,7 @@ height: 198, width: 352, tag: item.BackdropImageTags[0] - + }) + "' />"; } else if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist") { @@ -78,6 +78,10 @@ html += ""; } + if (options.showNewIndicator !== false) { + html += LibraryBrowser.getNewIndicatorHtml(item); + } + html += ""; } @@ -153,6 +157,10 @@ html += ""; } + if (options.showNewIndicator !== false) { + html += LibraryBrowser.getNewIndicatorHtml(item); + } + html += ""; } @@ -220,12 +228,34 @@ html += ""; } + if (options.showNewIndicator !== false) { + html += LibraryBrowser.getNewIndicatorHtml(item); + } + html += ""; } return html; }, + getNewIndicatorHtml: function (item) { + + if (item.RecentlyAddedItemCount) { + return '
' + item.RecentlyAddedItemCount + ' New
'; + } + + if (!item.IsFolder) { + + var date = item.DateCreated; + + if (date && (new Date().getTime() - parseISO8601Date(date).getTime()) < 1209600000) { + return "
New
"; + } + } + + return ''; + }, + getAveragePrimaryImageAspectRatio: function (items) { var values = []; diff --git a/dashboard-ui/scripts/movies.js b/dashboard-ui/scripts/movies.js index 5bb0d8913a..90fb4cec2f 100644 --- a/dashboard-ui/scripts/movies.js +++ b/dashboard-ui/scripts/movies.js @@ -9,7 +9,7 @@ SortOrder: "Ascending", IncludeItemTypes: "Movie", Recursive: true, - Fields: "PrimaryImageAspectRatio,UserData,DisplayMediaType", + Fields: "PrimaryImageAspectRatio,UserData,DisplayMediaType,ItemCounts,DateCreated", Limit: LibraryBrowser.getDetaultPageSize(), StartIndex: 0 }; diff --git a/dashboard-ui/scripts/moviesrecommended.js b/dashboard-ui/scripts/moviesrecommended.js index 0c894c621c..e53102a83f 100644 --- a/dashboard-ui/scripts/moviesrecommended.js +++ b/dashboard-ui/scripts/moviesrecommended.js @@ -19,7 +19,8 @@ $('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({ items: result.Items, - useAverageAspectRatio: true + useAverageAspectRatio: true, + showNewIndicator: false })); }); @@ -59,7 +60,7 @@ IncludeItemTypes: "Trailer", Limit: 5, Recursive: true, - Fields: "PrimaryImageAspectRatio", + Fields: "PrimaryImageAspectRatio,DateCreated", Filters: "IsUnplayed" }; diff --git a/dashboard-ui/scripts/tvrecommended.js b/dashboard-ui/scripts/tvrecommended.js index 31a583b0e8..58aa760832 100644 --- a/dashboard-ui/scripts/tvrecommended.js +++ b/dashboard-ui/scripts/tvrecommended.js @@ -19,7 +19,8 @@ $('#recentlyAddedItems', page).html(LibraryBrowser.getEpisodePosterViewHtml({ items: result.Items, - useAverageAspectRatio: true + useAverageAspectRatio: true, + showNewIndicator: false })); }); @@ -33,7 +34,7 @@ Filters: "IsResumable", Limit: 6, Recursive: true, - Fields: "PrimaryImageAspectRatio,SeriesInfo" + Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated" }; ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) { diff --git a/dashboard-ui/scripts/tvshows.js b/dashboard-ui/scripts/tvshows.js index 24baff1cc6..229a0bc758 100644 --- a/dashboard-ui/scripts/tvshows.js +++ b/dashboard-ui/scripts/tvshows.js @@ -7,7 +7,7 @@ SortOrder: "Ascending", IncludeItemTypes: "Series", Recursive: true, - Fields: "PrimaryImageAspectRatio,SeriesInfo" + Fields: "PrimaryImageAspectRatio,SeriesInfo,ItemCounts,DateCreated" }; function getTableHtml(items) {