Initial Commit

This commit is contained in:
2026-06-11 15:05:08 +08:00
commit ea8e41e688
21 changed files with 2317 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
{% extends "base.html" %}
{% block title %}Login - NexHome{% endblock %}
{% block content %}
<div class="min-h-[80vh] flex items-center justify-center py-12 px-4">
<div class="max-w-md w-full">
<div class="text-center mb-8">
<h1 class="text-3xl font-bold text-primary">Welcome Back</h1>
<p class="text-gray-500 mt-2">Sign in to your NexHome account</p>
</div>
{% if error %}
<div class="bg-red-100 border border-red-200 text-red-800 rounded-lg p-4 mb-6 text-sm">
{{ error }}
</div>
{% endif %}
{% if request.query_params.get('registered') %}
<div class="bg-green-100 border border-green-200 text-green-800 rounded-lg p-4 mb-6 text-sm">
Registration successful! Please sign in.
</div>
{% endif %}
<div class="bg-white rounded-2xl shadow-lg p-8">
<form method="POST" action="/auth/login" class="space-y-5">
<div>
<label for="username" class="block text-sm font-medium text-gray-700 mb-1">Username</label>
<input type="text" id="username" name="username" required
class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-accent focus:border-transparent outline-none transition"
placeholder="Enter your username">
</div>
<div>
<label for="password" class="block text-sm font-medium text-gray-700 mb-1">Password</label>
<input type="password" id="password" name="password" required
class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-accent focus:border-transparent outline-none transition"
placeholder="Enter your password">
</div>
<button type="submit"
class="w-full bg-accent hover:bg-blue-700 text-white font-semibold py-3 rounded-lg transition">
Sign In
</button>
</form>
<div class="mt-6 text-center text-sm text-gray-500">
Don't have an account?
<a href="/auth/register" class="text-accent hover:text-blue-700 font-medium">Create one here</a>
</div>
</div>
</div>
</div>
{% endblock %}