- Add design-token stylesheet (wwwroot/css/user-panel.css): CSS variables derived from the existing p8.css palette (brand maroon, success/danger colors, radius, shadow), plus reusable component classes (card, button variants, alert, badge, empty state, pagination, list item, toast, confirm modal). Includes a prefers-color-scheme dark block compatible with the existing toggleColorScheme() mechanism in bk.js. - Add wwwroot/js/user-panel.js: upConfirm() and upToast() helpers as styled, promise-based replacements for window.confirm()/alert(), falling back to the native dialogs if the modal/toast markup isn't present on a page. - Add Areas/User/Pages/Shared/ partials: _Pagination (wraps the List<NameIdUrlImage> pattern already used by every list page), _EmptyState, _Toasts and _ConfirmModal (hosts, included once by the layout). - Wire the new stylesheet/script and the toast/modal hosts into _UserPanelLayout.cshtml. - Refactor Notifications.cshtml as a first demonstration: replaces the hand-rolled pagination loop, manual gray/lightsteelblue row alternation, and confirm()/alert() calls with the new components. No backend/API changes. Rest of the User area is untouched pending Phase 1+ (nav/dashboard, forms, remaining list pages, moderation queues, editors).
30 lines
962 B
Plaintext
30 lines
962 B
Plaintext
@*
|
|
Renders the pagination links used throughout the User area.
|
|
Every list page already builds a List<NameIdUrlImage> called
|
|
PaginationLinks (Name = label, Url = link, or Url == "" for the
|
|
current/disabled page) — pass that model straight in:
|
|
|
|
<partial name="_Pagination" model="Model.PaginationLinks" />
|
|
|
|
Replaces the hand-written @foreach loop that was copy-pasted at the
|
|
top and bottom of every list page.
|
|
*@
|
|
@model System.Collections.Generic.List<GSpotifyProxy.Models.NameIdUrlImage>
|
|
|
|
@if (Model != null && Model.Count > 0)
|
|
{
|
|
<nav class="up-pagination" aria-label="صفحهبندی">
|
|
@foreach (var link in Model)
|
|
{
|
|
if (!string.IsNullOrEmpty(link.Url))
|
|
{
|
|
<a href="@link.Url">@link.Name</a>
|
|
}
|
|
else
|
|
{
|
|
<span class="up-pagination__current" aria-current="page">@link.Name</span>
|
|
}
|
|
}
|
|
</nav>
|
|
}
|