@model Disco.Web.Areas.Config.Models.DocumentTemplate.IndexModel
@{
    Authorization.Require(Claims.Config.DocumentTemplate.Show);

    ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates");
}
@if (Model.DocumentTemplates.Count == 0)
{
    <div class="form" style="width: 450px; padding: 100px 0;">
        <h2>No document templates are configured</h2>
    </div>  
}
else
{
    <table class="tableData">
        <tr>
            <th>Id
            </th>
            <th>Description
            </th>
            <th>Scope
            </th>
        </tr>
        @foreach (var item in Model.DocumentTemplates)
        {
            <tr>
                <td>
                    @Html.ActionLink(item.Id.ToString(), MVC.Config.DocumentTemplate.Index(item.Id))
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Description)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Scope)
                </td>
            </tr>
        }
    </table>
}
<div class="actionBar">
    @if (Authorization.Has(Claims.Config.DocumentTemplate.UndetectedPages))
    {
        @Html.ActionLinkButton("Undetected Pages", MVC.Config.DocumentTemplate.UndetectedPages())
    }
    @if (Authorization.Has(Claims.Config.DocumentTemplate.ShowStatus))
    {
        @Html.ActionLinkButton("Import Status", MVC.Config.DocumentTemplate.ImportStatus())
    }
    @if (Authorization.Has(Claims.Config.Show))
    {
        @Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser())
    }
    @if (Authorization.HasAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure))
    {
        @Html.ActionLinkButton("Create Document Template", MVC.Config.DocumentTemplate.Create())
    }
</div>
