login.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
  6. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css"
  7. integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
  8. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  9. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
  10. <title>Smart Hubs Points</title>
  11. </head>
  12. <body>
  13. <div id="login" class="col-md-4 offset-md-4 mt-5">
  14. <h2 class="login-header">Login</h2>
  15. <form action="" method="POST">
  16. {{ form.csrf_token }}
  17. <div class="form-group">
  18. <label>Username</label>
  19. {{ form.username(_class="form-control", placeholder="your username") }}
  20. {% if form.errors.username %}
  21. <div class="alert alert-danger" role="alert">
  22. <ul>
  23. {% for error in form.errors.username %}
  24. <li>{{ error }}</li>
  25. {% endfor %}
  26. </ul>
  27. </div>
  28. {% endif %}
  29. </div>
  30. <div class="form-group">
  31. <label>Password</label>
  32. {{ form.password(_class="form-control") }}
  33. {% if form.errors.password %}
  34. <div class="alert alert-danger" role="alert">
  35. <ul>
  36. {% for error in form.errors.password %}
  37. <li>{{ error }}</li>
  38. {% endfor %}
  39. </ul>
  40. </div>
  41. {% endif %}
  42. </div>
  43. <button type="submit" class="btn btn-primary">Login!</button>
  44. </form>
  45. {% with messages = get_flashed_messages() %}
  46. {% if messages %}
  47. <div class="alert alert-warning">
  48. <ul class=flashes>
  49. {% for message in messages %}
  50. <li>{{ message }}</li>
  51. {% endfor %}
  52. </ul>
  53. </div>
  54. {% endif %}
  55. {% endwith %}
  56. </div>
  57. </body>
  58. </html>