<!--
Copyright (C) 2023 Nicola Murino

This WebUI uses the KeenThemes Mega Bundle, a proprietary theme:

https://keenthemes.com/products/templates-mega-bundle

KeenThemes HTML/CSS/JS components are allowed for use only within the
SFTPGo product and restricted to be used in a resealable HTML template
that can compete with KeenThemes products anyhow.

This WebUI is allowed for use only within the SFTPGo product and
therefore cannot be used in derivative works/products without an
explicit grant from the SFTPGo Team (support@sftpgo.com).
-->
{{- template "baselogin" .}}

{{- define "title"}}Login{{- end}}

{{- define "content"}}
						<form class="form w-100" id="sign_in_form" action="{{.CurrentURL}}" method="POST">
							<div class="container mb-10">
								<div class="row align-items-center">
									<div class="col-5 align-items-center">
										<img alt="Logo" src="{{.StaticURL}}{{.Branding.LogoPath}}" class="h-80px h-md-90px h-lg-100px" />
									</div>
									<div class="col-7">
										<h1 class="text-gray-900 mb-3 ms-3">
											{{.Branding.ShortName}}
										</h1>
									</div>
								</div>
							</div>
							{{template "errmsg" .Error}}
							{{- if not .FormDisabled}}
							<div class="fv-row mb-10">
								<input class="form-control form-control-lg form-control-solid" type="text" name="username" placeholder="Username" spellcheck="false" required />
							</div>
							<div class="fv-row mb-10">
								<input class="form-control form-control-lg form-control-solid" type="password" name="password" placeholder="Password" autocomplete="current-password" spellcheck="false" required />
								<div class="d-flex justify-content-end mt-2">
									{{- if .ForgotPwdURL}}
									<a href="{{.ForgotPwdURL}}" class="link-primary fs-6 fw-bold">Forgot Password ?</a>
									{{- end}}
								</div>
							</div>
							{{- end}}
							<div class="text-center">
								{{- if not .FormDisabled}}
								<input type="hidden" name="_form_token" value="{{.CSRFToken}}">
								<button type="submit" id="sign_in_submit" class="btn btn-lg btn-primary w-100 mb-5">
									<span class="indicator-label">Sign in</span>
									<span class="indicator-progress">Please wait...
										<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
									</span>
								</button>
								{{- end}}
								{{- if .OpenIDLoginURL}}
								{{- if not .FormDisabled}}
								<div class="text-center text-muted text-uppercase fw-bold mb-5">or</div>
								{{- end}}
								<a href="{{.OpenIDLoginURL}}" class="btn btn-flex flex-center btn-light btn-lg w-100 mb-5">
								<img alt="Logo" src="{{.StaticURL}}/img/openid-logo.png" class="h-20px me-3" />Sign in with OpenID</a>
								{{- end}}
							</div>
						</form>
						{{- if or .AltLoginURL (and .Branding.DisclaimerName .Branding.DisclaimerPath) }}
						<div class="d-flex flex-center flex-column-auto pt-10 mt-5">
							<div class="d-flex align-items-center fw-semibold fs-6">
								{{- if .AltLoginURL}}
								<a href="{{.AltLoginURL}}" class="text-muted text-hover-primary px-2">{{.AltLoginName}}</a>
								{{- end}}
								{{- if and .Branding.DisclaimerName .Branding.DisclaimerPath}}
								<a href="{{.StaticURL}}{{.Branding.DisclaimerPath}}" target="_blank" class="text-muted text-hover-primary px-2">{{.Branding.DisclaimerName}}</a>
								{{- end}}
							</div>
						</div>
						{{- end}}
{{- end}}