Save workspace changes
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
@extends('layouts.nova')
|
||||
|
||||
@php
|
||||
@php
|
||||
$page_title = $page_title ?? 'Community Activity';
|
||||
$page_meta_description = 'Track comments, replies, reactions, and mentions from across the Skinbase community in one live feed.';
|
||||
$page_canonical = route('community.activity', array_filter([
|
||||
'filter' => ($initialFilter ?? null) && ($initialFilter ?? 'all') !== 'all' ? $initialFilter : null,
|
||||
'user_id' => $initialUserId ?? null,
|
||||
], fn (mixed $value): bool => $value !== null && $value !== ''));
|
||||
$useUnifiedSeo = true;
|
||||
$headerBreadcrumbs = collect([
|
||||
(object) ['name' => $page_title, 'url' => $page_canonical],
|
||||
]);
|
||||
$breadcrumbs = $headerBreadcrumbs;
|
||||
$seo = \App\Support\Seo\SeoDataBuilder::fromArray(
|
||||
app(\App\Support\Seo\SeoFactory::class)->fromViewData(get_defined_vars())
|
||||
)->build();
|
||||
|
||||
$initialFilterLabel = match (($initialFilter ?? 'all')) {
|
||||
'comments' => 'Comments',
|
||||
'replies' => 'Replies',
|
||||
'following' => 'Following',
|
||||
'my' => 'My Activity',
|
||||
default => 'All Activity',
|
||||
};
|
||||
@endphp
|
||||
|
||||
@section('content')
|
||||
<x-nova-page-header
|
||||
section="Community"
|
||||
:title="$page_title ?? 'Community Activity'"
|
||||
icon="fa-wave-square"
|
||||
:breadcrumbs="$headerBreadcrumbs"
|
||||
description="Track comments, replies, reactions, and mentions from across the Skinbase community in one live feed."
|
||||
headerClass="pb-6"
|
||||
>
|
||||
<x-slot name="actions">
|
||||
<div class="flex flex-wrap items-center gap-2 text-xs font-medium">
|
||||
<span id="community-activity-filter-summary" class="inline-flex items-center gap-1.5 rounded-full border border-sky-400/20 bg-sky-500/10 px-3 py-1 text-sky-200">
|
||||
<i class="fa-solid fa-filter"></i>
|
||||
{{ $initialFilterLabel }}
|
||||
</span>
|
||||
@if (!empty($initialUserId))
|
||||
<span id="community-activity-scope-summary" class="inline-flex items-center gap-1.5 rounded-full border border-white/[0.08] bg-white/[0.04] px-3 py-1 text-white/65">
|
||||
<i class="fa-solid fa-user"></i>
|
||||
User #{{ $initialUserId }}
|
||||
</span>
|
||||
@else
|
||||
<span id="community-activity-scope-summary" class="hidden"></span>
|
||||
@endif
|
||||
</div>
|
||||
</x-slot>
|
||||
</x-nova-page-header>
|
||||
|
||||
<script id="community-activity-props" type="application/json">
|
||||
{!! json_encode($props, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_HEX_AMP) !!}
|
||||
</script>
|
||||
|
||||
<div id="community-activity-root" class="min-h-[480px]">
|
||||
<div class="mx-auto max-w-6xl px-6 pt-8 pb-20 md:px-10">
|
||||
<div class="mb-6 rounded-[28px] border border-white/[0.06] bg-white/[0.025] p-5 shadow-[0_18px_45px_rgba(0,0,0,0.22)]">
|
||||
<div class="h-3 w-40 animate-pulse rounded bg-white/[0.08]"></div>
|
||||
<div class="mt-3 h-3 w-2/3 animate-pulse rounded bg-white/[0.06]"></div>
|
||||
<div class="mt-5 flex gap-2">
|
||||
<div class="h-10 w-28 animate-pulse rounded-full bg-white/[0.06]"></div>
|
||||
<div class="h-10 w-24 animate-pulse rounded-full bg-white/[0.05]"></div>
|
||||
<div class="h-10 w-24 animate-pulse rounded-full bg-white/[0.05]"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@vite(['resources/js/Pages/Community/CommunityActivityPage.jsx'])
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,147 @@
|
||||
@extends('layouts.nova')
|
||||
|
||||
@php
|
||||
$page_title = $page_title ?? 'Monthly Top Commentators';
|
||||
$page_meta_description = 'Members who posted the most comments in the last 30 days.';
|
||||
$page_canonical = route('comments.monthly', request()->query());
|
||||
$useUnifiedSeo = true;
|
||||
$headerBreadcrumbs = collect([
|
||||
(object) ['name' => $page_title, 'url' => $page_canonical],
|
||||
]);
|
||||
$breadcrumbs = $headerBreadcrumbs;
|
||||
$seo = \App\Support\Seo\SeoDataBuilder::fromArray(
|
||||
app(\App\Support\Seo\SeoFactory::class)->fromViewData(get_defined_vars())
|
||||
)->build();
|
||||
@endphp
|
||||
|
||||
@section('content')
|
||||
<x-nova-page-header
|
||||
section="Community"
|
||||
:title="$page_title ?? 'Monthly Top Commentators'"
|
||||
icon="fa-ranking-star"
|
||||
:breadcrumbs="$headerBreadcrumbs"
|
||||
description="Members who posted the most comments in the last 30 days."
|
||||
headerClass="pb-6"
|
||||
>
|
||||
<x-slot name="actions">
|
||||
<span class="flex-shrink-0 inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-medium bg-violet-500/10 text-violet-300 ring-1 ring-violet-500/25">
|
||||
<svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"/>
|
||||
</svg>
|
||||
Last 30 days
|
||||
</span>
|
||||
</x-slot>
|
||||
</x-nova-page-header>
|
||||
|
||||
{{-- ── Leaderboard ── --}}
|
||||
<div class="px-6 pt-8 pb-16 md:px-10">
|
||||
@php
|
||||
$offset = ($rows->currentPage() - 1) * $rows->perPage();
|
||||
$isFirstPage = $rows->currentPage() === 1;
|
||||
$showcaseTop = $isFirstPage ? $rows->getCollection()->take(3)->values() : collect();
|
||||
$tableRows = $isFirstPage ? $rows->getCollection()->slice(3)->values() : $rows->getCollection();
|
||||
$rankBase = $isFirstPage ? 3 : 0;
|
||||
@endphp
|
||||
|
||||
@if ($rows->isNotEmpty())
|
||||
@if ($showcaseTop->isNotEmpty())
|
||||
<div class="mb-6 grid gap-4 md:grid-cols-3">
|
||||
@foreach ($showcaseTop as $i => $row)
|
||||
@php
|
||||
$rank = $i + 1;
|
||||
$profileUrl = ($row->user_username ?? null) ? '/@' . $row->user_username : '/profile/' . (int)($row->user_id ?? 0);
|
||||
$avatarUrl = \App\Support\AvatarUrl::forUser((int)($row->user_id ?? 0), null, 64);
|
||||
|
||||
$rankClasses = $rank === 1
|
||||
? 'bg-amber-400/15 text-amber-300 ring-amber-400/30'
|
||||
: ($rank === 2
|
||||
? 'bg-slate-400/15 text-slate-300 ring-slate-400/30'
|
||||
: 'bg-orange-700/20 text-orange-400 ring-orange-600/30');
|
||||
@endphp
|
||||
|
||||
<a href="{{ $profileUrl }}"
|
||||
class="rounded-xl border border-white/[0.08] bg-white/[0.03] p-5 hover:bg-white/[0.05] transition-colors">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<span class="inline-flex items-center justify-center w-8 h-8 rounded-full text-sm font-bold ring-1 {{ $rankClasses }}">
|
||||
{{ $rank }}
|
||||
</span>
|
||||
<span class="text-xs font-semibold uppercase tracking-widest text-violet-300/80">Comments</span>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-3">
|
||||
<img src="{{ $avatarUrl }}" alt="{{ $row->uname ?? 'User' }}"
|
||||
class="w-14 h-14 rounded-full object-cover ring-1 ring-white/[0.12]">
|
||||
<div class="min-w-0">
|
||||
<div class="truncate text-base font-semibold text-white">{{ $row->uname ?? 'Unknown' }}</div>
|
||||
<div class="mt-1 text-lg font-bold text-violet-400">{{ number_format((int)($row->num_comments ?? 0)) }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="rounded-xl border border-white/[0.06] overflow-hidden">
|
||||
|
||||
{{-- Table header --}}
|
||||
<div class="grid grid-cols-[3rem_1fr_auto] items-center gap-4 px-5 py-3 bg-white/[0.03] border-b border-white/[0.06]">
|
||||
<span class="text-xs font-semibold uppercase tracking-widest text-white/30 text-center">#</span>
|
||||
<span class="text-xs font-semibold uppercase tracking-widest text-white/30">Member</span>
|
||||
<span class="text-xs font-semibold uppercase tracking-widest text-white/30 text-right">Comments</span>
|
||||
</div>
|
||||
|
||||
{{-- Rows --}}
|
||||
<div class="divide-y divide-white/[0.04]">
|
||||
@foreach ($tableRows as $i => $row)
|
||||
@php
|
||||
$rank = $offset + $rankBase + $i + 1;
|
||||
$profileUrl = ($row->user_username ?? null) ? '/@' . $row->user_username : '/profile/' . (int)($row->user_id ?? 0);
|
||||
$avatarUrl = \App\Support\AvatarUrl::forUser((int)($row->user_id ?? 0), null, 64);
|
||||
@endphp
|
||||
<div class="grid grid-cols-[3rem_1fr_auto] items-center gap-4 px-5 py-4
|
||||
{{ $rank <= 3 ? 'bg-white/[0.015]' : '' }} hover:bg-white/[0.03] transition-colors">
|
||||
|
||||
{{-- Rank badge --}}
|
||||
<div class="text-center">
|
||||
@if ($rank === 1)
|
||||
<span class="inline-flex items-center justify-center w-7 h-7 rounded-full bg-amber-400/15 text-amber-300 text-xs font-bold ring-1 ring-amber-400/30">1</span>
|
||||
@elseif ($rank === 2)
|
||||
<span class="inline-flex items-center justify-center w-7 h-7 rounded-full bg-slate-400/15 text-slate-300 text-xs font-bold ring-1 ring-slate-400/30">2</span>
|
||||
@elseif ($rank === 3)
|
||||
<span class="inline-flex items-center justify-center w-7 h-7 rounded-full bg-orange-700/20 text-orange-400 text-xs font-bold ring-1 ring-orange-600/30">3</span>
|
||||
@else
|
||||
<span class="text-sm text-white/30 font-medium">{{ $rank }}</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Member info --}}
|
||||
<a href="{{ $profileUrl }}" class="flex items-center gap-3 min-w-0 hover:opacity-90 transition-opacity">
|
||||
<img src="{{ $avatarUrl }}" alt="{{ $row->uname ?? 'User' }}"
|
||||
class="w-9 h-9 rounded-full object-cover flex-shrink-0 ring-1 ring-white/[0.08]">
|
||||
<div class="min-w-0">
|
||||
<div class="truncate text-sm font-semibold text-white/90">{{ $row->uname ?? 'Unknown' }}</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
{{-- Comment count --}}
|
||||
<div class="text-right flex-shrink-0">
|
||||
<span class="text-sm font-semibold text-violet-400">
|
||||
{{ number_format((int)($row->num_comments ?? 0)) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-8 flex justify-center">
|
||||
{{ $rows->withQueryString()->links() }}
|
||||
</div>
|
||||
@else
|
||||
<div class="rounded-xl border border-white/[0.06] bg-white/[0.02] px-8 py-12 text-center">
|
||||
<p class="text-white/40 text-sm">No comment activity in the last 30 days.</p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
Reference in New Issue
Block a user