123 lines
7.1 KiB
Plaintext
123 lines
7.1 KiB
Plaintext
<!-- Quick Tips Box -->
|
|
<div id="quick-tips-box" class="relative p-4 rounded mb-4 border border-gray-300 text-gray-700">
|
|
<button
|
|
type="button"
|
|
aria-label="Close quick tips"
|
|
onclick="document.getElementById('quick-tips-box').style.display='none'"
|
|
class="absolute top-2 right-3 text-gray-500 hover:text-gray-700 focus:outline-none focus:ring-1 focus:ring-gray-500 rounded-md p-1">
|
|
<i class="fas fa-times"></i>
|
|
</button>
|
|
<p class="mr-8"> <!-- Ensure text doesn't overlap with the close button -->
|
|
<strong>Quick Tips:</strong> Keep it brief, keep it real. Share your desk moments, finds, or frustrations. Upvote what resonates!
|
|
</p>
|
|
</div>
|
|
|
|
{% assign filter_type = page.filter_type | default: 'all' %}
|
|
{% assign sort_by = page.sort_by | default: 'new' %}
|
|
|
|
<!-- Filter and Sort Controls -->
|
|
<div class="mb-6 bg-gray-100 rounded-md">
|
|
<div class="flex flex-row flex-wrap items-center justify-between gap-2">
|
|
<!-- Filter by Type -->
|
|
<div class="filter-controls flex items-center flex-wrap gap-2">
|
|
<a href="/" class="filter-btn flex items-center justify-center p-2 border-2 {% if filter_type == 'all' %}border-primary bg-primary/10{% else %}border-gray-300{% endif %} rounded-md hover:border-primary transition-colors">
|
|
<i class="fas fa-list fa-fw text-primary sm:mr-2"></i>
|
|
<span class="text-sm font-action font-medium text-primary hidden sm:inline">All</span>
|
|
</a>
|
|
<a href="/win/" class="filter-btn flex items-center justify-center p-2 border-2 {% if filter_type == 'win' %}border-primary bg-primary/10{% else %}border-gray-300{% endif %} rounded-md hover:border-primary transition-colors">
|
|
<img src="/assets/images/icon_win.png" alt="Win" class="w-5 h-5 object-contain inline-block sm:mr-2">
|
|
<span class="text-sm font-action font-medium text-primary hidden sm:inline">Wins</span>
|
|
</a>
|
|
<a href="/frustration/" class="filter-btn flex items-center justify-center p-2 border-2 {% if filter_type == 'frustration' %}border-primary bg-primary/10{% else %}border-gray-300{% endif %} rounded-md hover:border-primary transition-colors">
|
|
<img src="/assets/images/icon_frustrated.png" alt="Frustration" class="w-5 h-5 object-contain inline-block sm:mr-2">
|
|
<span class="text-sm font-action font-medium text-primary hidden sm:inline">Frustrations</span>
|
|
</a>
|
|
<a href="/weird/" class="filter-btn flex items-center justify-center p-2 border-2 {% if filter_type == 'weird' %}border-primary bg-primary/10{% else %}border-gray-300{% endif %} rounded-md hover:border-primary transition-colors">
|
|
<img src="/assets/images/icon_weird.png" alt="Weird" class="w-5 h-5 object-contain inline-block sm:mr-2">
|
|
<span class="text-sm font-action font-medium text-primary hidden sm:inline">Weird</span>
|
|
</a>
|
|
</div>
|
|
|
|
<!-- Sort Dropdown -->
|
|
<div class="sort-controls flex items-center space-x-1 sm:space-x-2">
|
|
<label for="sort-select" class="text-sm font-medium text-gray-700 hidden sm:inline-block">Sort by:</label>
|
|
<select id="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="new" selected>Newest</option>
|
|
<option value="nearby">Nearby</option>
|
|
<option value="upvotes">Most Upvotes</option>
|
|
<option value="comments">Most Comments</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="result-count-container" class="mb-4 text-sm text-primary">
|
|
<p>
|
|
Showing <span id="results-count" class="font-semibold">20</span> results for <span class="font-semibold">"query"</span>.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<!-- Post List -->
|
|
<div id="post-list-container" class="post-list space-y-4">
|
|
{% assign posts = site.posts %}
|
|
|
|
{% if filter_type != 'all' %}
|
|
{% assign posts = posts | where: 'type', filter_type %}
|
|
{% endif %}
|
|
|
|
{% assign posts = posts | sort: 'date' | reverse %}
|
|
|
|
{% if posts == empty %}
|
|
<div class="text-center text-gray-500 font-action py-10">
|
|
<p>No results found for this filter.</p>
|
|
</div>
|
|
{% else %}
|
|
{% for post in posts %}
|
|
<div class="post-item mb-4">
|
|
<article class="flex flex-col md:flex-row items-start">
|
|
<div class="flex-1 text-left">
|
|
<!-- Post Title -->
|
|
<div class="flex items-center space-x-2 mb-0.5">
|
|
<p class="mt-0 mb-0">
|
|
<strong>
|
|
<a href="{{ post.url }}" class="text-text-title font-bold text-md md:text-sm hover:underline">
|
|
{{ post.title }}
|
|
</a>
|
|
</strong>
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Post Metadata -->
|
|
<div class="mt-2 mb-1 text-sm flex flex-col md:flex-row items-start md:items-center md:space-x-2">
|
|
<div class="flex items-start space-x-2 mb-2 md:mb-0">
|
|
<span class="bg-gray-200 text-gray-700 text-xs font-action px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-link-hover">
|
|
<i class="fa-solid fa-arrow-up mr-1"></i> {{ post.upvotes }}
|
|
</span>
|
|
<span class="bg-gray-200 text-gray-700 text-xs font-action px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-link-hover">
|
|
<a href="/reply/"><i class="fas fa-reply mr-1"></i> REPLY</a>
|
|
</span>
|
|
<span class="bg-gray-200 text-gray-700 text-xs font-action px-4 py-2 rounded-full flex items-center cursor-pointer hover:bg-link-hover">
|
|
<i class="fas fa-comment mr-1"></i> {{ post.comments_count }}
|
|
</span>
|
|
</div>
|
|
<small class="text-sm font-action">
|
|
<a href="/user/" class="text-sm hover:underline">{{ post.author }}</a>
|
|
<span class="text-text-muted text-sm opacity-75">{{ post.date | date: "%d %b %Y" }}</span>
|
|
</small>
|
|
</div>
|
|
</div>
|
|
</article>
|
|
<hr class="border-border-light my-4">
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- More Button -->
|
|
{% if posts != empty %}
|
|
<div class="pt-2">
|
|
<button type="submit" class="w-full md:w-auto 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">More</button>
|
|
</div>
|
|
{% endif %}
|