Consolidate status markup.
Improved charting error reporting.
This commit is contained in:
@@ -48,28 +48,7 @@ else
|
||||
|
||||
@helper Status(LeafInput leafInput)
|
||||
{
|
||||
if (leafInput.IsPending)
|
||||
{
|
||||
<span class="text-nowrap">
|
||||
<span class="text-muted" title="@leafInput.PendingPriority.ToString() Priority">
|
||||
@Html.Partial("DisplayTemplates/PriorityIcon", leafInput.PendingPriority)
|
||||
</span>
|
||||
@Html.Partial("DisplayTemplates/_LeafInputStatus", leafInput.CurrentStatus.ToString())
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-nowrap">
|
||||
@Html.Partial("DisplayTemplates/_LeafInputStatus", leafInput.CurrentStatus.ToString())
|
||||
@if (leafInput.OutputErrorMessage != null)
|
||||
{
|
||||
<i class="fa fa-warning text-danger" title="Generated Error Message"></i>
|
||||
} else if (leafInput.OutputWarningMessage != null)
|
||||
{
|
||||
<i class="fa fa-warning text-info" title="Generated Warning Message"></i>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
@Html.Partial("DisplayTemplates/_LeafInputStatus", leafInput)
|
||||
}
|
||||
|
||||
@helper Btns(LeafInput item)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@model IQueryable<LeafWeb.Core.Entities.LeafInput>
|
||||
@using LeafWeb.Core.Entities
|
||||
@model IQueryable<LeafInput>
|
||||
|
||||
@{
|
||||
var grid = new WebGrid(Model, rowsPerPage: 45);
|
||||
@@ -9,14 +10,19 @@
|
||||
grid.Column("Identifier", "Identifier"),
|
||||
grid.Column("SiteId", "Site Id"),
|
||||
//grid.Column("Name", "Submitted By"),
|
||||
grid.Column("CurrentStatus", "Status", item => Html.Partial("DisplayTemplates/_LeafInputStatus", (string)item.CurrentStatus.ToString())),
|
||||
grid.Column("", "", item => ChartLink(item))
|
||||
grid.Column("CurrentStatus", "Status", item => Status(item.Value)),
|
||||
grid.Column("", "", item => ChartLink(item.Value))
|
||||
),
|
||||
htmlAttributes: new { @class = "table table-striped table-bordered table-hover table-condensed" }
|
||||
)
|
||||
@grid.BootstrapPager()
|
||||
|
||||
@helper ChartLink(dynamic item)
|
||||
@helper ChartLink(LeafInput leafInput)
|
||||
{
|
||||
@Html.Partial("DisplayTemplates/_ChartButton", (int)item.Id, new ViewDataDictionary { { "Disabled", !item.HasLeafChart }, {"xs", true} })
|
||||
}
|
||||
@Html.Partial("DisplayTemplates/_ChartButton", leafInput.Id, new ViewDataDictionary { { "Disabled", !leafInput.HasLeafChart }, {"xs", true} })
|
||||
}
|
||||
|
||||
@helper Status(LeafInput leafInput)
|
||||
{
|
||||
@Html.Partial("DisplayTemplates/_LeafInputStatus", leafInput)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,36 @@
|
||||
@using LeafWeb.Core.Utility
|
||||
@model string
|
||||
<span class="status status-@Model.ToLower()">@Model.SplitCamelCase()</span>
|
||||
@using LeafWeb.Core.Entities
|
||||
@model LeafInput
|
||||
|
||||
@if (Model.IsPending)
|
||||
{
|
||||
<span class="text-nowrap">
|
||||
<span class="text-muted" title="@Model.PendingPriority.ToString() Priority">
|
||||
@Html.Partial("DisplayTemplates/PriorityIcon", Model.PendingPriority)
|
||||
</span>
|
||||
@Html.Partial("DisplayTemplates/_Status", Model.CurrentStatus.ToString())
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-nowrap">
|
||||
@if (Model.IsRunning)
|
||||
{
|
||||
<span title="Time in progress: @Model.TimeInProgress.ToRoundedReadableString()">
|
||||
@Html.Partial("DisplayTemplates/_Status", Model.CurrentStatus.ToString())
|
||||
</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.Partial("DisplayTemplates/_Status", Model.CurrentStatus.ToString())
|
||||
}
|
||||
|
||||
@if (Model.OutputErrorMessage != null)
|
||||
{
|
||||
<i class="fa fa-warning text-danger" title="Generated Error Message"></i>
|
||||
}
|
||||
else if (Model.OutputWarningMessage != null)
|
||||
{
|
||||
<i class="fa fa-warning text-info" title="Generated Warning Message"></i>
|
||||
}
|
||||
</span>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
@using LeafWeb.Core.Utility
|
||||
@model string
|
||||
<span class="status status-@Model.ToLower()">@Model.SplitCamelCase()</span>
|
||||
Reference in New Issue
Block a user