@model WebApp.Models.StorageModel

<link href="~/Content/jquery.dataTables.min.css" rel="stylesheet" />
@{
    ViewBag.Title = "View";
}

<h2>Документы</h2>
<br />
<div class="row">
    <div class="col-md-6">
        <form class="form-inline" action="Documents" method="get">
            <div class="form-group">
                <label class="sr-only" for="searchStr">Поиск по документам</label>  
                @Html.EditorFor(Model => Model.SearchString, new { htmlAttributes = new { name = "q", @class = "form-control" } })
            </div>
            <input name="submit" type="submit" value="Поиск" class="btn btn-primary" />
            @Html.ActionLink("Все документы", "Documents", null, new { type = "no", @class = "btn btn-info" })
        </form>
    </div>
    <div class="col-md-6 text-right">
        <div class="form-inline">
            @Html.ActionLink("Загрузить новый документ", "Upload", null, new { @class = "btn btn-warning" })
        </div>
    </div>
</div>

<br />
<div id="doctab">
    @{Html.RenderPartial("_DocumentsListContainer", Model);}
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/dataTables")
    <script>
        $(document).ready(function () {
            $('#docsTable').DataTable({
                "paging": true,
                "lengthMenu": [[5, 10, 25, 50, -1], [5, 10, 25, 50, "All"]],
                "ordering": true,
                "info": true,
                "searching": false,
                "language": {
                    "url": "../Content/Russian.json"
                },
                "columns": [null, null, null, { "orderable": false }]
            });
        });
    </script>
}