Update button rendering, move css classes to viewdata

This commit is contained in:
2020-06-26 21:40:20 -04:00
parent 7e88de5041
commit 55f59ddd7a
11 changed files with 208 additions and 112 deletions
@@ -1,17 +1,15 @@
@using LeafWeb.WebCms.Controllers
@model Tuple<int, string, bool, bool>
@using LeafWeb.WebCms.Utility
@model Tuple<int, string>
@{
var leafInputId = Model.Item1;
var identifier = Model.Item2;
var isDeletable = Model.Item3;
// true for a link, false for a button
var buttonType = Model.Item4 ? "btn-link" : "btn-outline-secondary";
}
@using (Html.BeginUmbracoForm<QueueController>("Delete", null,
new { @class = "confirm clearfix", confirm_msg = "Deletion cannot be undone! Confirm deleting '" + identifier + "'." }))
{
<input type="hidden" name="id" value="@leafInputId"/>
<button type="submit" class="btn @buttonType" @{if (!isDeletable) { <text> disabled="disabled" </text> }}>
<button type="submit" @Html.Partial("DisplayTemplates/_ViewDataCssClass") @if(ViewData.IsButtonDisabled()) {<text>disabled</text>}>
<span class="fa fa-remove"></span> Delete
</button>
}