From 3190337abf8efc3d37a50ab38202ce79e0ebf700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tavares=20Andr=C3=A9?= Date: Mon, 27 Jul 2015 20:16:37 +0200 Subject: [PATCH] Reports - Code cleanup, Added user image to Activities log, Export update --- dashboard-ui/reports.html | 2 +- dashboard-ui/scripts/reports.js | 76 ++++++++++++++++++++++++++------- 2 files changed, 61 insertions(+), 17 deletions(-) diff --git a/dashboard-ui/reports.html b/dashboard-ui/reports.html index 88a178ba24..5ff8d82c8e 100644 --- a/dashboard-ui/reports.html +++ b/dashboard-ui/reports.html @@ -74,8 +74,8 @@
- +

diff --git a/dashboard-ui/scripts/reports.js b/dashboard-ui/scripts/reports.js index a0a1c6e42e..6fc52a8393 100644 --- a/dashboard-ui/scripts/reports.js +++ b/dashboard-ui/scripts/reports.js @@ -8,7 +8,8 @@ IncludeItemTypes: "Movie", HasQueryLimit: true, GroupBy: "None", - ReportView: "ReportData" + ReportView: "ReportData", + DisplayType: "Screen", }; function getTable(result) { @@ -21,19 +22,21 @@ result.Headers.map(function (header) { var cellHtml = ''; - if (header.SortField) { - cellHtml += ''; - } + if (header.ShowHeaderLabel) { + if (header.SortField) { + cellHtml += ''; + } - cellHtml += (header.Name || ' '); - if (header.SortField) { - cellHtml += ''; - if (header.SortField === defaultSortBy) { + cellHtml += (header.Name || ' '); + if (header.SortField) { + cellHtml += ''; + if (header.SortField === defaultSortBy) { - if (query.SortOrder === "Descending") { - cellHtml += ''; - } else { - cellHtml += ''; + if (query.SortOrder === "Descending") { + cellHtml += ''; + } else { + cellHtml += ''; + } } } } @@ -125,6 +128,49 @@ html += '
'; } break; + case "LockDataImage": + if (rRow.HasLockData) { + html += ''; + } + break; + case "UnidentifiedImage": + if (rRow.IsUnidentified) { + html += '
'; + } + break; + case "TagsPrimaryImage": + if (!rRow.HasImageTagsPrimary) { + html += ''; + } + break; + case "TagsBackdropImage": + if (!rRow.HasImageTagsBackdrop) { + if (rRow.RowType !== "Episode" && rRow.RowType !== "Season" && rRow.MediaType !== "Audio" && rRow.RowType !== "TvChannel" && rRow.RowType !== "MusicAlbum") { + html += ''; + } + } + break; + case "TagsLogoImage": + if (!rRow.HasImageTagsLogo) { + if (rRow.RowType === "Movie" || rRow.RowType === "Trailer" || rRow.RowType === "Series" || rRow.RowType === "MusicArtist" || rRow.RowType === "BoxSet") { + html += ''; + } + } + break; + case "UserPrimaryImage": + if (rRow.UserId) { + var userImage = ApiClient.getUserImageUrl(rRow.UserId, { + height: 24, + type: 'Primary' + + }); + if (userImage) { + html += ''; + } else { + html += ''; + } + } + break; case "StatusImage": if (rRow.HasLockData) { html += ''; @@ -226,7 +272,6 @@ var url = ApiClient.getUrl("Reports/Items/Download", query); if (url) { - e.preventDefault(); //stop the browser from following window.location.href = url; } } @@ -244,7 +289,7 @@ $('#selectReportGroup', page).append(''); result.map(function (header) { - if (header.Visible && header.CanGroup) { + if ((header.DisplayType === "Screen" || header.DisplayType === "ScreenExport") && header.CanGroup) { if (header.FieldName.length > 0) { var option = ''; $('#selectReportGroup', page).append(option); @@ -479,7 +524,6 @@ var filtersLoaded; function reloadFiltersIfNeeded(page) { - if (!filtersLoaded) { filtersLoaded = true; @@ -1023,7 +1067,7 @@ var delimiter = '|'; result.map(function (item) { - if (item.Visible) + if ((item.DisplayType === "Screen" || item.DisplayType === "ScreenExport")) filters = filters ? (filters + delimiter + item.FieldName) : item.FieldName; }); if (!itemQuery.ReportColumns)