Add priority

This commit is contained in:
2017-02-01 09:41:08 -05:00
parent 0711ae0ac8
commit e3779a323c
19 changed files with 365 additions and 83 deletions
+31 -4
View File
@@ -16,9 +16,7 @@ namespace LeafWeb.WebCms.Controllers
{
public ActionResult Index()
{
var resultItems =
DataService.GetLeafInputs()
.OrderByDescending(f => f.Id);
var resultItems = DataService.GetLeafInputsOrdered();
string serviceDescription;
try
@@ -43,7 +41,10 @@ namespace LeafWeb.WebCms.Controllers
var leafInput = DataService.GetLeafInput(id);
if (leafInput == null)
{
SetStatusMessage($"LeafInput '${id}' not found, may have been deleted?");
RedirectToUmbracoPage(LeafWebPageIds.ManageQueue);
}
var viewModel = new LeafInputDetails(leafInput);
return View(viewModel);
@@ -150,7 +151,11 @@ namespace LeafWeb.WebCms.Controllers
public ActionResult SendUserDownloadLink(int id)
{
var leafInput = DataService.GetLeafInput(id);
if (!leafInput.IsComplete)
if (leafInput == null)
{
SetStatusMessage($"LeafInput '${id}' not found, may have been deleted?");
}
else if (!leafInput.IsComplete)
{
SetStatusMessage($"LeafInput '{leafInput.Identifier}' is not complete!", StatusType.Error);
}
@@ -164,6 +169,28 @@ namespace LeafWeb.WebCms.Controllers
return RedirectToCurrentUmbracoUrl();
}
[ActionLog]
public ActionResult Priority(int id, Priority priority)
{
var leafInput = DataService.GetLeafInput(id);
if (leafInput == null)
{
SetStatusMessage($"LeafInput '${id}' not found, may have been deleted?");
}
else if (!leafInput.IsPending)
{
SetStatusMessage($"LeafInput '{leafInput.Identifier}' is no longer pending");
}
else
{
leafInput.PendingPriority = priority;
DataService.UpdateLeafInput(leafInput);
SetStatusMessage($"LeafInput '{leafInput.Identifier}' priority set to '{leafInput.PendingPriority}'", StatusType.Success);
}
return RedirectToCurrentUmbracoUrl();
}
[ActionLog]
public ActionResult SendUserChartLink(int id)
{