A clean, Markdown-based publishing platform made for writers. Write together, and build a community. https://writefreely.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

63 lines
2.5 KiB

  1. {{define "head"}}<title>Log in &mdash; {{.SiteName}}</title>
  2. <meta name="description" content="Log in to {{.SiteName}}.">
  3. <meta itemprop="description" content="Log in to {{.SiteName}}.">
  4. <style>
  5. input{margin-bottom:0.5em;}
  6. #generic-oauth-login {
  7. box-sizing: border-box;
  8. font-size: 17px;
  9. }
  10. </style>
  11. {{end}}
  12. {{define "content"}}
  13. <div class="tight content-container">
  14. <h1>Log in to {{.SiteName}}</h1>
  15. {{if .Flashes}}<ul class="errors">
  16. {{range .Flashes}}<li class="urgent">{{.}}</li>{{end}}
  17. </ul>{{end}}
  18. {{ if or .OauthSlack .OauthWriteAs .OauthGitlab .OauthGeneric }}
  19. <div class="row content-container signinbtns">
  20. {{ if .OauthSlack }}
  21. <a class="loginbtn" href="/oauth/slack"><img alt="Sign in with Slack" height="40" width="172" src="/img/sign_in_with_slack.png" srcset="/img/sign_in_with_slack.png 1x, /img/sign_in_with_slack@2x.png 2x" /></a>
  22. {{ end }}
  23. {{ if .OauthWriteAs }}
  24. <a class="btn cta loginbtn" id="writeas-login" href="/oauth/write.as">Sign in with <strong>Write.as</strong></a>
  25. {{ end }}
  26. {{ if .OauthGitlab }}
  27. <a class="btn cta loginbtn" id="gitlab-login" href="/oauth/gitlab">Sign in with <strong>{{.GitlabDisplayName}}</strong></a>
  28. {{ end }}
  29. {{ if .OauthGeneric }}
  30. <a class="btn cta loginbtn" id="generic-oauth-login" href="/oauth/generic">Sign in with <strong>{{ .OauthGenericDisplayName }}</strong></a>
  31. {{ end }}
  32. </div>
  33. {{if not .DisablePasswordAuth}}
  34. <div class="or">
  35. <p>or</p>
  36. <hr class="short" />
  37. </div>
  38. {{end}}
  39. {{ end }}
  40. {{if not .DisablePasswordAuth}}
  41. <form action="/auth/login" method="post" style="text-align: center;margin-top:1em;" onsubmit="disableSubmit()">
  42. <input type="text" name="alias" placeholder="Username" value="{{.LoginUsername}}" {{if not .LoginUsername}}autofocus{{end}} /><br />
  43. <input type="password" name="pass" placeholder="Password" {{if .LoginUsername}}autofocus{{end}} /><br />
  44. {{if .To}}<input type="hidden" name="to" value="{{.To}}" />{{end}}
  45. <input type="submit" id="btn-login" value="Login" />
  46. </form>
  47. {{if and (not .SingleUser) .OpenRegistration}}<p style="text-align:center;font-size:0.9em;margin:3em auto;max-width:26em;">{{if .Message}}{{.Message}}{{else}}<em>No account yet?</em> <a href="{{.SignupPath}}">Sign up</a> to start a blog.{{end}}</p>{{end}}
  48. <script type="text/javascript">
  49. function disableSubmit() {
  50. var $btn = document.getElementById("btn-login");
  51. $btn.value = "Logging in...";
  52. $btn.disabled = true;
  53. }
  54. </script>
  55. {{end}}
  56. {{end}}