2023-03-14 15:22:52 +00:00
|
|
|
{{ template "header" .}}
|
|
|
|
<div class="py-10">
|
|
|
|
<header>
|
|
|
|
|
2023-05-27 11:58:08 +00:00
|
|
|
<h1 class="text-2xl font-bold leading-tight text-slate-700 dark:text-slate-300">
|
2023-03-14 15:22:52 +00:00
|
|
|
{{ .title }}
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
</header>
|
|
|
|
<main class="mt-4">
|
2023-04-28 18:31:10 +00:00
|
|
|
{{ if and .DisableSignup (ne .title "Login") }}
|
2023-09-22 15:26:09 +00:00
|
|
|
<p class="italic">{{ .locale.Tr "auth.signup-disabled" }}</p>
|
2023-03-14 15:22:52 +00:00
|
|
|
{{ else }}
|
|
|
|
<div class="sm:col-span-6">
|
|
|
|
<div class="mt-8 sm:w-full sm:max-w-md">
|
2023-05-27 11:58:08 +00:00
|
|
|
<div class="bg-white dark:bg-gray-900 rounded-md border border-1 border-gray-200 dark:border-gray-700 py-8 px-4 shadow sm:rounded-lg sm:px-10">
|
2023-05-06 16:53:59 +00:00
|
|
|
|
|
|
|
{{ if not .disableForm }}
|
2023-03-14 15:22:52 +00:00
|
|
|
<form class="space-y-6" action="#" method="post">
|
|
|
|
<div>
|
2023-09-22 15:26:09 +00:00
|
|
|
<label for="username" class="block text-sm font-medium text-slate-700 dark:text-slate-300"> {{ .locale.Tr "auth.username" }} </label>
|
2023-03-14 15:22:52 +00:00
|
|
|
<div class="mt-1">
|
2023-05-27 18:20:20 +00:00
|
|
|
<input id="username" name="username" type="text" required class="dark:bg-gray-800 appearance-none block w-full px-3 py-2 border border-gray-200 dark:border-gray-700 rounded-md shadow-sm placeholder-gray-600 dark:placeholder-gray-400 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm">
|
2023-03-14 15:22:52 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mt-8">
|
2023-09-22 15:26:09 +00:00
|
|
|
<label for="password" class="block text-sm font-medium text-slate-700 dark:text-slate-300"> {{ .locale.Tr "auth.password" }} </label>
|
2023-03-14 15:22:52 +00:00
|
|
|
<div class="mt-1">
|
2023-05-27 18:20:20 +00:00
|
|
|
<input id="password" name="password" type="password" autocomplete="current-password" required class="dark:bg-gray-800 appearance-none block w-full px-3 py-2 border border-gray-200 dark:border-gray-700 rounded-md shadow-sm placeholder-gray-600 dark:placeholder-gray-400 focus:outline-none focus:ring-primary-500 focus:border-primary-500 sm:text-sm">
|
2023-03-14 15:22:52 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{ if eq .title "Login" }}
|
|
|
|
<div class="flex">
|
|
|
|
<div class="flex-auto">
|
2023-09-22 15:26:09 +00:00
|
|
|
<button type="submit" class="inline-flex items-center px-4 py-2 border border-transparent border-gray-200 dark:border-gray-700 text-sm font-medium rounded-md shadow-sm text-white dark:text-white bg-primary-500 hover:bg-primary-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">{{ .locale.Tr "auth.login" }}</button>
|
2023-03-14 15:22:52 +00:00
|
|
|
</div>
|
2023-04-28 18:31:10 +00:00
|
|
|
{{ if not .DisableSignup }}
|
2023-09-22 15:26:09 +00:00
|
|
|
<span class="float-right text-sm py-2 underline"><a href="{{ $.c.ExternalUrl }}/register">{{ .locale.Tr "auth.register-instead" }} →</a></span>
|
2023-03-14 15:22:52 +00:00
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
{{ else }}
|
|
|
|
<div class="flex">
|
|
|
|
<div class="flex-auto">
|
2023-09-22 15:26:09 +00:00
|
|
|
<button type="submit" class="inline-flex items-center px-4 py-2 border border-transparent border-gray-200 dark:border-gray-700 text-sm font-medium rounded-md shadow-sm text-white dark:text-white bg-primary-500 hover:bg-primary-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">{{ .locale.Tr "auth.signup" }}</button>
|
2023-03-14 15:22:52 +00:00
|
|
|
</div>
|
2023-09-22 15:26:09 +00:00
|
|
|
<span class="float-right text-sm py-2 underline"><a href="{{ $.c.ExternalUrl }}/login">{{ .locale.Tr "auth.login-instead" }} →</a></span>
|
2023-03-14 15:22:52 +00:00
|
|
|
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
{{ .csrfHtml }}
|
|
|
|
</form>
|
2023-05-06 16:53:59 +00:00
|
|
|
{{ end }}
|
2023-04-17 20:13:19 +00:00
|
|
|
{{ if or .githubOauth .giteaOauth }}
|
2023-05-06 16:53:59 +00:00
|
|
|
{{ if not .disableForm }}
|
|
|
|
<div class="relative my-4">
|
|
|
|
<div class="absolute inset-0 flex items-center" aria-hidden="true">
|
2023-05-27 11:58:08 +00:00
|
|
|
<div class="w-full border-t border-gray-200 dark:border-gray-700"></div>
|
2023-05-06 16:53:59 +00:00
|
|
|
</div>
|
2023-04-17 20:13:19 +00:00
|
|
|
</div>
|
2023-05-06 16:53:59 +00:00
|
|
|
<br />
|
|
|
|
{{ end }}
|
2023-04-17 20:13:19 +00:00
|
|
|
<div>
|
|
|
|
{{ if .githubOauth }}
|
2023-07-03 14:31:12 +00:00
|
|
|
<a href="{{ $.c.ExternalUrl }}/oauth/github" class="block w-full mb-2 text-center whitespace-nowrap text-slate-700 dark:text-slate-300{{ if .syncReposFromFS }} text-slate-500 cursor-not-allowed {{ end }}rounded border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 px-2.5 py-2 text-xs font-medium text-gray-700 dark:text-white shadow-sm hover:bg-gray-100 dark:hover:bg-gray-700 hover:border-gray-500 hover:text-slate-700 dark:hover:text-slate-300 focus:outline-none focus:ring-1 focus:border-primary-500 focus:ring-primary-500 leading-3">
|
2023-09-22 15:26:09 +00:00
|
|
|
{{ .locale.Tr "auth.github-oauth" }}
|
2023-04-17 20:13:19 +00:00
|
|
|
</a>
|
|
|
|
{{ end }}
|
|
|
|
{{ if .giteaOauth }}
|
2023-07-03 14:31:12 +00:00
|
|
|
<a href="{{ $.c.ExternalUrl }}/oauth/gitea" class="block w-full mb-2 text-center whitespace-nowrap text-slate-700 dark:text-slate-300{{ if .syncReposFromFS }} text-slate-500 cursor-not-allowed {{ end }}rounded border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 px-2.5 py-2 text-xs font-medium text-gray-700 dark:text-white shadow-sm hover:bg-gray-100 dark:hover:bg-gray-700 hover:border-gray-500 hover:text-slate-700 dark:hover:text-slate-300 focus:outline-none focus:ring-1 focus:border-primary-500 focus:ring-primary-500 leading-3">
|
2023-09-22 15:26:09 +00:00
|
|
|
{{ .locale.Tr "auth.gitea-oauth" }}
|
2023-04-17 20:13:19 +00:00
|
|
|
</a>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
2023-03-14 15:22:52 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
</main>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{{ template "footer" .}}
|