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.

121 lines
4.1 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. type="password"
  70. class="form-control input-lg"
  71. name="password"
  72. placeholder="your password">
  73. <button type="submit" class="btn btn-lg btn-primary btn-block">
  74. Sign In
  75. </button>
  76. </form>
  77. </div>
  78. </div>
  79. {% if registration_open %}
  80. <div class="row">
  81. <div id="login-signup-cta" class="col-sm-12 text-center">
  82. Don't have an account?
  83. <a href="#" data-toggle="modal" data-target="#signup-modal">Sign Up</a>
  84. </div>
  85. </div>
  86. {% endif %}
  87. </div>
  88. </div>
  89. {% if registration_open %}
  90. {% include "front/signup_modal.html" %}
  91. {% endif %}
  92. {% endblock %}
  93. {% block scripts %}
  94. {% compress js %}
  95. <script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
  96. <script src="{% static 'js/bootstrap.min.js' %}"></script>
  97. <script src="{% static 'js/login.js' %}"></script>
  98. <script src="{% static 'js/signup.js' %}"></script>
  99. {% endcompress %}
  100. {% endblock %}