Add priority
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
@using LeafWeb.Core.Entities
|
||||
@model Priority
|
||||
@{
|
||||
switch (Model)
|
||||
{
|
||||
case Priority.Normal:<span class="glyphicon glyphicon-unchecked"></span>break;
|
||||
case Priority.Low:<span class="glyphicon glyphicon-collapse-down"></span>break;
|
||||
case Priority.High:<span class="glyphicon glyphicon-collapse-up"></span>break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
@model TimeSpan?
|
||||
@{
|
||||
Layout = "~/Views/Shared/DisplayTemplates/_FieldLayout.cshtml";
|
||||
var val =
|
||||
Model.HasValue
|
||||
?
|
||||
ViewData.ModelMetadata.DisplayFormatString != null
|
||||
? string.Format(ViewData.ModelMetadata.DisplayFormatString, Model)
|
||||
: Model.Value.ToReadableString()
|
||||
: string.Empty;
|
||||
}
|
||||
|
||||
@(Model == null ? Html.Encode(ViewData.ModelMetadata.NullDisplayText) : Html.Encode(val))
|
||||
@@ -0,0 +1,24 @@
|
||||
@using LeafWeb.WebCms.Controllers
|
||||
@model Tuple<int, LeafWeb.Core.Entities.Priority, LeafWeb.Core.Entities.Priority>
|
||||
@{
|
||||
var leafInputId = Model.Item1;
|
||||
var currentPriority = Model.Item2;
|
||||
var formPriority = Model.Item3;
|
||||
}
|
||||
@if (currentPriority != formPriority)
|
||||
{
|
||||
using (Html.BeginUmbracoForm<QueueController>("Priority", null, new {@class = "clearfix"}))
|
||||
{
|
||||
<input type="hidden" name="id" value="@leafInputId"/>
|
||||
<input type="hidden" name="priority" value="@formPriority"/>
|
||||
<button type="submit" class="btn btn-link">
|
||||
@Html.Partial("DisplayTemplates/PriorityIcon", formPriority) Set @formPriority
|
||||
</button>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<a href="#" class="alert-warning">
|
||||
@Html.Partial("DisplayTemplates/PriorityIcon", formPriority) @formPriority
|
||||
</a>
|
||||
}
|
||||
Reference in New Issue
Block a user