Update button rendering, move css classes to viewdata
This commit is contained in:
@@ -1,62 +1,64 @@
|
||||
@using LeafWeb.WebCms.Controllers
|
||||
@using LeafWeb.WebCms.Utility
|
||||
@model LeafInputDetails
|
||||
|
||||
<div class="row pb-3">
|
||||
@Html.Partial("DisplayTemplates/_ChartButton", Model.LeafInputId, new ViewDataDictionary {{"Disabled", !Model.HasLeafChart}})
|
||||
|
||||
@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>
|
||||
<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>
|
||||
<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 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>
|
||||
}
|
||||
|
||||
@if (Model.IsCancellable)
|
||||
{
|
||||
<div class="pl-3">
|
||||
@DeleteLink(Model)
|
||||
@CancelLink(Model)
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="pl-3">
|
||||
@DeleteLink(Model)
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="container">
|
||||
@@ -64,12 +66,37 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@helper ChartLink(dynamic item)
|
||||
{
|
||||
var cssClass
|
||||
= CssClassUtil.CreateCssClassDataDictionary("btn", "btn-outline-secondary");
|
||||
|
||||
if (!item.HasLeafChart)
|
||||
{
|
||||
cssClass.SetButtonDisabled();
|
||||
}
|
||||
@Html.Partial("DisplayTemplates/_ChartLink", (int)item.LeafInputId, cssClass)
|
||||
}
|
||||
|
||||
@helper DeleteLink(LeafInputDetails item)
|
||||
{
|
||||
@Html.Partial("DisplayTemplates/_DeleteForm", Tuple.Create(item.LeafInputId, item.Identifier, item.IsDeletable, false))
|
||||
var cssClass
|
||||
= CssClassUtil.CreateCssClassDataDictionary("btn", "btn-outline-secondary");
|
||||
if (!item.IsDeletable)
|
||||
{
|
||||
cssClass.SetButtonDisabled();
|
||||
}
|
||||
|
||||
@Html.Partial("DisplayTemplates/_DeleteForm", Tuple.Create(item.LeafInputId, item.Identifier), cssClass)
|
||||
}
|
||||
|
||||
@helper CancelLink(LeafInputDetails item)
|
||||
{
|
||||
@Html.Partial("DisplayTemplates/_CancelForm", Tuple.Create(item.LeafInputId, item.Identifier, false))
|
||||
var cssClass
|
||||
= CssClassUtil.CreateCssClassDataDictionary("btn", "btn-outline-secondary");
|
||||
if (!item.IsCancellable)
|
||||
{
|
||||
cssClass.SetButtonDisabled();
|
||||
}
|
||||
@Html.Partial("DisplayTemplates/_CancelForm", Tuple.Create(item.LeafInputId, item.Identifier), cssClass)
|
||||
}
|
||||
Reference in New Issue
Block a user