diff --git a/WebCms/Models/LeafDataQuery.cs b/WebCms/Models/LeafDataQuery.cs index e5e4f89..ad5c7e8 100644 --- a/WebCms/Models/LeafDataQuery.cs +++ b/WebCms/Models/LeafDataQuery.cs @@ -57,10 +57,10 @@ namespace LeafWeb.WebCms.Models public string phips2 { get; set; } [Display(Name = "Show Only Successfully Completed")] - public bool compl { get; set; } + public bool? compl { get; set; } [Display(Name = "Only my data")] - public bool usr { get; set; } + public bool? usr { get; set; } public bool HasExtendedParameters => !( @@ -74,12 +74,12 @@ namespace LeafWeb.WebCms.Models && string.IsNullOrEmpty(pari) && string.IsNullOrEmpty(tleaf) && string.IsNullOrEmpty(phips2) - && !compl + && !(compl.HasValue && compl.Value) ); public bool HasParameters => HasExtendedParameters || !string.IsNullOrEmpty(q) - || usr; + || usr.HasValue && usr.Value; } } \ No newline at end of file diff --git a/WebCms/Utility/QueryFilter.cs b/WebCms/Utility/QueryFilter.cs index 0a19bdc..925c227 100644 --- a/WebCms/Utility/QueryFilter.cs +++ b/WebCms/Utility/QueryFilter.cs @@ -143,7 +143,7 @@ namespace LeafWeb.WebCms.Utility select li; } - if (query.compl) + if (query.compl.HasValue && query.compl.Value) { resultItems = from li in resultItems @@ -154,7 +154,7 @@ namespace LeafWeb.WebCms.Utility select li; } - if (query.usr && !string.IsNullOrEmpty(currentUserEmail)) + if (query.usr.HasValue && query.usr.Value && !string.IsNullOrEmpty(currentUserEmail)) { resultItems = from li in resultItems diff --git a/WebCms/Views/Shared/_LeafDataQuery.cshtml b/WebCms/Views/Shared/_LeafDataQuery.cshtml index 50601dd..2618078 100644 --- a/WebCms/Views/Shared/_LeafDataQuery.cshtml +++ b/WebCms/Views/Shared/_LeafDataQuery.cshtml @@ -1,12 +1,12 @@ @using System.Web.Mvc.Html @using ClientDependency.Core.Mvc -@using LeafWeb.WebCms.Utility @model LeafDataQuery @{ Html.RequiresJs("~/scripts/jquery.validate.min.js", 2); Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.min.js", 2); Html.RequiresJs("~/scripts/jquery.validate.custom.js", 2); Html.RequiresJs("~/scripts/jquery.validate.unobtrusive.bootstrap.js", 2); + Html.RequiresJs("~/scripts/LeafDataQuery.js", 3); var actionName = string.Empty; var controllerName = string.Empty; @@ -25,7 +25,7 @@ htmlFormAction = (string)ViewData["htmlFormAction"]; } } -@using (Html.BeginUmbracoForm(actionName, controllerName, null, new { action = htmlFormAction })) +@using (Html.BeginUmbracoForm(actionName, controllerName, null, new { action = htmlFormAction, id = "leafdataquery" })) {