Add cancel

This commit is contained in:
2017-01-26 08:36:54 -05:00
parent 295b40bed8
commit 4338b4fee5
30 changed files with 333 additions and 62 deletions
+2 -2
View File
@@ -13,7 +13,7 @@
</a>
<a href="@Url.Action("DownloadOutputToUser", "Queue", new {id = Model.LeafInputId})"
class="btn btn-default@{if (!Model.IsComplete)
class="btn btn-default@{if (!Model.HasOutputFiles)
{<text> disabled</text>}}" role="button">
<span class="glyphicon glyphicon-download"></span> Download ToUser
</a>
@@ -22,7 +22,7 @@
"SendUserDownloadLink", null, new { @class = "confirm", confirm_msg = "Confirm sending email to user" }))
{
<input type="hidden" name="id" value="@Model.LeafInputId" />
<button type="submit" class="btn btn-default" @{if (!Model.IsComplete) { <text> disabled="disabled" </text> }}>
<button type="submit" class="btn btn-default" @{if (!Model.HasOutputFiles) { <text> disabled="disabled" </text> }}>
<span class="glyphicon glyphicon-send"></span> Email User Download link
</button>
}
+11 -1
View File
@@ -32,6 +32,11 @@
<ul class="dropdown-menu">
<li>@DetailsLink(item)</li>
<li @DisableItem(!item.HasLeafChart)>@ChartLink(item)</li>
@if (item.IsCancellable)
{
<li role="separator" class="divider"></li>
<li>@CancelLink(item)</li>
}
@*<li role="separator" class="divider"></li>
<li class="dropdown-header">Priority</li>
<li>@SetPriorityHigh(item, "Set High")</li>
@@ -39,7 +44,7 @@
<li role="separator" class="divider"></li>
<li class="dropdown-header">Download</li>
<li>@DownloadInput(item)</li>
<li @DisableItem(!item.IsComplete)>@DownloadOutputToUser(item)</li>
<li @DisableItem(!item.HasOutputFiles)>@DownloadOutputToUser(item)</li>
<li role="separator" class="divider"></li>
<li @DisableItem(!item.IsDeletable)>@DeleteLink(item)</li>
</ul>
@@ -87,6 +92,11 @@
@Html.Partial("DisplayTemplates/_DeleteForm", (Tuple<int, string, bool>)Tuple.Create(item.LeafInputId, item.LeafInputIdentifier, item.IsDeletable))
}
@helper CancelLink(dynamic item)
{
@Html.Partial("DisplayTemplates/_CancelForm", (Tuple<int, string>)Tuple.Create(item.LeafInputId, item.LeafInputIdentifier))
}
@helper DisableItem(bool disabled)
{
if (disabled) {<text>class="disabled"</text>}
+1 -1
View File
@@ -1,4 +1,4 @@
@model IEnumerable<ResultItemViewModel>
@model IEnumerable<QueueItemViewModel>
@{
var grid = new WebGrid(Model, rowsPerPage: 45);
@@ -0,0 +1,14 @@
@using LeafWeb.WebCms.Controllers
@model Tuple<int, string>
@{
var leafInputId = Model.Item1;
var identifier = Model.Item2;
}
@using (Html.BeginUmbracoForm<QueueController>("Cancel", null,
new { @class = "confirm", confirm_msg = "Cancelling cannot be undone! Confirm cancelling '" + identifier + "'." }))
{
<input type="hidden" name="id" value="@leafInputId"/>
<button type="submit" class="btn btn-link">
<span class="glyphicon glyphicon-ban-circle"></span> Cancel
</button>
}
@@ -1,2 +1,3 @@
@model string
<span class="status status-@Model.ToLower()">@Model</span>
@using LeafWeb.Core.Utility
@model string
<span class="status status-@Model.ToLower()">@Model.SplitCamelCase()</span>