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