Details improvements

This commit is contained in:
2017-01-13 09:15:15 -05:00
parent 9d0524dd72
commit 3ee9c11666
75 changed files with 21884 additions and 112 deletions
+17 -6
View File
@@ -8,7 +8,7 @@ using LeafWeb.WebCms.Services;
namespace LeafWeb.WebCms.Controllers
{
public class QueueController : BaseController
public class QueueController : BaseController
{
public ActionResult Index()
{
@@ -23,6 +23,10 @@ namespace LeafWeb.WebCms.Controllers
public ActionResult Details(int id)
{
var leafInput = DataService.GetLeafInput(id);
if (leafInput == null)
RedirectToUmbracoPage(LeafWebPageIds.ManageQueue);
var viewModel = new LeafInputDetails(leafInput);
return View(viewModel);
}
@@ -80,17 +84,23 @@ namespace LeafWeb.WebCms.Controllers
{
var leafInput = DataService.GetLeafInput(id);
if (leafInput == null)
{
SetStatusMessage($"LeafInput '${id}' not found, perhaps it is already deleted?");
return RedirectToUmbracoPage(LeafWebPageIds.ManageQueue);
}
// don't allow currently running LeafInput to be deleted
if (leafInput.IsInProgress)
{
SetStatusMessage($"LeafInput '{leafInput.Identifier}' is currently running!", StatusType.Error);
return View(Request.UrlReferrer.ToString());
return RedirectToCurrentUmbracoUrl();
}
DataService.DeleteLeafInput(leafInput);
SetStatusMessage($"LeafInput '{leafInput.Identifier}' deleted");
return RedirectToAction("Index");
SetStatusMessage($"LeafInput '{leafInput.Identifier}' deleted", StatusType.Success);
return RedirectToUmbracoPage(LeafWebPageIds.ManageQueue);
}
[ActionLog]
@@ -107,8 +117,9 @@ namespace LeafWeb.WebCms.Controllers
BackgroundJob.Enqueue<EmailNotificationService>(e => e.SendLeafWebComplete(leafInputId));
SetStatusMessage($"LeafInput '{leafInput.Identifier}' download link sent", StatusType.Success);
}
return View(Request.UrlReferrer.ToString());
}
return RedirectToCurrentUmbracoUrl();
}
[ActionLog]
public ActionResult SendUserChartLink(int id)