Add priority
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
@model QueueViewModel
|
||||
@using LeafWeb.Core.Entities
|
||||
@model QueueViewModel
|
||||
|
||||
@{
|
||||
var grid = new WebGrid(Model.Items, rowsPerPage: 45);
|
||||
@@ -15,7 +16,7 @@
|
||||
grid.Column("SiteId", "Site Id"),
|
||||
grid.Column("Name", "Submitted By"),
|
||||
//grid.Column("FileCount", "Input files"),
|
||||
grid.Column("TotalInProgressTime", "In-Progress Time", item => ((TimeSpan)item.TotalInProgressTime).ToRoundedReadableString()),
|
||||
grid.Column("TimeInProgress", "Time In Progress", item => TimeInProgress(item.TimeInProgress)),
|
||||
grid.Column("CurrentStatus", "Status", item => Html.Partial("DisplayTemplates/_LeafInputStatus", (string)item.CurrentStatus.ToString())),
|
||||
grid.Column("Total Results: " + Model.Items.Count(), format: item => Btns(item))),
|
||||
htmlAttributes: new { @class = "table table-striped table-bordered table-hover table-condensed" }
|
||||
@@ -33,15 +34,19 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li>@DetailsLink(item)</li>
|
||||
<li @DisableItem(!item.HasLeafChart)>@ChartLink(item)</li>
|
||||
@if (item.IsPending)
|
||||
{
|
||||
<li role="separator" class="divider"></li>
|
||||
<li class="dropdown-header">Priority</li>
|
||||
<li @DisableItem(item.PendingPriority == Priority.High)>@PriorityForm(item, Priority.High)</li>
|
||||
<li @DisableItem(item.PendingPriority == Priority.Normal)>@PriorityForm(item, Priority.Normal)</li>
|
||||
<li @DisableItem(item.PendingPriority == Priority.Low)>@PriorityForm(item, Priority.Low)</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>
|
||||
<li>@SetPriorityLow(item, "Set Low")</li>*@
|
||||
<li role="separator" class="divider"></li>
|
||||
<li class="dropdown-header">Download</li>
|
||||
<li>@DownloadInput(item)</li>
|
||||
@@ -63,19 +68,6 @@
|
||||
@Html.Partial("DisplayTemplates/_ChartLink", (int)item.Id)
|
||||
}
|
||||
|
||||
@helper SetPriorityHigh(dynamic item, string label)
|
||||
{
|
||||
<a href="@Url.Action("SetPriorityHigh", "Queue", new {id = item.Id})">
|
||||
<span class="glyphicon glyphicon-arrow-up"></span> @label
|
||||
</a>
|
||||
}
|
||||
@helper SetPriorityLow(dynamic item, string label)
|
||||
{
|
||||
<a href="@Url.Action("SetPriorityLow", "Queue", new {id = item.Id})">
|
||||
<span class="glyphicon glyphicon-arrow-down"></span> @label
|
||||
</a>
|
||||
}
|
||||
|
||||
@helper DownloadInput(dynamic item)
|
||||
{
|
||||
<a href="@Url.Action("DownloadInput", "Queue", new {id = item.Id})">
|
||||
@@ -88,6 +80,13 @@
|
||||
<span class="glyphicon glyphicon-download"></span> ToUser
|
||||
</a>
|
||||
}
|
||||
@helper TimeInProgress(TimeSpan timeSpan)
|
||||
{
|
||||
if (timeSpan > TimeSpan.Zero)
|
||||
{
|
||||
@timeSpan.ToRoundedReadableString()
|
||||
}
|
||||
}
|
||||
@helper DeleteLink(dynamic item)
|
||||
{
|
||||
@Html.Partial("DisplayTemplates/_DeleteForm", (Tuple<int, string, bool>)Tuple.Create(item.Id, item.Identifier, item.IsDeletable))
|
||||
@@ -98,6 +97,11 @@
|
||||
@Html.Partial("DisplayTemplates/_CancelForm", (Tuple<int, string>)Tuple.Create(item.Id, item.Identifier))
|
||||
}
|
||||
|
||||
@helper PriorityForm(dynamic item, Priority priority)
|
||||
{
|
||||
@Html.Partial("DisplayTemplates/_PriorityForm", (Tuple<int, Priority, Priority>)Tuple.Create(item.Id, item.PendingPriority, priority))
|
||||
}
|
||||
|
||||
@helper DisableItem(bool disabled)
|
||||
{
|
||||
if (disabled) {<text>class="disabled"</text>}
|
||||
|
||||
Reference in New Issue
Block a user