base.html 1.7 KB

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