forgejo-tickets/web/templates/pages/login.html

56 lines
3.0 KiB
HTML

{{define "title"}}Login{{end}}
{{define "content"}}
<div class="mx-auto max-w-sm">
<h2 class="text-2xl font-bold text-gray-900 text-center">Sign in to your account</h2>
{{with .Data}}
{{if .Error}}
<div class="mt-4 rounded-md bg-red-50 p-4">
<p class="text-sm text-red-800">{{.Error}}</p>
</div>
{{end}}
{{end}}
<form method="POST" action="/login" class="mt-8 space-y-6">
<input type="hidden" name="gorilla.csrf.Token" value="{{.CSRFToken}}">
<div>
<label for="email" class="block text-sm font-medium text-gray-700">Email</label>
<input type="email" name="email" id="email" required
value="{{with .Data}}{{.Email}}{{end}}"
class="mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500">
</div>
<div>
<label for="password" class="block text-sm font-medium text-gray-700">Password</label>
<input type="password" name="password" id="password" required
class="mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 shadow-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500">
</div>
<button type="submit" class="w-full rounded-md bg-blue-600 px-4 py-2 text-sm font-semibold text-white shadow hover:bg-blue-500">Sign in</button>
</form>
{{with .Data}}
{{if or .GoogleEnabled .MicrosoftEnabled .AppleEnabled}}
<div class="mt-6">
<div class="relative">
<div class="absolute inset-0 flex items-center"><div class="w-full border-t border-gray-300"></div></div>
<div class="relative flex justify-center text-sm"><span class="bg-gray-50 px-2 text-gray-500">Or continue with</span></div>
</div>
<div class="mt-6 flex flex-wrap gap-3 justify-center">
{{if .GoogleEnabled}}<a href="/auth/google/login" class="flex items-center justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50">Google</a>{{end}}
{{if .MicrosoftEnabled}}<a href="/auth/microsoft/login" class="flex items-center justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50">Microsoft</a>{{end}}
{{if .AppleEnabled}}<a href="/auth/apple/login" class="flex items-center justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50">Apple</a>{{end}}
</div>
</div>
{{end}}
{{end}}
<p class="mt-6 text-center text-sm text-gray-500">
Don't have an account? <a href="/register" class="font-medium text-blue-600 hover:text-blue-500">Register</a>
&middot; <a href="/forgot-password" class="font-medium text-blue-600 hover:text-blue-500">Forgot password?</a>
</p>
</div>
{{end}}