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.

159 lines
5.5 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. {% extends "base.html" %}
  2. {% load compress static %}
  3. {% block title %}Sign In - {{ site_name }}{% endblock %}
  4. {% block description %}{% endblock %}
  5. {% block head %}
  6. <link rel="canonical" href="{{ site_root }}{% url 'hc-login' %}" />
  7. {% endblock %}
  8. {% block content %}
  9. <div class="row">
  10. <div class="col-xs-10 col-xs-offset-1 col-sm-12 col-sm-offset-0 col-lg-8 col-lg-offset-2">
  11. <h1>Sign In to {{ site_name }}</h1>
  12. {% if bad_link %}
  13. <div class="alert alert-warning">
  14. <p>The login link you just used is either incorrect or expired.</p>
  15. <p>Please use the form below to request a fresh login link.</p>
  16. </div>
  17. {% endif %}
  18. <div class="row">
  19. <div class="col-sm-6">
  20. <form id="magic-link-form" method="post">
  21. {% csrf_token %}
  22. {% if magic_form.identity.errors %}
  23. <p class="text-danger">{{ magic_form.identity.errors|join:"" }}</p>
  24. {% else %}
  25. <p>Enter your <strong>email address</strong>.</p>
  26. {% endif %}
  27. <input
  28. type="email"
  29. class="form-control input-lg"
  30. name="identity"
  31. value="{{ magic_form.identity.value|default:"" }}"
  32. placeholder="[email protected]"
  33. autocomplete="email">
  34. <p id="link-instruction">
  35. We will email you a magic sign in link.
  36. </p>
  37. <button type="submit" class="btn btn-lg btn-primary btn-block">
  38. Email Me a Link
  39. </button>
  40. </form>
  41. <div id="login-sep" class="hidden-xs"><div>or</div></div>
  42. </div>
  43. <div class="col-xs-12 visible-xs-block">
  44. <div id="xs-login-sep">
  45. <div>or</div>
  46. </div>
  47. </div>
  48. <div class="col-sm-6">
  49. <form id="login-form" method="post">
  50. {% csrf_token %}
  51. <input type="hidden" name="action" value="login" />
  52. {% if form.non_field_errors %}
  53. <p class="text-danger">{{ form.non_field_errors|join:"" }}</p>
  54. {% elif form.errors %}
  55. <p class="text-danger">Incorrect email or password.</p>
  56. {% else %}
  57. <p>
  58. Enter your <strong>email address</strong> and <strong>password</strong>.
  59. </p>
  60. {% endif %}
  61. <input
  62. type="email"
  63. class="form-control input-lg"
  64. name="email"
  65. value="{{ form.email.value|default:"" }}"
  66. placeholder="[email protected]"
  67. autocomplete="email">
  68. <input
  69. id="login-password"
  70. type="password"
  71. class="form-control input-lg"
  72. name="password"
  73. placeholder="your password">
  74. <p id="forgot-password">
  75. <a href="#" data-toggle="modal" data-target="#lost-password-modal">Lost your password?</a>
  76. </p>
  77. <button type="submit" class="btn btn-lg btn-primary btn-block">
  78. Sign In
  79. </button>
  80. </form>
  81. </div>
  82. </div>
  83. {% if registration_open %}
  84. <div class="row">
  85. <div id="login-signup-cta" class="col-sm-12 text-center">
  86. Don't have an account?
  87. <a href="#" data-toggle="modal" data-target="#signup-modal">Sign Up</a>
  88. </div>
  89. </div>
  90. {% endif %}
  91. </div>
  92. </div>
  93. {% if registration_open %}
  94. {% include "front/signup_modal.html" %}
  95. {% endif %}
  96. <div id="lost-password-modal" class="modal">
  97. <div class="modal-dialog">
  98. <div class="modal-content">
  99. <div class="modal-header">
  100. <button type="button" class="close" data-dismiss="modal">&times;</button>
  101. <h4>Lost Password?</h4>
  102. </div>
  103. <div class="modal-body">
  104. <p>
  105. If you need to reset your password, please do the following:
  106. </p>
  107. <ol>
  108. <li>Sign in using the <strong>Email Me a Link</strong> method.</li>
  109. <li>
  110. Once in your account, go to
  111. <strong>Account Settings › Set Password</strong>
  112. to set a new password.
  113. </li>
  114. </ol>
  115. {% if support_email %}
  116. <p>
  117. Please contact us at
  118. <a href="mailto:{{ support_email }}">{{ support_email }}</a>
  119. in case you need assistance!
  120. </p>
  121. {% endif %}
  122. </div>
  123. <div class="modal-footer">
  124. <button type="button" class="btn btn-default" data-dismiss="modal">Got it</button>
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. {% endblock %}
  130. {% block scripts %}
  131. {% compress js %}
  132. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  133. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  134. <script src="{% static 'js/signup.js' %}"></script>
  135. {% endcompress %}
  136. {% endblock %}