您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

176 行
6.8KB

  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. <!-- Google font -->
  25. <link href="https://fonts.googleapis.com/css?family=Lato:300,400,700&display=swap" rel='stylesheet' type='text/css'>
  26. </head>
  27. <body class="d-flex flex-column min-vh-100">
  28. <header>
  29. <!-- Fixed navbar -->
  30. <nav class="navbar navbar-expand-md navbar-light sticky-top">
  31. <div class="container-fluid">
  32. <a class="navbar-brand" href="{{ url_for('main.index')}}">ExPub Compendium</a>
  33. <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  34. <span class="navbar-toggler-icon"></span>
  35. </button>
  36. <div class="collapse navbar-collapse" id="navbarSupportedContent">
  37. <ul class="navbar-nav">
  38. <li class="nav-item">
  39. <a href="{{ url_for('tool.get_tools') }}" class="nav-link">
  40. Tools
  41. </a>
  42. </li>
  43. <li class="nav-item">
  44. <a href="{{ url_for('practice.get_practices') }}" class="nav-link">
  45. Practices
  46. </a>
  47. </li>
  48. <li class="nav-item">
  49. <a href="{{ url_for('sensitivity.get_sensitivities') }}" class="nav-link">
  50. Sensitivities
  51. </a>
  52. </li>
  53. <li class="nav-item">
  54. <a href="{{ url_for('typology.get_typologies') }}" class="nav-link">
  55. Typologies
  56. </a>
  57. </li>
  58. <li class="nav-item">
  59. <a href="{{ url_for('workflow.get_workflows') }}" class="nav-link">
  60. Workflows
  61. </a>
  62. </li>
  63. <li class="nav-item">
  64. <a href="{{ url_for('publisher.get_publishers') }}" class="nav-link">
  65. Publishers
  66. </a>
  67. </li>
  68. <li class="nav-item">
  69. <a href="{{ url_for('book.get_books') }}" class="nav-link">
  70. Books
  71. </a>
  72. </li>
  73. <li class="nav-item">
  74. <a href="{{ url_for('reference.get_references') }}" class="nav-link">
  75. References
  76. </a>
  77. </li>
  78. {% if current_user.is_authenticated %}
  79. <li class="nav-item">
  80. <a href="{{ url_for('create.create_resource') }}" class="nav-link">
  81. Add resource
  82. </a>
  83. </li>
  84. {% endif %}
  85. {% if current_user.is_authenticated %}
  86. <li class="nav-item">
  87. <a href="{{ url_for('main.profile') }}" class="nav-link">
  88. Profile
  89. </a>
  90. </li>
  91. {% endif %}
  92. {% if not current_user.is_authenticated %}
  93. <li class="nav-item">
  94. <a href="{{ url_for('auth.login') }}" class="nav-link">
  95. Login
  96. </a>
  97. </li>
  98. <li class="nav-item">
  99. <a href="{{ url_for('auth.signup') }}" class="nav-link">
  100. Sign Up
  101. </a>
  102. </li>
  103. {% endif %}
  104. {% if current_user.is_authenticated %}
  105. <li class="nav-item">
  106. <a href="{{ url_for('auth.logout') }}" class="nav-link">
  107. Logout
  108. </a>
  109. </li>
  110. {% endif %}
  111. <li class="nav-item">
  112. <a href="{{ url_for('main.test') }}" class="nav-link">
  113. Test
  114. </a>
  115. </li>
  116. </ul>
  117. </div>
  118. </div>
  119. </nav>
  120. </header>
  121. <!-- Begin page content -->
  122. <main class="flex-shrink-0">
  123. <div class="container">
  124. {% with messages = get_flashed_messages() %}
  125. {% if messages %}
  126. <div class="alert alert-danger">
  127. {{ messages[0] }}
  128. </div>
  129. {% endif %}
  130. {% endwith %}
  131. {% block content %}
  132. {% endblock %}
  133. </div>
  134. </main>
  135. <!-- Sticky footer-->
  136. <footer class="footer py-3 mt-auto" style="background-color: #dcddde;">
  137. <div class="container">
  138. <span class="text-muted">© {{ 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>
  139. </div>
  140. </footer>
  141. <!-- JavaScript -->
  142. <!-- jQuery first, then Popper JS, then Bootstrap JS -->
  143. <script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
  144. <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>
  145. <script>
  146. $("#resource_type").change(function() {
  147. var resource_type = $(this).val();
  148. $(".resource_type_input").hide("fast", function() {
  149. $("#resource_type_" + resource_type).show("slow");
  150. });
  151. });
  152. </script>
  153. <script>
  154. // Initialize tooltips
  155. var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
  156. var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
  157. return new bootstrap.Tooltip(tooltipTriggerEl)
  158. })
  159. </script>
  160. <script>
  161. var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
  162. var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
  163. return new bootstrap.Popover(popoverTriggerEl)
  164. })
  165. </script>
  166. </body>
  167. </html>