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.

112 lines
3.9 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 hc_extras static %}
  3. {% block title %}Sign In - {% site_name %}{% endblock %}
  4. {% block description %}{% endblock %}
  5. {% block content %}
  6. <div class="row">
  7. <div class="col-xs-10 col-xs-offset-1 col-sm-12 col-sm-offset-0 col-lg-8 col-lg-offset-2">
  8. <h1>Sign In to {% site_name %}</h1>
  9. {% if bad_link %}
  10. <div class="alert alert-warning">
  11. <p>The login link you just used is either incorrect or expired.</p>
  12. <p>Please use the form below to request a fresh login link.</p>
  13. </div>
  14. {% endif %}
  15. <div class="row">
  16. <div class="col-sm-6">
  17. <form id="magic-link-form" method="post">
  18. {% csrf_token %}
  19. {% if magic_form.identity.errors %}
  20. <p class="text-danger">{{ magic_form.identity.errors|join:"" }}</p>
  21. {% else %}
  22. <p>Enter your <strong>email address</strong>.</p>
  23. {% endif %}
  24. <input
  25. type="email"
  26. class="form-control input-lg"
  27. name="identity"
  28. value="{{ magic_form.identity.value|default:"" }}"
  29. placeholder="[email protected]"
  30. autocomplete="email">
  31. <p id="link-instruction">
  32. We will email you a magic sign in link.
  33. </p>
  34. <button type="submit" class="btn btn-lg btn-primary btn-block">
  35. Email Me a Link
  36. </button>
  37. </form>
  38. <div id="login-sep" class="hidden-xs"><div>or</div></div>
  39. </div>
  40. <div class="col-xs-12 visible-xs-block">
  41. <div id="xs-login-sep">
  42. <div>or</div>
  43. </div>
  44. </div>
  45. <div class="col-sm-6">
  46. <form id="login-form" method="post">
  47. {% csrf_token %}
  48. <input type="hidden" name="action" value="login" />
  49. {% if form.non_field_errors %}
  50. <p class="text-danger">{{ form.non_field_errors|join:"" }}</p>
  51. {% elif form.errors %}
  52. <p class="text-danger">Incorrect email or password.</p>
  53. {% else %}
  54. <p>
  55. Enter your <strong>email address</strong> and <strong>password</strong>.
  56. </p>
  57. {% endif %}
  58. <input
  59. type="email"
  60. class="form-control input-lg"
  61. name="email"
  62. value="{{ form.email.value|default:"" }}"
  63. placeholder="[email protected]"
  64. autocomplete="email">
  65. <input
  66. type="password"
  67. class="form-control input-lg"
  68. name="password"
  69. placeholder="your password">
  70. <button type="submit" class="btn btn-lg btn-primary btn-block">
  71. Sign In
  72. </button>
  73. </form>
  74. </div>
  75. </div>
  76. <div class="row">
  77. <div id="login-signup-cta" class="col-sm-12 text-center">
  78. Don't have an account?
  79. <a href="#" data-toggle="modal" data-target="#signup-modal">Sign Up</a>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. {% include "front/signup_modal.html" %}
  85. {% endblock %}
  86. {% block scripts %}
  87. {% compress js %}
  88. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  89. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  90. <script src="{% static 'js/login.js' %}"></script>
  91. <script src="{% static 'js/signup.js' %}"></script>
  92. {% endcompress %}
  93. {% endblock %}