209 lines
13 KiB
Plaintext
209 lines
13 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 %}
|
|
<div class="pb-4 mb-4 border-b border-border-light">
|
|
<small class="text-sm mb-1 block">
|
|
<a href="/user/{{ event.username }}" class="text-primary font-action hover:underline">{{ event.username }}</a>
|
|
<span class="text-text-muted opacity-75">{{ event.action }}</span>
|
|
<a href="{{ event.content_url }}" class="text-primary font-action hover:underline">"{{ event.content_title | truncate: 50 }}"</a>
|
|
<span class="text-text-muted text-xs opacity-75 ml-1">{{ event.date | date: "%b %d, %Y %I:%M %p" }}</span>
|
|
</small>
|
|
</div>
|
|
{% endfor %}
|
|
</ul>
|
|
{% else %}
|
|
<!-- Static Examples for Demonstration -->
|
|
<ul class="space-y-4">
|
|
<div class="pb-4 mb-4 border-b border-border-light">
|
|
<small class="text-sm mb-1 block">
|
|
<a href="/user/user123" class="text-primary font-action hover:underline">user123</a>
|
|
<span class="text-text-muted opacity-75">upvoted your post:</span>
|
|
<a href="/single-post/1" 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">
|
|
<a href="/user/anotherUser" class="text-primary font-action hover:underline">anotherUser</a>
|
|
<span class="text-text-muted opacity-75">commented on your post:</span>
|
|
<a href="/single-post/2" 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">
|
|
<a href="/user/helpfulHannah" class="text-primary font-action hover:underline">helpfulHannah</a>
|
|
<span class="text-text-muted opacity-75">created a new post:</span>
|
|
<a href="/single-post/3" 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">
|
|
<small class="text-sm mb-1 block">
|
|
<a href="/user/techGuru" class="text-primary font-action hover:underline">techGuru</a>
|
|
<span class="text-text-muted opacity-75">upvoted your comment on:</span>
|
|
<a href="/single-post/4#comment-5" 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>
|
|
</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>
|