base.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!DOCTYPE html>
  2. <html lang="fr">
  3. <head>
  4. <meta charset="UTF-8"/>
  5. <title>
  6. {% block title %}
  7. {% endblock %}
  8. </title>
  9. {% load staticfiles %}
  10. {% load apptags %}
  11. {% block stylesheets %}
  12. <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">
  13. <link rel="stylesheet" type="text/css" href="{% static "css/expe.css" %}">
  14. <script src="https://kit.fontawesome.com/ee9d97bd14.js" crossorigin="anonymous"></script>
  15. {% endblock %}
  16. </head>
  17. <body>
  18. <div class="container">
  19. {% block content %}
  20. {% endblock %}
  21. </div>
  22. <!-- Global scripts used -->
  23. <script type="text/javascript">
  24. // JS need to know if apache2 server use BASE_URL
  25. // add by default '/' into BASE
  26. const BASE = "{{BASE}}"
  27. const host = window.location.host
  28. var baseUrl = location.protocol + '//' + host + '/'
  29. if (BASE !== '') baseUrl += BASE + '/'
  30. const expeUrl = baseUrl + 'expe'
  31. const indicationsUrl = baseUrl + 'indications'
  32. // EXPE variables parts
  33. // get access to django variables
  34. var BEGIN_EXPE = "{{request.session.expe_started}}" === 'True'
  35. var END_EXPE = "{{request.session.expe_finished}}" === 'True'
  36. </script>
  37. <!-- Custom Javascript file for experiments template is placed here -->
  38. {% block javascripts %}
  39. {% endblock %}
  40. <!-- Dynamically load JS file of experiments -->
  41. {% for file in javascript %}
  42. {% with 'js/'|add:file as js_static %}
  43. <script src="{% static js_static %}"></script>
  44. {% endwith %}
  45. {% endfor %}
  46. </body>