Features: - Custom navigation links management in admin settings - Multi-language support for navigation links (Chinese/English) - Control link behavior (open in new window) - Sort order and enable/disable toggle for nav links - User registration system with validation - Admin can enable/disable user registration - Registration form with username, display name, email, password - Link to registration from login page Navigation Links: - Admin interface to add/edit/delete custom nav links - Support for both internal and external URLs - Display links in header navigation bar - Respects language preference User Registration: - Username validation (3-32 characters, alphanumeric + underscore/dash) - Password validation (minimum 6 characters) - Password confirmation matching - Optional display name and email fields - Can be toggled on/off by admin in site settings Templates: - Added navigation links settings page - Added user registration page - Updated login page with registration link - Updated base layout to render custom nav links Documentation: - NAV_LINKS_FEATURE.md - Navigation links feature documentation - REGISTRATION_FEATURE.md - User registration documentation - IMPLEMENTATION_SUMMARY.md - Overall implementation summary Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
54 lines
2.3 KiB
HTML
54 lines
2.3 KiB
HTML
{{define "login"}}
|
|
{{template "header" .}}
|
|
<section class="max-w-md mx-auto px-4 py-20">
|
|
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-8">
|
|
<h2 class="text-2xl font-bold text-gray-900 mb-6 text-center">{{index .Tr "login_title"}}</h2>
|
|
|
|
{{if .Error}}
|
|
<div class="bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg mb-6 text-sm">
|
|
{{.Error}}
|
|
</div>
|
|
{{end}}
|
|
|
|
<form action="/login" method="post" class="space-y-5">
|
|
<div>
|
|
<label for="username" class="block text-sm font-medium text-gray-700 mb-1">{{index .Tr "login_username"}}</label>
|
|
<input
|
|
type="text"
|
|
id="username"
|
|
name="username"
|
|
required
|
|
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-colors"
|
|
placeholder="{{index .Tr "login_ph_user"}}"
|
|
>
|
|
</div>
|
|
<div>
|
|
<label for="password" class="block text-sm font-medium text-gray-700 mb-1">{{index .Tr "login_password"}}</label>
|
|
<input
|
|
type="password"
|
|
id="password"
|
|
name="password"
|
|
required
|
|
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none transition-colors"
|
|
placeholder="{{index .Tr "login_ph_pass"}}"
|
|
>
|
|
</div>
|
|
<button
|
|
type="submit"
|
|
class="w-full bg-blue-600 text-white py-2 px-4 rounded-lg font-medium hover:bg-blue-700 transition-colors cursor-pointer"
|
|
>
|
|
{{index .Tr "login_submit"}}
|
|
</button>
|
|
</form>
|
|
|
|
{{if .AllowRegistration}}
|
|
<div class="mt-4 text-center">
|
|
<span class="text-sm text-gray-600">{{index .Tr "login_no_account"}}</span>
|
|
<a href="/register" class="text-sm text-blue-600 hover:text-blue-700 font-medium ml-1">{{index .Tr "login_register_link"}}</a>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
</section>
|
|
{{template "footer" .}}
|
|
{{end}}
|