@model PantheonRA.BackOffice.Models.BaseGridFilterModel
@{
    ViewBag.Title = Loc.DocType;
    var isLocRS = (PantheonRA.BackOffice.CurrentUser.Localization == PAW.Contracts.Enums.Localization.Code.RS);
}

<div class="wrapper wrapper-content">
    <div class="tabs-container">
        @Html.Partial("~/Views/Company/_CompanySettingsTabNavigation.cshtml")
        <div class="row buttons-tabbed">
            @*TODO: uncomment when adding implemented*@
            @*<div class="row buttons-ribbon floating-buttons">
                    <div>
                        <a href="@Url.Action("Create", "DocumentType")" data-method="initializeDocumentTypeEdit" class="btn btn-success pull-right">
                            <i class="fa fa-plus" title="@Loc.CreateNewDocumentType"></i><span class="bold visible-lg-inline visible-md-inline m-l-xs">@Loc.CreateNewDocumentType</span>
                        </a>
                    </div>
                </div>*@
        </div>

        <div class="row document-head">
            <div class="col-md-3">
                <div class="form-group">
                    <label class="control-label">@Loc.SearchFilter</label>
                    @Html.TextBoxFor(model => model.Keywords, new { @id = "Keywords", @class = "form-control search-input", @placeholder = Loc.Search, autocomplete = "off" })
                </div>
            </div>
        </div>

        <div class="texts-list project-list">
            <div class="document-list document-list-no-footer">
                <table id="mainGrid" data-grid-id="document-type" data-url="@Url.Action("DocumentTypeList", "DocumentType")" class="list-table">
                    <thead>
                        <tr>
                            <th width="10%" data-url="@Url.Action("Edit", "DocumentType")?id=" data-method="initializeDocumentTypeEdit">@Loc.Code</th>
                            <th width="70%" data-url="@Url.Action("Edit", "DocumentType")?id=" data-method="initializeDocumentTypeEdit">@Loc.Name</th>
                            <th width="20%" 
                                data-url="@Url.Action("Edit", "CompanyUnits")?id=" 
                                data-visible="@(isLocRS ? false : true)"
                            >@Loc.CompanyUnit</th>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
</div>

@section pageScripts{
    @Scripts.Render("~/bundles/admin")
    <script>
        $(document).ready(function () {
            initializeDocumentType();
        });
    </script>
}