@model PantheonRA.BackOffice.Models.CompanyUnitsFilterModel
@{
    ViewBag.Title = Loc.CompanyUnits;
    var isLocME = PantheonRA.BackOffice.CurrentUser.Localization == PAW.Contracts.Enums.Localization.Code.ME;
}

<div class="wrapper wrapper-content">
    <div class="tabs-container">
        @Html.Partial("~/Views/Company/_CompanySettingsTabNavigation.cshtml")
        <div class="row buttons-tabbed">
            <a href="@Url.Action("Create", "CompanyUnits")" data-method="initializeCompanyUnitsCreate" id="createCompanyUnitButton" class="btn btn-success pull-right">
                <i class="fa fa-plus" title="@Loc.CreateNewCompanyUnit"></i><span class="bold visible-lg-inline visible-md-inline m-l-xs">@Loc.CreateNewCompanyUnit</span>
            </a>
        </div>

        <div class="row document-head">
            <div class="col-md-4 col-xs-6">
                <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 class="col-md-3 col-xs-6">
                <div class="form-group">
                    <label class="control-label">@Loc.Status</label>
                    @Html.DropDownListFor(model => model.Status, new SelectList(ViewBag.ActiveStatuses != null ? ViewBag.ActiveStatuses : new List<string>(), "Value", "Text"),
                        HtmlAttributesHelper.CreateInputAttributes("form-control search-addon custom-select", "Status", false))
                </div>
            </div>
        </div>

        <div class="project-list">
            <div class="document-list document-list-no-footer">
                <table id="mainGrid" data-grid-id="company-units" data-url="@Url.Action("_CompanyUnitList", "CompanyUnits")" class="list-table">
                    <thead>
                        <tr>
                            <th>@Loc.ActiveShort</th>
                            <th data-url="@Url.Action("Edit", "CompanyUnits")?id=" data-method="initializeCompanyUnitsEdit">@Loc.Code</th>
                            <th data-url="@Url.Action("Edit", "CompanyUnits")?id=" data-method="initializeCompanyUnitsEdit">@Loc.Name</th>
                            <th>@Loc.MovableType</th>
                            <th>@Loc.Street</th>
                            <th>@Loc.GridZipCode</th>
                            <th>@Loc.Region</th>
                            <th>@Loc.CadNr</th>
                            <th>@Loc.BuildNr</th>
                            <th>@Loc.BuildSecNr</th>
                            <th data-visible="@(isLocME ? true : false)" data-default-hidden="@(isLocME ? false : true)">@Loc.WorkPlaceCode</th>
                            <th data-visible="@(isLocME ? true : false)" data-default-hidden="@(isLocME ? false : true)">@Loc.EnuIntCode</th>
                            <th data-visible="@(isLocME ? true : false)" data-default-hidden="@(isLocME ? false : true)">@Loc.ERPCode</th>
                            <th data-visible="@(isLocME ? true : false)" data-default-hidden="@(isLocME ? false : true)">@Loc.ERPDeveloperCode</th>
                            <th data-visible="@(isLocME ? true : false)" data-default-hidden="@(isLocME ? false : true)">@Loc.TCRCode</th>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>
    </div>
</div>

<input type="hidden" id="MovableWorkplace" value="@Loc.MovableWorkplace" />
<input type="hidden" id="FixedMovableWorkplace" value="@Loc.FixedMovableWorkplace" />
<input type="hidden" id="DeviceWorkplace" value="@Loc.DeviceWorkplace" />
<input type="hidden" id="NonMovabeWorkplace" value="@Loc.NonMovabeWorkplace" />

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