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.

174 lines
6.6KB

  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. # Flask-Moment: https://flask-moment.readthedocs.io/en/latest/
  12. -->
  13. <!DOCTYPE html>
  14. <html>
  15. <head>
  16. {{ moment.include_moment() }}
  17. <meta charset="utf-8">
  18. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  19. <meta name="viewport" content="width=device-width, initial-scale=1">
  20. <title>ExPub Compendium</title>
  21. <!-- Bootstrap CSS -->
  22. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
  23. <link href="{{ url_for('static',filename='styles/custom.css') }}" rel="stylesheet">
  24. </head>
  25. <body class="d-flex flex-column min-vh-100">
  26. <header>
  27. <!-- Fixed navbar -->
  28. <nav class="navbar navbar-expand-md navbar-light sticky-top">
  29. <div class="container-fluid">
  30. <a class="navbar-brand" href="{{ url_for('main.index')}}">ExPub Compendium</a>
  31. <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  32. <span class="navbar-toggler-icon"></span>
  33. </button>
  34. <div class="collapse navbar-collapse" id="navbarSupportedContent">
  35. <ul class="navbar-nav">
  36. <li class="nav-item">
  37. <a href="{{ url_for('tool.get_tools') }}" class="nav-link">
  38. Tools
  39. </a>
  40. </li>
  41. <li class="nav-item">
  42. <a href="{{ url_for('practice.get_practices') }}" class="nav-link">
  43. Practices
  44. </a>
  45. </li>
  46. <li class="nav-item">
  47. <a href="{{ url_for('sensitivity.get_sensitivities') }}" class="nav-link">
  48. Sensitivities
  49. </a>
  50. </li>
  51. <li class="nav-item">
  52. <a href="{{ url_for('typology.get_typologies') }}" class="nav-link">
  53. Typologies
  54. </a>
  55. </li>
  56. <li class="nav-item">
  57. <a href="{{ url_for('workflow.get_workflows') }}" class="nav-link">
  58. Workflows
  59. </a>
  60. </li>
  61. <li class="nav-item">
  62. <a href="{{ url_for('publisher.get_publishers') }}" class="nav-link">
  63. Publishers
  64. </a>
  65. </li>
  66. <li class="nav-item">
  67. <a href="{{ url_for('book.get_books') }}" class="nav-link">
  68. Books
  69. </a>
  70. </li>
  71. <li class="nav-item">
  72. <a href="{{ url_for('reference.get_references') }}" class="nav-link">
  73. References
  74. </a>
  75. </li>
  76. {% if current_user.is_authenticated %}
  77. <li class="nav-item">
  78. <a href="{{ url_for('create.create_resource') }}" class="nav-link">
  79. Add resource
  80. </a>
  81. </li>
  82. {% endif %}
  83. {% if current_user.is_authenticated %}
  84. <li class="nav-item">
  85. <a href="{{ url_for('main.profile') }}" class="nav-link">
  86. Profile
  87. </a>
  88. </li>
  89. {% endif %}
  90. {% if not current_user.is_authenticated %}
  91. <li class="nav-item">
  92. <a href="{{ url_for('auth.login') }}" class="nav-link">
  93. Login
  94. </a>
  95. </li>
  96. <li class="nav-item">
  97. <a href="{{ url_for('auth.signup') }}" class="nav-link">
  98. Sign Up
  99. </a>
  100. </li>
  101. {% endif %}
  102. {% if current_user.is_authenticated %}
  103. <li class="nav-item">
  104. <a href="{{ url_for('auth.logout') }}" class="nav-link">
  105. Logout
  106. </a>
  107. </li>
  108. {% endif %}
  109. <li class="nav-item">
  110. <a href="{{ url_for('main.test') }}" class="nav-link">
  111. Test
  112. </a>
  113. </li>
  114. </ul>
  115. </div>
  116. </div>
  117. </nav>
  118. </header>
  119. <!-- Begin page content -->
  120. <main class="flex-shrink-0">
  121. <div class="container">
  122. {% with messages = get_flashed_messages() %}
  123. {% if messages %}
  124. <div class="alert alert-danger">
  125. {{ messages[0] }}
  126. </div>
  127. {% endif %}
  128. {% endwith %}
  129. {% block content %}
  130. {% endblock %}
  131. </div>
  132. </main>
  133. <!-- Sticky footer-->
  134. <footer class="footer py-3 mt-auto" style="background-color: #dcddde;">
  135. <div class="container">
  136. <span class="text-muted">© 2022–{{ moment().format('YYYY') }} <a href="https://copim.ac.uk/">COPIM</a> and licensed under a <a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License (CC BY 4.0)</a>.</span>
  137. </div>
  138. </footer>
  139. <!-- JavaScript -->
  140. <!-- jQuery first, then Popper JS, then Bootstrap JS -->
  141. <script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
  142. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
  143. <script>
  144. $("#resource_type").change(function() {
  145. var resource_type = $(this).val();
  146. $(".resource_type_input").hide("fast", function() {
  147. $("#resource_type_" + resource_type).show("slow");
  148. });
  149. });
  150. </script>
  151. <script>
  152. // Initialize tooltips
  153. var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
  154. var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
  155. return new bootstrap.Tooltip(tooltipTriggerEl)
  156. })
  157. </script>
  158. <script>
  159. var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
  160. var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
  161. return new bootstrap.Popover(popoverTriggerEl)
  162. })
  163. </script>
  164. </body>
  165. </html>