Files

115 lines
7.4 KiB
Plaintext

<div class="max-w-screen-lg mx-auto px-4 py-8">
<h1 class="text-3xl font-bold text-text-title mb-6 pb-4 border-b border-gray-200">Leaderboard</h1>
<!-- Tabs Navigation -->
<div class="mb-4 border-b border-gray-200">
<nav class="flex flex-wrap space-x-4 sm:space-x-8" aria-label="Tabs">
<a href="#tab-merits" class="group whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm
border-primary text-primary [&:not(:target):not(:has(~:target))]:border-primary [&:not(:target):not(:has(~:target))]:text-primary
[&:target]:border-primary [&:target]:text-primary
[&:not(:target)]:border-transparent [&:not(:target)]:text-gray-500 [&:not(:target)]:hover:text-gray-700 [&:not(:target)]:hover:border-gray-300">
Merits
</a>
<a href="#tab-new-users" class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm
[&:target]:border-primary [&:target]:text-primary
[&:not(:target)]:border-transparent [&:not(:target)]:text-gray-500 [&:not(:target)]:hover:text-gray-700 [&:not(:target)]:hover:border-gray-300">
New Users
</a>
<a href="#tab-most-posts" class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm
[&:target]:border-primary [&:target]:text-primary
[&:not(:target)]:border-transparent [&:not(:target)]:text-gray-500 [&:not(:target)]:hover:text-gray-700 [&:not(:target)]:hover:border-gray-300">
Most Posts
</a>
<a href="#tab-most-comments" class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm
[&:target]:border-primary [&:target]:text-primary
[&:not(:target)]:border-transparent [&:not(:target)]:text-gray-500 [&:not(:target)]:hover:text-gray-700 [&:not(:target)]:hover:border-gray-300">
Most Comments
</a>
<a href="#tab-most-votes" class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm
[&:target]:border-primary [&:target]:text-primary
[&:not(:target)]:border-transparent [&:not(:target)]:text-gray-500 [&:not(:target)]:hover:text-gray-700 [&:not(:target)]:hover:border-gray-300">
Most Votes
</a>
</nav>
</div>
<!-- Sub-Tabs Navigation -->
<div class="mb-4 border-b border-gray-200">
<nav class="flex flex-wrap space-x-4 sm:space-x-8" aria-label="Sub-Tabs">
<a href="#sub-tab-week" class="group whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm
border-primary text-primary [&:not(:target):not(:has(~:target))]:border-primary [&:not(:target):not(:has(~:target))]:text-primary
[&:target]:border-primary [&:target]:text-primary
[&:not(:target)]:border-transparent [&:not(:target)]:text-gray-500 [&:not(:target)]:hover:text-gray-700 [&:not(:target)]:hover:border-gray-300">
Week
</a>
<a href="#sub-tab-month" class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm
[&:target]:border-primary [&:target]:text-primary
[&:not(:target)]:border-transparent [&:not(:target)]:text-gray-500 [&:not(:target)]:hover:text-gray-700 [&:not(:target)]:hover:border-gray-300">
Month
</a>
<a href="#sub-tab-quarter" class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm
[&:target]:border-primary [&:target]:text-primary
[&:not(:target)]:border-transparent [&:not(:target)]:text-gray-500 [&:not(:target)]:hover:text-gray-700 [&:not(:target)]:hover:border-gray-300">
Quarter
</a>
<a href="#sub-tab-year" class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm
[&:target]:border-primary [&:target]:text-primary
[&:not(:target)]:border-transparent [&:not(:target)]:text-gray-500 [&:not(:target)]:hover:text-gray-700 [&:not(:target)]:hover:border-gray-300">
Year
</a>
<a href="#sub-tab-all-time" class="whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm
[&:target]:border-primary [&:target]:text-primary
[&:not(:target)]:border-transparent [&:not(:target)]:text-gray-500 [&:not(:target)]:hover:text-gray-700 [&:not(:target)]:hover:border-gray-300">
All-time
</a>
</nav>
</div>
<!-- Tab Content Panes -->
<div class="space-y-6">
<div id="tab-merits" class="block [&:not(:target)]:hidden [&:not(:target):not(:has(~:target))]:block space-y-6">
<div id="sub-tab-week" class="block [&:not(:target)]:hidden [&:not(:target):not(:has(~:target))]:block space-y-6">
<!-- Users Grid for Merits - Week -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
{% assign users = site.data.users %}
{% assign users_per_page = 10 %}
{% assign current_page = page.current_page | default: 1 %}
{% assign total_pages = (users.size / users_per_page) | ceil %}
{% assign start_index = (current_page - 1) * users_per_page %}
{% assign end_index = start_index + users_per_page - 1 %}
{% assign paginated_users = users | slice: start_index, users_per_page %}
{% for user in paginated_users %}
<div class="font-action filter-btn w-full sm:w-auto flex space-x-2 p-3 border-2 border-gray-300 rounded-md hover:border-primary transition-colors cursor-pointer">
<div class="flex items-center space-x-4">
<div>
<h3 class="text-sm font-bold text-text-title hover:underline"><a href="/user/">{{ user.username }}</a></h3>
<p class="text-sm text-text-muted">Merits: {{ user.merits }}</p>
<p class="text-sm text-text-muted">Joined: {{ user.join_date }}</p>
<p class="text-sm text-text-muted">Posts: {{ user.posts_count }}</p>
<p class="text-sm text-text-muted">Comments: {{ user.comments_count }}</p>
</div>
</div>
</div>
{% endfor %}
</div>
<!-- Pagination Controls -->
<div class="flex justify-center font-action mt-4">
{% if current_page > 1 %}
<a href="?page={{ current_page | minus: 1 }}" class="px-4 py-2 mx-1 bg-transparent border-2 border-primary text-gray-700 rounded-md">Previous</a>
{% endif %}
{% for i in (1..total_pages) %}
<a href="?page={{ i }}" class="px-4 py-2 mx-1 {% if i == current_page %}bg-primary text-white{% else %}bg-transparent border-2 border-primary text-gray-700{% endif %} rounded-md">{{ i }}</a>
{% endfor %}
{% if current_page < total_pages %}
<a href="?page={{ current_page | plus: 1 }}" class="px-4 py-2 mx-1 bg-transparent border-2 border-primary text-gray-700 rounded-md">Next</a>
{% endif %}
</div>
</div>
</div>
</div>
</div>