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
+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));