From 4040c6d8d0334c75d43c18cf46f66ad1d409165e Mon Sep 17 00:00:00 2001 From: Shaun Date: Tue, 12 Jan 2016 13:22:52 +1100 Subject: [PATCH] add a new endpoint param IsFavorite and use it for reports --- dashboard-ui/reports.html | 16 ++++++++++------ dashboard-ui/scripts/reports.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/dashboard-ui/reports.html b/dashboard-ui/reports.html index 3d223544e8..f413932344 100644 --- a/dashboard-ui/reports.html +++ b/dashboard-ui/reports.html @@ -103,17 +103,21 @@ - - - - - - + +
+ + +
+
diff --git a/dashboard-ui/scripts/reports.js b/dashboard-ui/scripts/reports.js index da3ce301a4..a7bd561539 100644 --- a/dashboard-ui/scripts/reports.js +++ b/dashboard-ui/scripts/reports.js @@ -513,6 +513,19 @@ $('#chkFutureEpisode', page).checked(query.IsUnaired == true).checkboxradio('refresh'); $('#selectIncludeItemTypes').val(query.IncludeItemTypes); + + // isfavorite + if (query.IsFavorite == true) { + $('#isFavorite').val("true"); + } + else if (query.IsFavorite == false) { + $('#isFavorite').val("false"); + } + else { + $('#isFavorite').val("-"); + } + + } var filtersLoaded; @@ -601,6 +614,21 @@ reloadItems(page); }); + $('#isFavorite', page).on('change', function () { + + if (this.value == "true") { + query.IsFavorite = true; + } + else if (this.value == "false") { + query.IsFavorite = false; + } + else { + query.IsFavorite = null; + } + query.StartIndex = 0; + reloadItems(page); + }); + $('.chkStandardFilter', this).on('change', function () { var filterName = this.getAttribute('data-filter');