refactor: Modernize account_settings.liquid with Tailwind CSS layout
This commit is contained in:
1 parent
89a6590420
commit
db9cd51de9
1 file changed
+90
-106
@@ -1,114 +1,98 @@
|
||||
<form class="space-y-4">
|
||||
<div class="w-full overflow-x-auto">
|
||||
<table class="w-full" border="0" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<table class="w-full" cellpadding="5">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="bg-rules-bg p-4 rounded mb-4 text-primary text-sm">
|
||||
<div class="flex items-center justify-center overflow-hidden">
|
||||
<div class="w-full max-w-lg 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>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table class="w-full min-w-[300px] table-auto" border="0">
|
||||
<tbody>
|
||||
<tr class="athing">
|
||||
<td class="py-2 align-top w-24 sm:w-32 text-primary text-sm font-medium">user:</td>
|
||||
<td timestamp="1745816813"><a href="user?id={{ page.username }}" class="hnuser">
|
||||
<font class="text-primary text-sm">{{ page.username }}</font>
|
||||
</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-2 align-top w-24 sm:w-32 text-primary text-sm font-medium">created:</td>
|
||||
<td><a href="#" class="text-primary text-sm">{{ page.created }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-2 align-top w-24 sm:w-32 text-primary text-sm font-medium">merit:</td>
|
||||
<td class="text-primary text-sm">{{ page.merit }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-2 align-top w-24 sm:w-32 text-primary text-sm font-medium">about:</td>
|
||||
<td style="overflow:hidden">
|
||||
<div class="flex items-center">
|
||||
<textarea name="about" rows="5" class="w-full max-w-full sm:w-[350px] md:w-[450px] text-primary text-sm px-3 py-1 border border-gray-300 rounded">{{ page.about }}</textarea>
|
||||
<a href="formatdoc" tabindex="-1">
|
||||
<font size="-2" class="ml-2 text-xs text-primary hover:underline">help</font>
|
||||
</a>
|
||||
<form class="space-y-6">
|
||||
<!-- Read-only Info -->
|
||||
<div class="grid grid-cols-3 gap-4 text-sm">
|
||||
<div>
|
||||
<span class="font-medium text-primary">User:</span>
|
||||
<span class="text-primary ml-2">{{ page.username }}</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-2"></td>
|
||||
<td>
|
||||
<font size="2" class="text-primary text-sm">Only admins see your email below. To share publicly, add to the 'about' box.</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-2 align-top w-24 sm:w-32 text-primary text-sm font-medium">email:</td>
|
||||
<td><input type="text" name="email" value="{{ page.email }}" class="w-full max-w-full sm:w-[350px] md:w-[450px] text-primary text-sm px-3 py-1 border border-gray-300 rounded"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-2 align-top w-24 sm:w-32 text-primary text-sm font-medium">showdead:</td>
|
||||
<td><select name="showd" class="text-primary text-sm px-3 py-1 border border-gray-300 rounded">
|
||||
<option {% if page.showdead == "yes" %}selected="t"{% endif %}>yes</option>
|
||||
<option {% if page.showdead == "no" %}selected="t"{% endif %}>no</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-2 align-top w-24 sm:w-32 text-primary text-sm font-medium">noprocrast:</td>
|
||||
<td><select name="nopro" class="text-primary text-sm px-3 py-1 border border-gray-300 rounded">
|
||||
<option {% if page.noprocrast == "yes" %}selected="t"{% endif %}>yes</option>
|
||||
<option {% if page.noprocrast == "no" %}selected="t"{% endif %}>no</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-2 align-top w-24 sm:w-32 text-primary text-sm font-medium">maxvisit:</td>
|
||||
<td><input type="number" name="maxv" value="{{ page.maxvisit }}" class="w-20 text-primary text-sm px-3 py-1 border border-gray-300 rounded"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-2 align-top w-24 sm:w-32 text-primary text-sm font-medium">minaway:</td>
|
||||
<td><input type="number" name="mina" value="{{ page.minaway }}" class="w-20 text-primary text-sm px-3 py-1 border border-gray-300 rounded"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-2 align-top w-24 sm:w-32 text-primary text-sm font-medium">delay:</td>
|
||||
<td><input type="number" name="delay" value="{{ page.delay }}" class="w-20 text-primary text-sm px-3 py-1 border border-gray-300 rounded"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-2 w-24 sm:w-32"></td>
|
||||
<td><a href="{{ page.change_password_uri }}" class="text-primary text-sm hover:underline">change password</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-2 w-24 sm:w-32"></td>
|
||||
<td><a href="{{ page.submissions_uri }}" class="text-primary text-sm hover:underline">submissions</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-2 w-24 sm:w-32"></td>
|
||||
<td><a href="{{ page.comments_uri }}" class="text-primary text-sm hover:underline">comments</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="py-2 w-24 sm:w-32"></td>
|
||||
<td 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">comments</a>
|
||||
<i class="text-sm"> (publicly visible)</i>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="mt-4">
|
||||
<button type="submit" class="px-2 py-1 bg-primary text-white rounded hover:bg-primary-dark">update</button>
|
||||
<div>
|
||||
<span class="font-medium text-primary">Created:</span>
|
||||
<span class="text-primary ml-2">{{ page.created }}</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
<span class="font-medium text-primary">Merit:</span>
|
||||
<span class="text-primary ml-2">{{ page.merit }}</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- About -->
|
||||
<div>
|
||||
<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 border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary transition duration-150 ease-in-out">{{ 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>
|
||||
<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 border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary transition duration-150 ease-in-out">
|
||||
<p class="mt-1 text-xs text-text-muted">Only admins see your email. To share publicly, add to the 'about' box.</p>
|
||||
</div>
|
||||
|
||||
<!-- 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-white border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary transition duration-150 ease-in-out">
|
||||
<option value="yes" {% if page.showdead == "yes" %}selected{% endif %}>Yes</option>
|
||||
<option value="no" {% if page.showdead == "no" %}selected{% endif %}>No</option>
|
||||
</select>
|
||||
</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-white border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary transition duration-150 ease-in-out">
|
||||
<option value="yes" {% if page.noprocrast == "yes" %}selected{% endif %}>Yes</option>
|
||||
<option value="no" {% if page.noprocrast == "no" %}selected{% endif %}>No</option>
|
||||
</select>
|
||||
</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 border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary transition duration-150 ease-in-out">
|
||||
</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 border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary transition duration-150 ease-in-out">
|
||||
</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 border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary transition duration-150 ease-in-out">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Links Section -->
|
||||
<div class="pt-4 border-t border-gray-200 space-y-2">
|
||||
<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>
|
||||
|
||||
<!-- Update Button -->
|
||||
<div class="pt-2">
|
||||
<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>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user