Improvments for dropdown menus
This commit is contained in:
@@ -1,43 +1,46 @@
|
|||||||
@using LeafWeb.WebCms.Controllers
|
@using LeafWeb.WebCms.Controllers
|
||||||
@model LeafInputDetails
|
@model LeafInputDetails
|
||||||
|
|
||||||
<div class="row">
|
<div class="row pb-3">
|
||||||
@Html.Partial("DisplayTemplates/_ChartButton", Model.LeafInputId, new ViewDataDictionary {{"Disabled", !Model.HasLeafChart}})
|
@Html.Partial("DisplayTemplates/_ChartButton", Model.LeafInputId, new ViewDataDictionary {{"Disabled", !Model.HasLeafChart}})
|
||||||
|
|
||||||
<div class="dropdown">
|
<div class="dropdown pl-3">
|
||||||
<button class="btn btn-outline-secondary dropdown-toggle" id="downloadButton"
|
<button class="btn btn-outline-secondary dropdown-toggle" id="downloadButton"
|
||||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
Download
|
<span class="fa fa-download"></span> Download
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu" aria-labelledby="downloadButton">
|
<div class="dropdown-menu" aria-labelledby="downloadButton">
|
||||||
<a href="@Url.Action("DownloadInput", "Queue", new {id = Model.LeafInputId})"
|
<a href="@Url.Action("DownloadInput", "Queue", new {id = Model.LeafInputId})"
|
||||||
class="dropdown-item">
|
class="dropdown-item">
|
||||||
<span class="fa fa-download"></span> Input
|
Input
|
||||||
</a>
|
</a>
|
||||||
<a href="@Url.Action("DownloadOutputToUser", "Queue", new {id = Model.LeafInputId})"
|
<a href="@Url.Action("DownloadOutputToUser", "Queue", new {id = Model.LeafInputId})"
|
||||||
class="dropdown-item @if (!Model.HasOutputFiles) {<text> disabled</text>}" >
|
class="dropdown-item @if (!Model.HasOutputFiles) {<text> disabled</text>}">
|
||||||
<span class="fa fa-download"></span> ToUser
|
ToUser
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="@Url.Action("DownloadOutputNotToUser", "Queue", new {id = Model.LeafInputId})"
|
<a href="@Url.Action("DownloadOutputNotToUser", "Queue", new {id = Model.LeafInputId})"
|
||||||
class="dropdown-item @if (!Model.HasOutputFiles) {<text> disabled</text>}" >
|
class="dropdown-item @if (!Model.HasOutputFiles) {<text> disabled</text>}">
|
||||||
<span class="fa fa-download"></span> NotToUser
|
NotToUser
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="dropdown">
|
<div class="dropdown pl-3">
|
||||||
<button class="btn btn-outline-secondary dropdown-toggle" id="utilityButton"
|
<button class="btn btn-outline-secondary dropdown-toggle" id="utilityButton"
|
||||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
Utility
|
Utility
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu" aria-labelledby="utilityButton">
|
<div class="dropdown-menu" aria-labelledby="utilityButton">
|
||||||
@using (Html.BeginUmbracoForm<QueueController>(
|
@using (Html.BeginUmbracoForm<QueueController>(
|
||||||
"SendUserDownloadLink", null, new { @class = "confirm", confirm_msg = "Confirm sending email to user" }))
|
"SendUserDownloadLink", null, new {@class = "confirm", confirm_msg = "Confirm sending email to user"}))
|
||||||
{
|
{
|
||||||
<input type="hidden" name="id" value="@Model.LeafInputId" />
|
<input type="hidden" name="id" value="@Model.LeafInputId"/>
|
||||||
<button type="submit" class="dropdown-item text-left"
|
<button type="submit" class="dropdown-item text-left"
|
||||||
@{if (!Model.HasOutputFiles) { <text> disabled="disabled" </text> }}>
|
@{if (!Model.HasOutputFiles)
|
||||||
|
{
|
||||||
|
<text> disabled="disabled" </text>
|
||||||
|
}}>
|
||||||
<span class="fa fa-send"></span> Email User Download link
|
<span class="fa fa-send"></span> Email User Download link
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
@@ -46,11 +49,14 @@
|
|||||||
|
|
||||||
@if (Model.IsCancellable)
|
@if (Model.IsCancellable)
|
||||||
{
|
{
|
||||||
|
<div class="pl-3">
|
||||||
@CancelLink(Model)
|
@CancelLink(Model)
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<div class="pl-3">
|
||||||
@DeleteLink(Model)
|
@DeleteLink(Model)
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
@@ -111,8 +111,8 @@ else
|
|||||||
<span class="d-none d-sm-inline">Actions</span>
|
<span class="d-none d-sm-inline">Actions</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu" aria-labelledby="actions(@item.Id)">
|
<div class="dropdown-menu" aria-labelledby="actions(@item.Id)">
|
||||||
<button class="dropdown-item">@DetailsLink(item)</button>
|
@DetailsLink(item)
|
||||||
<button class="dropdown-item @DisableItem(!item.HasLeafChart)">@ChartLink(item)</button>
|
@ChartLink(item)
|
||||||
@if (item.IsPending)
|
@if (item.IsPending)
|
||||||
{
|
{
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
@@ -124,11 +124,11 @@ else
|
|||||||
@if (item.IsCancellable)
|
@if (item.IsCancellable)
|
||||||
{
|
{
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<button class="dropdown-item">@CancelLink(item)</button>
|
@CancelLink(item)
|
||||||
}
|
}
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<h6 class="dropdown-header">Download</h6>
|
<h6 class="dropdown-header">Download</h6>
|
||||||
<button class="dropdown-item">@DownloadInput(item)</button>
|
@DownloadInput(item)
|
||||||
<button class="dropdown-item @DisableItem(!item.HasOutputFiles)">@DownloadOutputToUser(item)</button>
|
<button class="dropdown-item @DisableItem(!item.HasOutputFiles)">@DownloadOutputToUser(item)</button>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<button class="dropdown-item @DisableItem(!item.IsDeletable)">@DeleteLink(item)</button>
|
<button class="dropdown-item @DisableItem(!item.IsDeletable)">@DeleteLink(item)</button>
|
||||||
@@ -139,23 +139,28 @@ else
|
|||||||
|
|
||||||
@helper DetailsLink(dynamic item)
|
@helper DetailsLink(dynamic item)
|
||||||
{
|
{
|
||||||
@Html.Partial("DisplayTemplates/_DetailsLink", (int)item.Id)
|
@Html.Partial("DisplayTemplates/_DetailsLink", (int)item.Id, new ViewDataDictionary {{"cssClass", new[]{"dropdown-item"}}})
|
||||||
}
|
}
|
||||||
|
|
||||||
@helper ChartLink(dynamic item)
|
@helper ChartLink(dynamic item)
|
||||||
{
|
{
|
||||||
@Html.Partial("DisplayTemplates/_ChartLink", (int)item.Id)
|
var classes = new[]{"dropdown-item"};
|
||||||
|
if (!item.HasLeafChart)
|
||||||
|
{
|
||||||
|
classes = classes.Concat(new[] {"disabled"}).ToArray();
|
||||||
|
}
|
||||||
|
@Html.Partial("DisplayTemplates/_ChartLink", (int)item.Id, new ViewDataDictionary {{"cssClass", classes}})
|
||||||
}
|
}
|
||||||
|
|
||||||
@helper DownloadInput(dynamic item)
|
@helper DownloadInput(dynamic item)
|
||||||
{
|
{
|
||||||
<a href="@Url.Action("DownloadInput", "Queue", new {id = item.Id})">
|
<a href="@Url.Action("DownloadInput", "Queue", new {id = item.Id})" class="dropdown-item">
|
||||||
<span class="fa fa-download"></span> Input
|
<span class="fa fa-download"></span> Input
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
@helper DownloadOutputToUser(dynamic item)
|
@helper DownloadOutputToUser(dynamic item)
|
||||||
{
|
{
|
||||||
<a href="@Url.Action("DownloadOutputToUser", "Queue", new {id = item.Id})">
|
<a href="@Url.Action("DownloadOutputToUser", "Queue", new {id = item.Id})" class="dropdown-item">
|
||||||
<span class="fa fa-download"></span> ToUser
|
<span class="fa fa-download"></span> ToUser
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
@@ -197,17 +202,17 @@ else
|
|||||||
}
|
}
|
||||||
@helper DeleteLink(LeafInput item)
|
@helper DeleteLink(LeafInput item)
|
||||||
{
|
{
|
||||||
@Html.Partial("DisplayTemplates/_DeleteForm", Tuple.Create(item.Id, item.Identifier, item.IsDeletable, true))
|
@Html.Partial("DisplayTemplates/_DeleteForm", Tuple.Create(item.Id, item.Identifier, item.IsDeletable, true), new ViewDataDictionary {{"cssClass", new[]{"dropdown-item"}}})
|
||||||
}
|
}
|
||||||
|
|
||||||
@helper CancelLink(LeafInput item)
|
@helper CancelLink(LeafInput item)
|
||||||
{
|
{
|
||||||
@Html.Partial("DisplayTemplates/_CancelForm", Tuple.Create(item.Id, item.Identifier, true))
|
@Html.Partial("DisplayTemplates/_CancelForm", Tuple.Create(item.Id, item.Identifier, true), new ViewDataDictionary {{"cssClass", new[]{"dropdown-item"}}})
|
||||||
}
|
}
|
||||||
|
|
||||||
@helper PriorityForm(LeafInput item, Priority priority)
|
@helper PriorityForm(LeafInput item, Priority priority)
|
||||||
{
|
{
|
||||||
@Html.Partial("DisplayTemplates/_PriorityForm", Tuple.Create(item.Id, item.PendingPriority, priority))
|
@Html.Partial("DisplayTemplates/_PriorityForm", Tuple.Create(item.Id, item.PendingPriority, priority), new ViewDataDictionary {{"cssClass", new[]{"dropdown-item"}}})
|
||||||
}
|
}
|
||||||
|
|
||||||
@helper DisableItem(bool disabled)
|
@helper DisableItem(bool disabled)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
@{
|
@{
|
||||||
var url = UmbracoContext.Current.UrlProvider.GetUrl(LeafWebPageIds.Chart);
|
var url = UmbracoContext.Current.UrlProvider.GetUrl(LeafWebPageIds.Chart);
|
||||||
}
|
}
|
||||||
<a href="@url?leafInputId=@Model">
|
<a href="@url?leafInputId=@Model" @Html.Partial("DisplayTemplates/_ViewDataCssClass", new [] {"dropdown-item"}, ViewData)>
|
||||||
<span class="fa fa-line-chart"></span>
|
<span class="fa fa-line-chart"></span>
|
||||||
Chart
|
Chart
|
||||||
</a>
|
</a>
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
@{
|
@{
|
||||||
var url = UmbracoContext.Current.UrlProvider.GetUrl(LeafWebPageIds.Details);
|
var url = UmbracoContext.Current.UrlProvider.GetUrl(LeafWebPageIds.Details);
|
||||||
}
|
}
|
||||||
<a href="@url?id=@Model">
|
|
||||||
|
<a href="@url?id=@Model" @Html.Partial("DisplayTemplates/_ViewDataCssClass")>
|
||||||
<span class="fa fa-edit"></span> Details
|
<span class="fa fa-edit"></span> Details
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
@using System.Collections
|
||||||
|
@{
|
||||||
|
// pass in class name via the cssClass key in ViewData
|
||||||
|
if (ViewData.ContainsKey("cssClass"))
|
||||||
|
{
|
||||||
|
var cssClasses = (string[])ViewData["cssClass"];
|
||||||
|
<text>class="@string.Join(" ", cssClasses)"</text>
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1071,6 +1071,7 @@
|
|||||||
<Content Include="Views\MacroPartials\Membership\PasswordResetRequest.cshtml" />
|
<Content Include="Views\MacroPartials\Membership\PasswordResetRequest.cshtml" />
|
||||||
<Content Include="Views\Membership\PasswordResetRequest.cshtml" />
|
<Content Include="Views\Membership\PasswordResetRequest.cshtml" />
|
||||||
<Content Include="Views\Shared\DisplayTemplates\LeafInputDataSiteViewModels.cshtml" />
|
<Content Include="Views\Shared\DisplayTemplates\LeafInputDataSiteViewModels.cshtml" />
|
||||||
|
<Content Include="Views\Shared\DisplayTemplates\_ViewDataCssClass.cshtml" />
|
||||||
<None Include="Web.Debug.config">
|
<None Include="Web.Debug.config">
|
||||||
<DependentUpon>Web.config</DependentUpon>
|
<DependentUpon>Web.config</DependentUpon>
|
||||||
</None>
|
</None>
|
||||||
|
|||||||
Reference in New Issue
Block a user