base.html 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. // EXPE variables parts
  32. // get access to django variables
  33. var BEGIN_EXPE = "{{request.session.expe_started}}" === 'True'
  34. var END_EXPE = "{{request.session.expe_finished}}" === 'True'
  35. </script>
  36. <!-- Custom Javascript file for experience template is placed here -->
  37. {% block javascripts %}
  38. {% endblock %}
  39. <!-- Dynamically load JS file of experience -->
  40. {% for file in js %}
  41. {% with 'js/'|add:file as js_static %}
  42. <script src="{% static js_static %}"></script>
  43. {% endwith %}
  44. {% endfor %}
  45. </body>