@model PantheonRA.BackOffice.Models.VehiclesGridFilterModel
@using PantheonRA.BackOffice.Models

@{
    ViewBag.Title = Loc.Vehicles;
}

@Html.Hidden("Delete", Url.Action("Delete", "Vehicles"))

<div class="wrapper wrapper-content">
    <div class="tabs-container">
        <nav>
            <ul class="nav nav-tabs horizontal-menu custom-scrollable-tabs" role="tablist">
                <li class="nav-item"><a href="@Url.Action("Create", "Vehicles")">@Loc.NewVehicle</a></li>
                <li class="nav-item active"><a href="@Url.Action("Index", "Vehicles")">@Loc.MenuVehicles</a></li>
            </ul>
        </nav>
        <div class="row pull-right buttons-tabbed">
            @Html.Partial("_FormButtons", new FormButtonsViewModel
       {
           ShowCloseBtn = false,
           BackUrl = Url.Action("Index", "Vehicles"),
           CreateButtonGroup = new FormButtonGroup
           {
               IsButtonName = true,
               ButtonName = Loc.AddVehicle,
               Buttons = new List<FormButton>
               {
                   new FormButton { Url = Url.Action("Create", "Vehicles") }
               }
           },
           DeleteButtonGroup = new FormButtonGroup
           {
               IsActive = false,
               Buttons = new List<FormButton>
               {
                   new FormButton { OnClick = "gridDelete('/Vehicles/Delete')" }
               }
           }
       })
        </div>

        <div class="tab-content">
            <div class="row document-head">
                <div class="col-md-2 col-sm-12 col-xs-12">
                    <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-10 hidden-sm hidden-xs"></div>
            </div>
        </div>

        <div class="project-list">
            <table id="vehicles" data-grid-id="vehicles" data-url="@Url.Action("VehiclesList", "Vehicles")" class="list-table">
                <thead>
                    <tr>
                        <th class="dt-head-center"></th>
                        <th data-url="@Url.Action("Edit","Vehicles")?inventNumber=">@Loc.CarRegNo</th>
                        <th>@Loc.Name</th>
                        <th>@Loc.Note</th>
                        <th class="dt-head-center">@Loc.FixedAsset</th>
                        <th>@Loc.SupportCar</th>
                        <th class="dt-head-center">@Loc.IsActive</th>
                    </tr>
                </thead>
            </table>
        </div>
    </div>
</div>

<script src="~/Scripts/custom/vehicles/vehicles.js"></script>

<script>
    $(document).ready(function () {
        initializeVehicles();
    });
</script>

@* TODO: remove after refactor *@
@section pageScripts{
    @Scripts.Render("~/bundles/validation")
    <script src="~/Scripts/global-script.js"></script>
}