| | | 1 | | @model OzonOrdersWeb.ViewModels.OrderViewModels.OrderPageViewModel<OzonDomains.Models.Order, OServices.FiltersServices.F |
| | | 2 | | |
| | | 3 | | @{ |
| | 0 | 4 | | var paginationAction = ViewData["PaginationAction"] as string ?? "Index"; |
| | 0 | 5 | | var paginationController = ViewData["PaginationController"] as string ?? "Orders"; |
| | 0 | 6 | | var useOrdersIndexAjax = ViewData["UseOrdersIndexAjax"] as bool? == true; |
| | | 7 | | } |
| | | 8 | | |
| | | 9 | | <div class="pagination-controls orders-index-pagination-controls d-flex align-items-center gap-1 position-absolute"> |
| | 0 | 10 | | @if (Model.TotalPages > 1) |
| | | 11 | | { |
| | 0 | 12 | | @if (Model.TotalPages > 15) |
| | | 13 | | { |
| | 0 | 14 | | if (Model.PageNumber <= 8) |
| | | 15 | | { |
| | 0 | 16 | | @for (int i = 1; i <= 10; i++) |
| | | 17 | | { |
| | 0 | 18 | | if (useOrdersIndexAjax) |
| | | 19 | | { |
| | 0 | 20 | | <a href="#" data-orders-ajax-page="@(i)" |
| | 0 | 21 | | class="btn btn-primary orders-index-ajax-page-link @(i == Model.PageNumber ? "active" : "")"> |
| | | 22 | | } |
| | | 23 | | else |
| | | 24 | | { |
| | 0 | 25 | | <a asp-area="Studio2" asp-controller="@paginationController" asp-action="@paginationAction" asp- |
| | 0 | 26 | | class="btn btn-primary @(i == Model.PageNumber ? "active" : "")">@i</a> |
| | | 27 | | } |
| | | 28 | | } |
| | | 29 | | |
| | | 30 | | <span>...</span> |
| | 0 | 31 | | if (useOrdersIndexAjax) |
| | | 32 | | { |
| | 0 | 33 | | <a href="#" data-orders-ajax-page="@Model.TotalPages" |
| | 0 | 34 | | class="btn btn-primary orders-index-ajax-page-link @(Model.TotalPages == Model.PageNumber ? "acti |
| | | 35 | | } |
| | | 36 | | else |
| | | 37 | | { |
| | 0 | 38 | | <a asp-area="Studio2" asp-controller="@paginationController" asp-action="@paginationAction" asp-rout |
| | 0 | 39 | | class="btn btn-primary @(Model.TotalPages == Model.PageNumber ? "active" : "")">@(Model.TotalPage |
| | | 40 | | } |
| | | 41 | | } |
| | 0 | 42 | | else if (Model.PageNumber >= Model.TotalPages - 7) |
| | | 43 | | { |
| | 0 | 44 | | if (useOrdersIndexAjax) |
| | | 45 | | { |
| | | 46 | | <a href="#" data-orders-ajax-page="1" |
| | | 47 | | class="btn btn-primary orders-index-ajax-page-link @(1 == Model.PageNumber ? "active" : "")">1</a |
| | | 48 | | } |
| | | 49 | | else |
| | | 50 | | { |
| | 0 | 51 | | <a asp-area="Studio2" asp-controller="@paginationController" asp-action="@paginationAction" asp-rout |
| | | 52 | | class="btn btn-primary @(1 == Model.PageNumber ? "active" : "")">1</a> |
| | | 53 | | } |
| | | 54 | | |
| | | 55 | | <span>...</span> |
| | 0 | 56 | | @for (int i = Model.TotalPages - 9; i <= Model.TotalPages; i++) |
| | | 57 | | { |
| | 0 | 58 | | if (useOrdersIndexAjax) |
| | | 59 | | { |
| | 0 | 60 | | <a href="#" data-orders-ajax-page="@(i)" |
| | 0 | 61 | | class="btn btn-primary orders-index-ajax-page-link @(i == Model.PageNumber ? "active" : "")"> |
| | | 62 | | } |
| | | 63 | | else |
| | | 64 | | { |
| | 0 | 65 | | <a asp-area="Studio2" asp-controller="@paginationController" asp-action="@paginationAction" asp- |
| | 0 | 66 | | class="btn btn-primary @(i == Model.PageNumber ? "active" : "")">@i</a> |
| | | 67 | | } |
| | | 68 | | } |
| | | 69 | | } |
| | | 70 | | else |
| | | 71 | | { |
| | 0 | 72 | | if (useOrdersIndexAjax) |
| | | 73 | | { |
| | | 74 | | <a href="#" data-orders-ajax-page="1" class="btn btn-primary orders-index-ajax-page-link">1</a> |
| | | 75 | | } |
| | | 76 | | else |
| | | 77 | | { |
| | 0 | 78 | | <a asp-area="Studio2" asp-controller="@paginationController" asp-action="@paginationAction" asp-rout |
| | | 79 | | } |
| | | 80 | | |
| | | 81 | | <span>...</span> |
| | 0 | 82 | | @for (int i = Model.PageNumber - 5; i <= Model.PageNumber + 5; i++) |
| | | 83 | | { |
| | 0 | 84 | | if (useOrdersIndexAjax) |
| | | 85 | | { |
| | 0 | 86 | | <a href="#" data-orders-ajax-page="@(i)" |
| | 0 | 87 | | class="btn btn-primary orders-index-ajax-page-link @(i == Model.PageNumber ? "active" : "")"> |
| | | 88 | | } |
| | | 89 | | else |
| | | 90 | | { |
| | 0 | 91 | | <a asp-area="Studio2" asp-controller="@paginationController" asp-action="@paginationAction" asp- |
| | 0 | 92 | | class="btn btn-primary @(i == Model.PageNumber ? "active" : "")">@i</a> |
| | | 93 | | } |
| | | 94 | | } |
| | | 95 | | |
| | | 96 | | <span>...</span> |
| | 0 | 97 | | if (useOrdersIndexAjax) |
| | | 98 | | { |
| | 0 | 99 | | <a href="#" data-orders-ajax-page="@Model.TotalPages" |
| | 0 | 100 | | class="btn btn-primary orders-index-ajax-page-link @(Model.TotalPages == Model.PageNumber ? "acti |
| | | 101 | | } |
| | | 102 | | else |
| | | 103 | | { |
| | 0 | 104 | | <a asp-area="Studio2" asp-controller="@paginationController" asp-action="@paginationAction" asp-rout |
| | 0 | 105 | | class="btn btn-primary @(Model.TotalPages == Model.PageNumber ? "active" : "")">@(Model.TotalPage |
| | | 106 | | } |
| | | 107 | | } |
| | | 108 | | } |
| | | 109 | | else |
| | | 110 | | { |
| | 0 | 111 | | @for (int i = 1; i <= Model.TotalPages; i++) |
| | | 112 | | { |
| | 0 | 113 | | if (useOrdersIndexAjax) |
| | | 114 | | { |
| | 0 | 115 | | <a href="#" data-orders-ajax-page="@(i)" |
| | 0 | 116 | | class="btn btn-primary orders-index-ajax-page-link @(i == Model.PageNumber ? "active" : "")">@i</ |
| | | 117 | | } |
| | | 118 | | else |
| | | 119 | | { |
| | 0 | 120 | | <a asp-area="Studio2" asp-controller="@paginationController" asp-action="@paginationAction" asp-rout |
| | 0 | 121 | | class="btn btn-primary @(i == Model.PageNumber ? "active" : "")">@i</a> |
| | | 122 | | } |
| | | 123 | | } |
| | | 124 | | |
| | | 125 | | <span>...</span> |
| | | 126 | | } |
| | | 127 | | } |
| | | 128 | | </div> |