Files
LeafWeb/WebCms/Views/Queue/Details.cshtml
T
poprhythm 2b5de1c4cd Replace WebGridBootstrapPager
Improve Leaf details page
2020-06-28 17:37:06 -04:00

102 lines
3.3 KiB
Plaintext

@using LeafWeb.WebCms.Controllers
@using LeafWeb.WebCms.Utility
@model LeafInputDetails
<div class="row pb-3">
@ChartLink(Model)
<div class="dropdown pl-3">
<button class="btn btn-outline-secondary dropdown-toggle" id="downloadButton"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="fa fa-download"></span> Download
</button>
<div class="dropdown-menu" aria-labelledby="downloadButton">
<a href="@Url.Action("DownloadInput", "Queue", new {id = Model.LeafInputId})"
class="dropdown-item">
Input
</a>
<a href="@Url.Action("DownloadOutputToUser", "Queue", new {id = Model.LeafInputId})"
class="dropdown-item @if (!Model.HasOutputFiles) {<text> disabled</text>}">
ToUser
</a>
<a href="@Url.Action("DownloadOutputNotToUser", "Queue", new {id = Model.LeafInputId})"
class="dropdown-item @if (!Model.HasOutputFiles) {<text> disabled</text>}">
NotToUser
</a>
</div>
</div>
<div class="dropdown pl-3">
<button class="btn btn-outline-secondary dropdown-toggle" id="utilityButton"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Utility
</button>
<div class="dropdown-menu" aria-labelledby="utilityButton">
@using (Html.BeginUmbracoForm<QueueController>(
"SendUserDownloadLink", null, new {@class = "confirm", confirm_msg = "Confirm sending email to user"}))
{
<input type="hidden" name="id" value="@Model.LeafInputId"/>
<button type="submit" class="dropdown-item text-left"
@{if (!Model.HasOutputFiles)
{
<text> disabled="disabled" </text>
}}>
<span class="fa fa-send"></span> Email User Download link
</button>
}
</div>
</div>
@if (Model.IsCancellable)
{
<div class="pl-3">
@CancelLink(Model)
</div>
}
<div class="pl-3">
@DeleteLink(Model)
</div>
</div>
<div class="row">
<div class="container">
@Html.DisplayForModel()
</div>
</div>
@helper ChartLink(dynamic item)
{
var cssClass
= CssClassUtil.CreateCssClassDataDictionary("btn", "btn-outline-secondary");
if (!item.HasLeafChart)
{
cssClass.SetCssDisabled();
}
@Html.Partial("DisplayTemplates/_ChartLink", (int)item.LeafInputId, cssClass)
}
@helper DeleteLink(LeafInputDetails item)
{
var cssClass
= CssClassUtil.CreateCssClassDataDictionary("btn", "btn-outline-secondary");
if (!item.IsDeletable)
{
cssClass.SetCssDisabled();
}
@Html.Partial("DisplayTemplates/_DeleteForm", Tuple.Create(item.LeafInputId, item.Identifier), cssClass)
}
@helper CancelLink(LeafInputDetails item)
{
var cssClass
= CssClassUtil.CreateCssClassDataDictionary("btn", "btn-outline-secondary");
if (!item.IsCancellable)
{
cssClass.SetCssDisabled();
}
@Html.Partial("DisplayTemplates/_CancelForm", Tuple.Create(item.LeafInputId, item.Identifier), cssClass)
}