220 lines
14 KiB
Plaintext
220 lines
14 KiB
Plaintext
<div class="flex items-center justify-center overflow-hidden">
|
|
<div class="w-full mx-auto rounded-lg p-6 bg-bg-footer">
|
|
<h2 class="text-xl font-semibold text-center text-primary mb-6">Account Settings</h2>
|
|
|
|
<!-- Email Info Box -->
|
|
<div class="bg-rules-bg p-4 rounded mb-6 text-primary text-sm">
|
|
<p>
|
|
Please provide a valid email address. This ensures we can assist you with password recovery if needed. Rest assured, your email address remains confidential between you and us, invisible to web crawlers and other users.
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Tabs Navigation -->
|
|
<div class="mb-4 border-b border-gray-200">
|
|
<nav class="-mb-px flex space-x-8" aria-label="Tabs">
|
|
<a href="#tab-profile" 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">
|
|
Profile
|
|
</a>
|
|
<a href="#tab-preferences" 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">
|
|
Preferences
|
|
</a>
|
|
<a href="#tab-links" 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">
|
|
Links
|
|
</a>
|
|
<a href="#tab-merits" 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">
|
|
Merits
|
|
</a>
|
|
</nav>
|
|
</div>
|
|
|
|
<!-- Tab Content Panes -->
|
|
<form class="space-y-6">
|
|
<div id="tab-profile" class="block [&:not(:target)]:hidden [&:not(:target):not(:has(~:target))]:block space-y-6">
|
|
<!-- User Header -->
|
|
<div class="mb-6 pb-4 border-b border-gray-200">
|
|
<h1 class="text-base font-bold text-text-title mb-1">{{ page.username }}</h1>
|
|
<p class="text-sm text-text-muted">
|
|
Joined: {{ page.created }} | Merits: {{ page.merits }}
|
|
</p>
|
|
</div>
|
|
|
|
<!-- About -->
|
|
<div class="p-4 rounded-md">
|
|
<label for="about" class="block text-sm font-medium text-primary mb-1">About</label>
|
|
<div class="flex items-start">
|
|
<textarea id="about" name="about" rows="5" class="flex-grow text-primary text-sm px-3 py-2 bg-transparent border-b-2 border-gray-300 focus:outline-none focus:border-primary transition duration-150 ease-in-out placeholder:text-xs">{{ page.about }}</textarea>
|
|
<a href="/formatdoc" tabindex="-1" class="ml-2 mt-1 text-xs text-primary hover:underline flex-shrink-0">help</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Email -->
|
|
<div class="p-4 rounded-md">
|
|
<label for="email" class="block text-sm font-medium text-primary mb-1">Email</label>
|
|
<input type="email" id="email" name="email" value="{{ page.email }}" class="w-full text-primary text-sm px-3 py-2 bg-transparent border-b-2 border-gray-300 focus:outline-none focus:border-primary transition duration-150 ease-in-out placeholder:text-xs">
|
|
<p class="mt-1 text-xs text-text-muted">Only admins see your email. To share publicly, add to the 'about' box.</p>
|
|
</div>
|
|
|
|
<!-- Update Button (Remains outside tab panes) -->
|
|
<div class="pt-4 border-t border-gray-200">
|
|
<button type="submit" class="w-full px-6 py-3 bg-primary text-white text-base 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">Update Profile</button>
|
|
</div>
|
|
</div> <!-- End of tab-profile -->
|
|
|
|
<div id="tab-preferences" class="hidden [&:target]:block space-y-6">
|
|
<!-- Settings Grid -->
|
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
<!-- showdead -->
|
|
<div>
|
|
<label for="showdead" class="block text-sm font-medium text-primary mb-1">Show Dead?</label>
|
|
<select id="showdead" name="showd" class="w-full text-primary text-sm px-3 py-2 bg-transparent border-b-2 border-gray-300 focus:outline-none focus:border-primary transition duration-150 ease-in-out appearance-none">
|
|
<option value="yes" {% if page.showdead == "yes" %}selected{% endif %}>Yes</option>
|
|
<option value="no" {% if page.showdead == "no" %}selected{% endif %}>No</option>
|
|
</select>
|
|
<p class="mt-1 text-xs text-text-muted">Show comments flagged as dead?</p>
|
|
</div>
|
|
<!-- noprocrast -->
|
|
<div>
|
|
<label for="noprocrast" class="block text-sm font-medium text-primary mb-1">No Procrastinate?</label>
|
|
<select id="noprocrast" name="nopro" class="w-full text-primary text-sm px-3 py-2 bg-transparent border-b-2 border-gray-300 focus:outline-none focus:border-primary transition duration-150 ease-in-out appearance-none">
|
|
<option value="yes" {% if page.noprocrast == "yes" %}selected{% endif %}>Yes</option>
|
|
<option value="no" {% if page.noprocrast == "no" %}selected{% endif %}>No</option>
|
|
</select>
|
|
<p class="mt-1 text-xs text-text-muted">Prevent doomscrolling with time limits?</p>
|
|
</div>
|
|
|
|
<!-- Spacer or Subheading for Time Limits -->
|
|
<div class="md:col-span-3 mt-4 pt-4 border-t border-gray-200">
|
|
<h3 class="text-sm font-medium text-primary mb-2">Procrastination Settings</h3>
|
|
</div>
|
|
|
|
<!-- maxvisit -->
|
|
<div>
|
|
<label for="maxvisit" class="block text-sm font-medium text-primary mb-1">Max Visit (mins)</label>
|
|
<input type="number" id="maxvisit" name="maxv" value="{{ page.maxvisit }}" class="w-full text-primary text-sm px-3 py-2 bg-transparent border-b-2 border-gray-300 focus:outline-none focus:border-primary transition duration-150 ease-in-out placeholder:text-xs">
|
|
<p class="mt-1 text-xs text-text-muted">Max time per visit.</p>
|
|
</div>
|
|
<!-- minaway -->
|
|
<div>
|
|
<label for="minaway" class="block text-sm font-medium text-primary mb-1">Min Away (mins)</label>
|
|
<input type="number" id="minaway" name="mina" value="{{ page.minaway }}" class="w-full text-primary text-sm px-3 py-2 bg-transparent border-b-2 border-gray-300 focus:outline-none focus:border-primary transition duration-150 ease-in-out placeholder:text-xs">
|
|
<p class="mt-1 text-xs text-text-muted">Required break time.</p>
|
|
</div>
|
|
<!-- delay -->
|
|
<div>
|
|
<label for="delay" class="block text-sm font-medium text-primary mb-1">Submit Delay (mins)</label>
|
|
<input type="number" id="delay" name="delay" value="{{ page.delay }}" class="w-full text-primary text-sm px-3 py-2 bg-transparent border-b-2 border-gray-300 focus:outline-none focus:border-primary transition duration-150 ease-in-out placeholder:text-xs">
|
|
<p class="mt-1 text-xs text-text-muted">Delay before submitting.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Update Button (Remains outside tab panes) -->
|
|
<div class="pt-4 border-t border-gray-200">
|
|
<button type="submit" class="w-full px-6 py-3 bg-primary text-white text-base 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">Update Profile</button>
|
|
</div>
|
|
</div> <!-- End of tab-preferences -->
|
|
|
|
<div id="tab-links" class="hidden [&:target]:block space-y-4"> <!-- Increased space-y -->
|
|
<!-- Links Section -->
|
|
<div class="font-action">
|
|
<p><a href="{{ page.change_password_uri }}" class="text-primary text-sm hover:underline">Change Password</a></p>
|
|
<p><a href="{{ page.submissions_uri }}" class="text-primary text-sm hover:underline">View Submissions</a></p>
|
|
<p><a href="{{ page.comments_uri }}" class="text-primary text-sm hover:underline">View Comments</a></p>
|
|
<p class="text-sm">
|
|
<a href="{{ page.favorites_uri }}" class="text-primary hover:underline">Favorite Submissions</a> /
|
|
<a href="{{ page.favorites_uri }}&comments=t" class="text-primary hover:underline">Favorite Comments</a>
|
|
<span class="text-text-muted text-xs"> (Publicly Visible)</span>
|
|
</p>
|
|
</div>
|
|
</div> <!-- End of tab-links -->
|
|
|
|
<div id="tab-merits" class="hidden [&:target]:block space-y-4">
|
|
<h3 class="text-lg font-medium text-primary mb-4">Recent Merit Activity</h3>
|
|
{% comment %}
|
|
Placeholder for fetching actual merit events for the user.
|
|
Example structure:
|
|
{% assign user_merit_events = site.merit_events | where: "username", page.username | sort: "date" | reverse | limit: 10 %}
|
|
{% endcomment %}
|
|
|
|
{% assign user_merit_events = "" %} <!-- Placeholder: Remove this line when real data is available -->
|
|
|
|
{% if user_merit_events.size > 0 %}
|
|
<ul class="space-y-4">
|
|
{% for event in user_merit_events %}
|
|
<li class="flex items-start space-x-3 p-3 border border-gray-200 rounded-md bg-white/50">
|
|
<div class="flex-shrink-0 pt-1">
|
|
{% if event.type == 'upvote' %}
|
|
<i class="fas fa-arrow-up text-green-500 fa-fw" title="Upvote"></i>
|
|
{% elsif event.type == 'comment' %}
|
|
<i class="fas fa-comment text-blue-500 fa-fw" title="Comment"></i>
|
|
{% elsif event.type == 'post' %}
|
|
<i class="fas fa-file-alt text-purple-500 fa-fw" title="Post"></i>
|
|
{% else %}
|
|
<i class="fas fa-star text-yellow-500 fa-fw" title="Merit"></i>
|
|
{% endif %}
|
|
</div>
|
|
<div class="flex-grow">
|
|
<p class="text-sm font-medium text-primary">
|
|
<span class="font-bold text-green-600">+{{ event.amount | default: 1 }} Merit</span>
|
|
{% if event.reason %} - {{ event.reason }}{% endif %}
|
|
{% if event.content_title %}
|
|
on <a href="{{ event.content_url }}" class="hover:underline">"{{ event.content_title | truncate: 50 }}"</a>
|
|
{% endif %}
|
|
</p>
|
|
<p class="text-xs text-text-muted">{{ event.date | date: "%b %d, %Y %I:%M %p" }}</p>
|
|
</div>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% else %}
|
|
<!-- Static Examples for Demonstration -->
|
|
<ul class="space-y-4">
|
|
<li class="flex items-start space-x-3 p-3 border border-gray-200 rounded-md bg-white/50">
|
|
<div class="flex-shrink-0 pt-1"><i class="fas fa-arrow-up text-green-500 fa-fw" title="Upvote"></i></div>
|
|
<div class="flex-grow">
|
|
<p class="text-sm font-medium text-primary"><span class="font-bold text-green-600">+1 Merit</span> - Upvote received on post <a href="#" class="hover:underline">"Found the perfect focus playlist"</a></p>
|
|
<p class="text-xs text-text-muted">May 04, 2025 10:30 AM</p>
|
|
</div>
|
|
</li>
|
|
<li class="flex items-start space-x-3 p-3 border border-gray-200 rounded-md bg-white/50">
|
|
<div class="flex-shrink-0 pt-1"><i class="fas fa-comment text-blue-500 fa-fw" title="Comment"></i></div>
|
|
<div class="flex-grow">
|
|
<p class="text-sm font-medium text-primary"><span class="font-bold text-green-600">+2 Merits</span> - New comment on your post <a href="#" class="hover:underline">"My standing desk setup"</a></p>
|
|
<p class="text-xs text-text-muted">May 03, 2025 08:15 PM</p>
|
|
</div>
|
|
</li>
|
|
<li class="flex items-start space-x-3 p-3 border border-gray-200 rounded-md bg-white/50">
|
|
<div class="flex-shrink-0 pt-1"><i class="fas fa-file-alt text-purple-500 fa-fw" title="Post"></i></div>
|
|
<div class="flex-grow">
|
|
<p class="text-sm font-medium text-primary"><span class="font-bold text-green-600">+5 Merits</span> - Created new post <a href="#" class="hover:underline">"The best ergonomic accessories..."</a></p>
|
|
<p class="text-xs text-text-muted">May 02, 2025 11:00 AM</p>
|
|
</div>
|
|
</li>
|
|
<li class="flex items-start space-x-3 p-3 border border-gray-200 rounded-md bg-white/50">
|
|
<div class="flex-shrink-0 pt-1"><i class="fas fa-arrow-up text-green-500 fa-fw" title="Upvote"></i></div>
|
|
<div class="flex-grow">
|
|
<p class="text-sm font-medium text-primary"><span class="font-bold text-green-600">+1 Merit</span> - Upvote received on comment for <a href="#" class="hover:underline">"Office plants that actually survive..."</a></p>
|
|
<p class="text-xs text-text-muted">May 01, 2025 09:45 AM</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<!-- End Static Examples -->
|
|
{% endif %}
|
|
|
|
<!-- Link to Merit History -->
|
|
<div class="mt-4">
|
|
<a href="{{ page.merit_history_uri }}" class="text-primary text-sm hover:underline font-action">View Full Merit History</a>
|
|
</div>
|
|
</div> <!-- End of tab-merits -->
|
|
</form>
|
|
</div>
|
|
</div>
|