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.

101 lines
4.1KB

  1. <!--
  2. # @name: base.html
  3. # @version: 0.1
  4. # @creation_date: 2021-10-20
  5. # @license: The MIT License <https://opensource.org/licenses/MIT>
  6. # @author: Simon Bowie <ad7588@coventry.ac.uk>
  7. # @purpose: Basic layout for all pages
  8. # @acknowledgements:
  9. # https://www.digitalocean.com/community/tutorials/how-to-make-a-web-application-using-flask-in-python-3
  10. # Bootstrap 5.1.3: https://getbootstrap.com/
  11. -->
  12. <!DOCTYPE html>
  13. <html>
  14. <head>
  15. <meta charset="utf-8">
  16. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  17. <meta name="viewport" content="width=device-width, initial-scale=1">
  18. <title>COPIM online toolkit</title>
  19. <!-- Bootstrap CSS -->
  20. <!--<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">-->
  21. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
  22. </head>
  23. <body>
  24. <nav class="navbar navbar-expand-md navbar-light bg-light">
  25. <a class="navbar-brand" href="{{ url_for('main.index')}}">COPIM online toolkit</a>
  26. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
  27. <span class="navbar-toggler-icon"></span>
  28. </button>
  29. <div class="collapse navbar-collapse" id="navbarNav">
  30. <ul class="navbar-nav">
  31. <li class="nav-item">
  32. <a href="{{ url_for('main.index') }}" class="nav-link">
  33. Home
  34. </a>
  35. </li>
  36. <li class="nav-item">
  37. <a href="{{ url_for('tool.get_tools') }}" class="nav-link">
  38. Tools
  39. </a>
  40. </li>
  41. {% if current_user.is_authenticated %}
  42. <li class="nav-item">
  43. <a href="{{ url_for('tool.create_tool') }}" class="nav-link">
  44. Add tool
  45. </a>
  46. </li>
  47. {% endif %}
  48. {% if current_user.is_authenticated %}
  49. <li class="nav-item">
  50. <a href="{{ url_for('main.profile') }}" class="nav-link">
  51. Profile
  52. </a>
  53. </li>
  54. {% endif %}
  55. {% if not current_user.is_authenticated %}
  56. <li class="nav-item">
  57. <a href="{{ url_for('auth.login') }}" class="nav-link">
  58. Login
  59. </a>
  60. </li>
  61. <li class="nav-item">
  62. <a href="{{ url_for('auth.signup') }}" class="nav-link">
  63. Sign Up
  64. </a>
  65. </li>
  66. {% endif %}
  67. {% if current_user.is_authenticated %}
  68. <li class="nav-item">
  69. <a href="{{ url_for('auth.logout') }}" class="nav-link">
  70. Logout
  71. </a>
  72. </li>
  73. {% endif %}
  74. </ul>
  75. </div>
  76. </nav>
  77. <div class="container">
  78. {% with messages = get_flashed_messages() %}
  79. {% if messages %}
  80. <div class="alert alert-danger">
  81. {{ messages[0] }}
  82. </div>
  83. {% endif %}
  84. {% endwith %}
  85. {% block content %}
  86. {% endblock %}
  87. </div>
  88. <!-- Optional JavaScript -->
  89. <!-- jQuery first, then Popper.js, then Bootstrap JS -->
  90. <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
  91. <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
  92. <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
  93. </body>
  94. </html>