feat(admin): strip HTML in video list + First/Last pagination

- Admin video list: description was stored as sanitized rich HTML, so
  the admin's "{{ Str::limit(description, 55) }}" row printed literal
  <p>…</p> tags in the preview. Pre-strip the HTML, collapse
  whitespace, and surface the full stripped text in a title=""
  tooltip. The visible title column now also carries title="" so the
  admin can hover an ellipsized name to read it in full.
- Shared pagination partial (used by admin videos + users + feed
  pagers) now ships First + Last buttons. The icons use the double-
  chevron variants and the aria-label makes the destination explicit.
  Buttons disable cleanly on page 1 and the last page.
- Audit-logs pager has the same four buttons: First, Prev, N…N, Next,
  Last. Each disabled state carries a title tooltip so the admin
  knows what each stub does without hovering through trial and error.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This commit is contained in:
ghassanandClaude Opus 4.7 committed 2026-10-21 12:01:04 +03:00
1 parent b7f3f6989b
commit 05ccb45fe4
3 files changed
+68 -17

No files matched your search

+21 -5
View File
@@ -351,24 +351,40 @@
Showing {{ $logs->firstItem() }}–{{ $logs->lastItem() }} of {{ $logs->total() }} events
</div>
<div class="al-page-links">
{{-- First --}}
@if($logs->onFirstPage())
<span class="disabled"><i class="bi bi-chevron-left"></i></span>
<span class="disabled" title="First page"><i class="bi bi-chevron-double-left" aria-hidden="true"></i></span>
@else
<a href="{{ $logs->previousPageUrl() }}"><i class="bi bi-chevron-left"></i></a>
<a href="{{ $logs->url(1) }}" aria-label="First page" title="First page"><i class="bi bi-chevron-double-left" aria-hidden="true"></i></a>
@endif
{{-- Prev --}}
@if($logs->onFirstPage())
<span class="disabled" title="Previous page"><i class="bi bi-chevron-left" aria-hidden="true"></i></span>
@else
<a href="{{ $logs->previousPageUrl() }}" aria-label="Previous page" title="Previous page"><i class="bi bi-chevron-left" aria-hidden="true"></i></a>
@endif
@foreach($logs->getUrlRange(max(1, $logs->currentPage()-2), min($logs->lastPage(), $logs->currentPage()+2)) as $page => $url)
@if($page == $logs->currentPage())
<span class="active">{{ $page }}</span>
<span class="active" aria-current="page">{{ $page }}</span>
@else
<a href="{{ $url }}">{{ $page }}</a>
@endif
@endforeach
{{-- Next --}}
@if($logs->hasMorePages())
<a href="{{ $logs->nextPageUrl() }}"><i class="bi bi-chevron-right"></i></a>
<a href="{{ $logs->nextPageUrl() }}" aria-label="Next page" title="Next page"><i class="bi bi-chevron-right" aria-hidden="true"></i></a>
@else
<span class="disabled"><i class="bi bi-chevron-right"></i></span>
<span class="disabled" title="Next page"><i class="bi bi-chevron-right" aria-hidden="true"></i></span>
@endif
{{-- Last --}}
@if($logs->currentPage() < $logs->lastPage())
<a href="{{ $logs->url($logs->lastPage()) }}" aria-label="Last page" title="Last page ({{ $logs->lastPage() }})"><i class="bi bi-chevron-double-right" aria-hidden="true"></i></a>
@else
<span class="disabled" title="Last page"><i class="bi bi-chevron-double-right" aria-hidden="true"></i></span>
@endif
</div>
</div>
+16 -3
View File
@@ -125,12 +125,25 @@ $adminNeedsOtp = auth()->user()->two_factor_enabled &&
</div>
@endif
<div style="min-width:0;">
<div style="font-weight:500;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px;">
{{-- Full title in the title attribute so the
admin can hover and read the whole thing
when the visible row ellipsizes. --}}
<div style="font-weight:500;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px;"
title="{{ $video->title }}">
{{ $video->title }}
</div>
@if($video->description)
<div style="font-size:11px;color:var(--text-2);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px;">
{{ Str::limit($video->description, 55) }}
@php
// Descriptions are stored as sanitized rich HTML
// (see HtmlSanitizer). Blade's {{ }} would show
// the escaped tags verbatim in the admin table,
// so strip them to a plain-text preview — and
// put the full stripped text in the tooltip too.
$descPlain = trim(preg_replace('/\s+/', ' ', strip_tags((string) $video->description)));
@endphp
<div style="font-size:11px;color:var(--text-2);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px;"
title="{{ $descPlain }}">
{{ Str::limit($descPlain, 55) }}
</div>
@endif
</div>
+31 -9
View File
@@ -37,14 +37,25 @@ a.pag-item:hover {
@endonce
<nav class="pag-nav" aria-label="Pagination">
{{-- Prev --}}
{{-- First --}}
@if ($paginator->onFirstPage())
<span class="pag-item disabled" aria-disabled="true">
<i class="bi bi-chevron-left" style="font-size:11px;"></i>
<span class="pag-item disabled" aria-disabled="true" title="First page">
<i class="bi bi-chevron-double-left" style="font-size:11px;" aria-hidden="true"></i>
</span>
@else
<a class="pag-item" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="Previous">
<i class="bi bi-chevron-left" style="font-size:11px;"></i>
<a class="pag-item" href="{{ $paginator->url(1) }}" aria-label="First page" title="First page">
<i class="bi bi-chevron-double-left" style="font-size:11px;" aria-hidden="true"></i>
</a>
@endif
{{-- Prev --}}
@if ($paginator->onFirstPage())
<span class="pag-item disabled" aria-disabled="true" title="Previous page">
<i class="bi bi-chevron-left" style="font-size:11px;" aria-hidden="true"></i>
</span>
@else
<a class="pag-item" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="Previous page" title="Previous page">
<i class="bi bi-chevron-left" style="font-size:11px;" aria-hidden="true"></i>
</a>
@endif
@@ -66,12 +77,23 @@ a.pag-item:hover {
{{-- Next --}}
@if ($paginator->hasMorePages())
<a class="pag-item" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="Next">
<i class="bi bi-chevron-right" style="font-size:11px;"></i>
<a class="pag-item" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="Next page" title="Next page">
<i class="bi bi-chevron-right" style="font-size:11px;" aria-hidden="true"></i>
</a>
@else
<span class="pag-item disabled" aria-disabled="true">
<i class="bi bi-chevron-right" style="font-size:11px;"></i>
<span class="pag-item disabled" aria-disabled="true" title="Next page">
<i class="bi bi-chevron-right" style="font-size:11px;" aria-hidden="true"></i>
</span>
@endif
{{-- Last --}}
@if ($paginator->hasMorePages() && $paginator->lastPage() > $paginator->currentPage())
<a class="pag-item" href="{{ $paginator->url($paginator->lastPage()) }}" aria-label="Last page" title="Last page ({{ $paginator->lastPage() }})">
<i class="bi bi-chevron-double-right" style="font-size:11px;" aria-hidden="true"></i>
</a>
@else
<span class="pag-item disabled" aria-disabled="true" title="Last page">
<i class="bi bi-chevron-double-right" style="font-size:11px;" aria-hidden="true"></i>
</span>
@endif