4c91d03385
Flag Document Templates as hidden. UI changes aim to improve visibility of used features in lists.
74 lines
2.8 KiB
Plaintext
74 lines
2.8 KiB
Plaintext
@model Disco.Web.Areas.Config.Models.UserFlag.IndexModel
|
|
@{
|
|
Authorization.Require(Claims.Config.UserFlag.Show);
|
|
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "User Flags");
|
|
var showTags = Model.UserFlags.Keys.Any(i => i.UserDevicesLinkedGroup != null || i.UsersLinkedGroup != null ||
|
|
i.OnAssignmentExpression != null || i.OnUnassignmentExpression != null);
|
|
}
|
|
<div id="Config_UserFlags_Index">
|
|
@if (Model.UserFlags.Count == 0)
|
|
{
|
|
<div class="form" style="width: 450px; padding: 100px 0;">
|
|
<h2>No user flags are configured</h2>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<table class="tableData">
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
<th>Current Assignments</th>
|
|
@if (showTags)
|
|
{
|
|
<th> </th>
|
|
}
|
|
</tr>
|
|
@foreach (var pair in Model.UserFlags.OrderBy(i => i.Key.Name))
|
|
{
|
|
var item = pair.Key;
|
|
var assignmentCount = pair.Value;
|
|
<tr>
|
|
<td>
|
|
<a href="@Url.Action(MVC.Config.UserFlag.Index(item.Id))">
|
|
<i class="fa fa-@(item.Icon) fa-lg d-@(item.IconColour)"></i>
|
|
@item.Name
|
|
</a>
|
|
</td>
|
|
<td>
|
|
@if (string.IsNullOrWhiteSpace(item.Description))
|
|
{
|
|
<span class="smallMessage"><none></span>
|
|
}
|
|
else
|
|
{
|
|
@item.Description.ToHtmlComment()
|
|
}
|
|
</td>
|
|
<td>
|
|
@assignmentCount.ToString("N0")
|
|
</td>
|
|
@if (showTags)
|
|
{
|
|
<td>
|
|
@if (item.UserDevicesLinkedGroup != null || item.UsersLinkedGroup != null)
|
|
{
|
|
<i class="fa fa-link fa-lg success" title="Is Linked"></i>
|
|
}
|
|
@if (item.OnAssignmentExpression != null || item.OnUnassignmentExpression != null)
|
|
{
|
|
<i class="fa fa-bolt fa-lg alert" title="Has Expressions"></i>
|
|
}
|
|
</td>
|
|
}
|
|
</tr>
|
|
}
|
|
</table>
|
|
}
|
|
@if (Authorization.Has(Claims.Config.UserFlag.Create))
|
|
{
|
|
<div class="actionBar">
|
|
@Html.ActionLinkButton("Create User Flag", MVC.Config.UserFlag.Create())
|
|
</div>
|
|
}
|
|
</div> |