Add object for results details

This commit is contained in:
2020-07-18 21:39:18 -04:00
parent 1e7fa1bb1d
commit 28377cfce8
14 changed files with 156 additions and 33 deletions
+3 -1
View File
@@ -5,7 +5,9 @@ namespace LeafWeb.WebCms.Controllers
{
public const int ManageQueue = 1107;
public const int Chart = 1100;
public const int Details = 1111;
// ReSharper disable once InconsistentNaming
public const int Details_Admin = 1111;
public const int Details_Results = 0;
public const int PasswordResetRequest = 1164;
}
+1 -1
View File
@@ -103,7 +103,7 @@ namespace LeafWeb.WebCms.Controllers
RedirectToUmbracoPage(LeafWebPageIds.ManageQueue);
}
var viewModel = new LeafInputDetails(leafInput);
var viewModel = new LeafInputDetails_Admin(leafInput);
return View(viewModel);
}
+17 -2
View File
@@ -11,7 +11,7 @@ namespace LeafWeb.WebCms.Controllers
{
public class ResultsController : BaseController
{
//[MemberAuthorize(AllowGroup = "Authenticated")]
[MemberAuthorize(AllowGroup = "Authenticated")]
public ActionResult Index(LeafDataQuery query)
{
var resultItems =
@@ -29,7 +29,7 @@ namespace LeafWeb.WebCms.Controllers
}
//[MemberAuthorize(AllowGroup = "Authenticated")]
[MemberAuthorize(AllowGroup = "Authenticated")]
[HttpPost]
public ActionResult Search(LeafDataQuery query)
{
@@ -41,6 +41,21 @@ namespace LeafWeb.WebCms.Controllers
return RedirectToCurrentUmbracoPage(query.GetNameValueCollection());
}
public ActionResult Details(int id)
{
var leafInput = DataService.GetLeafInput(id);
if (leafInput == null)
{
SetStatusMessage($"LeafInput '${id}' not found, may have been deleted?");
RedirectToUmbracoPage(LeafWebPageIds.ManageQueue);
}
var viewModel = new LeafInputDetails_Admin(leafInput);
return View(viewModel);
}
public ActionResult Recent()
{
var dateThreshold = DateTime.Today.Subtract(TimeSpan.FromDays(90));