Files

118 lines
6.7 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<div class="container mx-auto px-4 py-8">
<h1 class="text-2xl font-bold text-text-title mb-6">{{ page.title | default: "Merit History" }}</h1>
<!-- Filter and Sort Controls -->
<div class="mb-6 bg-gray-100 rounded-md">
<div class="flex flex-col sm:flex-row justify-between items-center space-y-4 sm:space-y-0">
<!-- Filter by Type -->
<div class="filter-controls flex flex-col space-y-3 sm:flex-row sm:space-y-0 sm:space-x-2 sm:items-center">
<button data-filter="all" class="merit-filter-btn w-full sm:w-auto flex items-center justify-center space-x-2 p-3 border-2 border-primary bg-primary/10 rounded-md hover:border-primary transition-colors">
<span class="text-sm font-action font-medium text-primary">All</span>
</button>
<button data-filter="upvotes" class="merit-filter-btn w-full sm:w-auto flex items-center justify-center space-x-2 p-3 border-2 border-gray-300 rounded-md hover:border-primary transition-colors">
<i class="fas fa-arrow-up fa-fw text-primary"></i>
<span class="text-sm font-action font-medium text-primary">Upvotes</span>
</button>
<button data-filter="comments" class="merit-filter-btn w-full sm:w-auto flex items-center justify-center space-x-2 p-3 border-2 border-gray-300 rounded-md hover:border-primary transition-colors">
<i class="fas fa-comments fa-fw text-primary"></i>
<span class="text-sm font-action font-medium text-primary">Comments</span>
</button>
<button data-filter="posts" class="merit-filter-btn w-full sm:w-auto flex items-center justify-center space-x-2 p-3 border-2 border-gray-300 rounded-md hover:border-primary transition-colors">
<i class="fas fa-file-alt fa-fw text-primary"></i>
<span class="text-sm font-action font-medium text-primary">Posts</span>
</button>
</div>
<!-- Sort Dropdown -->
<div class="sort-controls flex items-center space-x-2">
<label for="merit-sort-select" class="text-sm font-medium text-gray-700">Sort by:</label>
<select id="merit-sort-select" class="sort-select text-sm font-action bg-white border border-gray-300 rounded-md px-3 py-1.5 focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary cursor-pointer">
<option value="newest" selected>Newest</option>
<option value="oldest">Oldest</option>
<option value="amount_high_low">Merit Amount (High to Low)</option>
<option value="amount_low_high">Merit Amount (Low to High)</option>
</select>
</div>
</div>
</div>
<!-- Merit Category Count -->
<div id="merit-category-count-container" class="mb-4 text-sm text-primary">
{% comment %}
TODO: This count should be dynamically updated by JavaScript
when a filter is selected. For now, it shows a static count
based on the demo data for the "All" category.
{% endcomment %}
<p>
Showing <span id="merit-count" class="font-semibold">4</span> merits for <span id="merit-category-name" class="font-semibold">All</span>.
</p>
</div>
<!-- Merit List -->
<div id="merit-list-container" class="space-y-4">
{% comment %}
TODO: Implement Liquid logic for filtering and sorting actual merit data.
This would involve:
1. Accessing the merit data (e.g., from site.data.merit_events or a collection).
2. Applying filters based on URL parameters or JavaScript-driven selections.
3. Sorting the filtered data.
4. Iterating over the processed data to display merit items.
For now, static examples are shown below.
{% endcomment %}
{% assign static_merit_events_for_demo = true %} <!-- Set to false when dynamic data is ready -->
{% if static_merit_events_for_demo %}
<div class="space-y-4"> <!-- Ensures consistent vertical spacing between merit items -->
<div class="pb-4 mb-4 border-b border-border-light">
<small class="text-sm mb-1 block">
<span class="text-primary font-bold">+1 Merit</span>
<span class="text-text-muted opacity-75">– Upvote received on post:</span>
<a href="#" class="text-primary font-action hover:underline">"Found the perfect focus playlist"</a>
<span class="text-text-muted text-xs opacity-75 ml-1">May 04, 2025 10:30 AM</span>
</small>
</div>
<div class="pb-4 mb-4 border-b border-border-light">
<small class="text-sm mb-1 block">
<span class="text-primary font-bold">+2 Merits</span>
<span class="text-text-muted opacity-75">– New comment on your post:</span>
<a href="#" class="text-primary font-action hover:underline">"My standing desk setup"</a>
<span class="text-text-muted text-xs opacity-75 ml-1">May 03, 2025 08:15 PM</span>
</small>
</div>
<div class="pb-4 mb-4 border-b border-border-light">
<small class="text-sm mb-1 block">
<span class="text-primary font-bold">+5 Merits</span>
<span class="text-text-muted opacity-75">– Created new post:</span>
<a href="#" class="text-primary font-action hover:underline">"The best ergonomic accessories..."</a>
<span class="text-text-muted text-xs opacity-75 ml-1">May 02, 2025 11:00 AM</span>
</small>
</div>
<div class="pb-4 mb-4 border-b border-border-light"> <!-- Removed mb-4 from the last item if it's the very last one, but for consistency keep it -->
<small class="text-sm mb-1 block">
<span class="text-primary font-bold">+1 Merit</span>
<span class="text-text-muted opacity-75">– Upvote received on comment for:</span>
<a href="#" class="text-primary font-action hover:underline">"Office plants that actually survive..."</a>
<span class="text-text-muted text-xs opacity-75 ml-1">May 01, 2025 09:45 AM</span>
</small>
</div>
</div> <!-- Closing the div that replaced ul -->
{% else %}
<div class="text-center text-gray-500 font-action py-10 bg-white rounded-md shadow border border-gray-200">
<p>No merit activity found matching your criteria.</p>
{% comment %} Or: <p>You have no merit activity yet.</p> {% endcomment %}
</div>
{% endif %}
</div>
<!-- Pagination/More Button (Placeholder) -->
{% if static_merit_events_for_demo %}
<div class="pt-6 text-center">
<button type="button" class="px-6 py-3 bg-primary text-white text-sm font-medium rounded-md hover:bg-primary-dark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary transition duration-150 ease-in-out font-monda font-action">
Load More
</button>
</div>
{% endif %}
</div>