| | | 1 | | @using OzonOrdersWeb.ViewModels.UserViewModels |
| | | 2 | | @model SetUserAccessViewModel |
| | | 3 | | |
| | | 4 | | @{ |
| | 0 | 5 | | ViewData["Title"] = "Назначить профиль доступа"; |
| | 0 | 6 | | Layout = "_AdminLayout"; |
| | 0 | 7 | | ViewData["Breadcrumb"] = new List<(string, string?)> |
| | 0 | 8 | | { |
| | 0 | 9 | | ("Администрирование", null), |
| | 0 | 10 | | ("Пользователи", Url.Action("UserList", "User", new { area = "Studio2" })), |
| | 0 | 11 | | ("Профиль доступа", null) |
| | 0 | 12 | | }; |
| | | 13 | | } |
| | | 14 | | |
| | | 15 | | <div class="row justify-content-center"> |
| | | 16 | | <div class="col-md-7"> |
| | | 17 | | <div class="card"> |
| | | 18 | | <div class="card-header"> |
| | | 19 | | <h3 class="card-title"> |
| | | 20 | | <i class="ti ti-shield-check me-2"></i>Выберите профиль доступа |
| | | 21 | | </h3> |
| | | 22 | | </div> |
| | | 23 | | <div class="card-body"> |
| | | 24 | | <form asp-action="SetAccessProfile" method="post"> |
| | | 25 | | <input type="hidden" asp-for="UserId"/> |
| | | 26 | | |
| | 0 | 27 | | @if (Model.AccessProfiles?.Any() == true) |
| | | 28 | | { |
| | | 29 | | <div class="list-group mb-4"> |
| | 0 | 30 | | @foreach (var profile in Model.AccessProfiles) |
| | | 31 | | { |
| | | 32 | | <label class="list-group-item list-group-item-action d-flex gap-3 py-3 cursor-pointer"> |
| | | 33 | | <input class="form-check-input flex-shrink-0 mt-1" type="radio" |
| | | 34 | | asp-for="SelectedAccessProfileId" |
| | 0 | 35 | | value="@profile.Id"/> |
| | | 36 | | <span class="d-flex gap-2 w-100 justify-content-between"> |
| | | 37 | | <span> |
| | 0 | 38 | | <strong class="d-block">@profile.Name</strong> |
| | 0 | 39 | | @if (profile.AvailableOrderColumns?.Any() == true) |
| | | 40 | | { |
| | | 41 | | <span class="text-muted small"> |
| | 0 | 42 | | Столбцы: @string.Join(", ", profile.AvailableOrderColumns.Take(5)) |
| | 0 | 43 | | @if (profile.AvailableOrderColumns.Count > 5) { <text>...</text> } |
| | | 44 | | </span> |
| | | 45 | | } |
| | | 46 | | else |
| | | 47 | | { |
| | | 48 | | <span class="text-muted small">Все столбцы доступны</span> |
| | | 49 | | } |
| | | 50 | | </span> |
| | | 51 | | <span class="badge bg-blue-lt align-self-center"> |
| | 0 | 52 | | @profile.DataScopeSets.Count наб. |
| | | 53 | | </span> |
| | | 54 | | </span> |
| | | 55 | | </label> |
| | 0 | 56 | | } |
| | | 57 | | </div> |
| | | 58 | | } |
| | | 59 | | else |
| | | 60 | | { |
| | | 61 | | <div class="alert alert-warning"> |
| | | 62 | | <i class="ti ti-info-circle me-2"></i> |
| | | 63 | | Нет профилей доступа. |
| | | 64 | | <a asp-area="Studio2" asp-controller="AccessProfiles" asp-action="Index" class="alert-link"> |
| | | 65 | | Создать профиль |
| | | 66 | | </a> |
| | | 67 | | </div> |
| | | 68 | | } |
| | | 69 | | |
| | | 70 | | <div class="d-flex gap-2"> |
| | | 71 | | <button type="submit" class="btn btn-primary"> |
| | | 72 | | <i class="ti ti-check me-1"></i>Сохранить |
| | | 73 | | </button> |
| | | 74 | | <a asp-action="UserList" class="btn btn-outline-secondary">Отмена</a> |
| | | 75 | | </div> |
| | | 76 | | </form> |
| | | 77 | | </div> |
| | | 78 | | </div> |
| | | 79 | | </div> |
| | | 80 | | </div> |