feature: scheduled flag removal
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
Authorization.Require(Claims.Config.DeviceFlag.Show);
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Flags");
|
||||
var showTags = Model.DeviceFlags.Keys.Any(i => i.DevicesLinkedGroup != null || i.DeviceUsersLinkedGroup != null ||
|
||||
i.OnAssignmentExpression != null || i.OnUnassignmentExpression != null);
|
||||
i.OnAssignmentExpression != null || i.OnUnassignmentExpression != null || i.DefaultRemoveDays.HasValue);
|
||||
}
|
||||
<div id="Config_DeviceFlags_Index">
|
||||
@if (Model.DeviceFlags.Count == 0)
|
||||
@@ -59,6 +59,10 @@
|
||||
{
|
||||
<i class="fa fa-bolt fa-lg alert" title="Has Expressions"></i>
|
||||
}
|
||||
@if (item.DefaultRemoveDays.HasValue)
|
||||
{
|
||||
<i class="fa fa-clock-o fa-lg" title="Has Default Unassignment"></i>
|
||||
}
|
||||
</td>
|
||||
}
|
||||
</tr>
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Disco.Web.Areas.Config.Views.DeviceFlag
|
||||
Authorization.Require(Claims.Config.DeviceFlag.Show);
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Flags");
|
||||
var showTags = Model.DeviceFlags.Keys.Any(i => i.DevicesLinkedGroup != null || i.DeviceUsersLinkedGroup != null ||
|
||||
i.OnAssignmentExpression != null || i.OnUnassignmentExpression != null);
|
||||
i.OnAssignmentExpression != null || i.OnUnassignmentExpression != null || i.DefaultRemoveDays.HasValue);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -141,37 +141,37 @@ WriteLiteral(" </tr>\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <td>\r\n <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 1229), Tuple.Create("\"", 1285)
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 1261), Tuple.Create("\"", 1317)
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1236), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.DeviceFlag.Index(item.Id))
|
||||
, Tuple.Create(Tuple.Create("", 1268), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.DeviceFlag.Index(item.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1236), false)
|
||||
, 1268), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1319), Tuple.Create("\"", 1372)
|
||||
, Tuple.Create(Tuple.Create("", 1327), Tuple.Create("fa", 1327), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1329), Tuple.Create("fa-", 1330), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1351), Tuple.Create("\"", 1404)
|
||||
, Tuple.Create(Tuple.Create("", 1359), Tuple.Create("fa", 1359), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1361), Tuple.Create("fa-", 1362), true)
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1333), Tuple.Create<System.Object, System.Int32>(item.Icon
|
||||
, Tuple.Create(Tuple.Create("", 1365), Tuple.Create<System.Object, System.Int32>(item.Icon
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1333), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 1345), Tuple.Create("fa-lg", 1346), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1351), Tuple.Create("d-", 1352), true)
|
||||
, 1365), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 1377), Tuple.Create("fa-lg", 1378), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1383), Tuple.Create("d-", 1384), true)
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1354), Tuple.Create<System.Object, System.Int32>(item.IconColour
|
||||
, Tuple.Create(Tuple.Create("", 1386), Tuple.Create<System.Object, System.Int32>(item.IconColour
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1354), false)
|
||||
, 1386), false)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
@@ -313,12 +313,37 @@ WriteLiteral("></i>\r\n");
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 62 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
if (item.DefaultRemoveDays.HasValue)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-clock-o fa-lg\"");
|
||||
|
||||
WriteLiteral(" title=\"Has Default Unassignment\"");
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
|
||||
|
||||
#line 65 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n");
|
||||
|
||||
|
||||
#line 63 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
#line 67 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -327,7 +352,7 @@ WriteLiteral(" </td>\r\n");
|
||||
WriteLiteral(" </tr>\r\n");
|
||||
|
||||
|
||||
#line 65 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
#line 69 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -336,7 +361,7 @@ WriteLiteral(" </tr>\r\n");
|
||||
WriteLiteral(" </table>\r\n");
|
||||
|
||||
|
||||
#line 67 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
#line 71 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -349,13 +374,13 @@ WriteLiteral(" class=\"actionBar\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 69 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
#line 73 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 69 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
#line 73 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
if (Authorization.Has(Claims.Config.DeviceFlag.Export) && Model.DeviceFlags.Count > 0)
|
||||
{
|
||||
|
||||
@@ -363,14 +388,14 @@ WriteLiteral(">\r\n");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 71 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
#line 75 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Export", MVC.Config.DeviceFlag.Export()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 71 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
#line 75 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
|
||||
}
|
||||
|
||||
@@ -380,7 +405,7 @@ WriteLiteral(">\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 73 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
#line 77 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
if (Authorization.Has(Claims.Config.DeviceFlag.Create))
|
||||
{
|
||||
|
||||
@@ -388,14 +413,14 @@ WriteLiteral(" ");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 75 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
#line 79 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Create Device Flag", MVC.Config.DeviceFlag.Create()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 75 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
#line 79 "..\..\Areas\Config\Views\DeviceFlag\Index.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -212,6 +212,50 @@
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Scheduled Unassignment:
|
||||
</th>
|
||||
<td>
|
||||
@if (canConfig)
|
||||
{
|
||||
<input id="DeviceFlag_DefaultRemoveDays" type="number" min="1" max="@int.MaxValue" value="@Model.DeviceFlag.DefaultRemoveDays" />
|
||||
@AjaxHelpers.AjaxSave()
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
@:days
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
document.DiscoFunctions.PropertyChangeHelper(
|
||||
$('#DeviceFlag_DefaultRemoveDays'),
|
||||
'Invalid Value',
|
||||
'@(Url.Action(MVC.API.DeviceFlag.UpdateDefaultRemoveDays(Model.DeviceFlag.Id)))',
|
||||
'defaultRemoveDays'
|
||||
);
|
||||
});
|
||||
</script>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Model.DeviceFlag.DefaultRemoveDays.HasValue)
|
||||
{
|
||||
<span><strong>@Model.DeviceFlag.DefaultRemoveDays</strong> days</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span><em>Not Enabled</em></span>
|
||||
}
|
||||
}
|
||||
<div class="info-box">
|
||||
<p class="fa-p">
|
||||
<i class="fa fa-fw fa-info-circle"></i>
|
||||
Optionally specify the number of days a flag is removed from a device.
|
||||
If one (1), the flag will be removed that night (midnight).<br />
|
||||
If the user has permission, the date can be adjusted when assigning the flag.
|
||||
Changing this value does not affect existing assignments.
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@if (hideAdvanced)
|
||||
{
|
||||
<tr>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user