ressources.html.twig 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. {% extends 'partials/base.html.twig' %}
  2. {% block content %}
  3. {% set t = grav.uri.param('title') %}
  4. {% set type = grav.uri.param('type') %}
  5. {% include 'partials/head.html.twig' %}
  6. <div class="columns medium-12 medium-offset-0 small-11 small-offset-1 ss_menu">
  7. <div class="row">
  8. <div class="doc_b">
  9. {% if type and type =="doc"%}
  10. {% set c = "select" %}
  11. {% else %}
  12. {% set c = " " %}
  13. {% endif %}
  14. <a class="selectable {{c}}" data-type="doc" >Documents</a>
  15. </div>
  16. <div class="doc_b">
  17. {% if type and type == "video"%}
  18. {% set c = "select" %}
  19. {% else %}
  20. {% set c = " " %}
  21. {% endif %}
  22. {% if lang == "fr" %}
  23. <a class="selectable {{c}}" data-type="video" >Vidéos</a>
  24. {% else %}
  25. <a class="selectable {{c}}" data-type="video" >Videos</a>
  26. {% endif %}
  27. </div>
  28. <div class="doc_b">
  29. {% if type and type =="images"%}
  30. {% set c = "select" %}
  31. {% else %}
  32. {% set c = " " %}
  33. {% endif %}
  34. {% if lang == "fr" %}
  35. <a class="selectable {{c}}" data-type="images" >Photos</a>
  36. {% else %}
  37. <a class="selectable {{c}}" data-type="images" >Pictures</a>
  38. {% endif %}
  39. </div>
  40. <div class="doc_b">
  41. {% if type and type =="pod"%}
  42. {% set c = "select" %}
  43. {% else %}
  44. {% set c = " " %}
  45. {% endif %}
  46. {% if lang == "fr" %}
  47. <a class="selectable {{c}}" data-type="pod" >Podcasts</a>
  48. {% else %}
  49. <a class="selectable {{c}}" data-type="pod" >Podcasts</a>
  50. {% endif %}
  51. </div>
  52. <div class="doc_b">
  53. {% if type and type =="newsletter"%}
  54. {% set c = "select" %}
  55. {% else %}
  56. {% set c = " " %}
  57. {% endif %}
  58. {% if lang == "fr" %}
  59. <a class="selectable {{c}}" data-type="newsletter" >Newsletter</a>
  60. {% else %}
  61. <a class="selectable {{c}}" data-type="newsletter" >Newsletter</a>
  62. {% endif %}
  63. </div>
  64. <div class="doc_b">
  65. {% if type and type =="media"%}
  66. {% set c = "select" %}
  67. {% else %}
  68. {% set c = " " %}
  69. {% endif %}
  70. {% if lang == "fr" %}
  71. <a class="selectable {{c}}" data-type="media" >TLP dans les médias</a>
  72. {% else %}
  73. <a class="selectable {{c}}" data-type="media" >TLP in the media</a>
  74. {% endif %}
  75. </div>
  76. <div class="columns medium-12 small-11 doc type">
  77. {% if lang == "fr" %}
  78. {% set arr = {
  79. rapports : "Rapports de recherche",
  80. admin : "Rapports d’activités et administratifs",
  81. digital : "Outils numériques",
  82. com: "Communiqués et tribunes"
  83. } %}
  84. {% else %}
  85. {% set arr = {
  86. rapports : "Research reports",
  87. admin : "Activity and administrative reports",
  88. digital : "Digital tools",
  89. com: "Press releases and tribunes",
  90. } %}
  91. {% endif %}
  92. <div class="row">
  93. {% for key,section in arr %}
  94. <div class="menu_selector column small-12" >
  95. <a class="selector" data-section="{{key}}" onclick="displaysection(this)">{{section}}</a>
  96. </div>
  97. {% endfor %}
  98. {% for key,section in arr %}
  99. <div class="section column small-12" >
  100. <div data-type="{{key}}" class="row">
  101. {% for item in page.header.doc %}
  102. {% if item.docTag[0] == key %}
  103. <div class="elem column small-4">
  104. {% set id = item.url|split("=") %}
  105. <a style="background-image:url('{{ page.url~'/'~item.thumbnail|first.name }}'); background-color: grey;" href="{{ page.url~'/'~item.doc|first.name }}">
  106. </a>
  107. </div>
  108. <div class="doc_desc column small-8">
  109. <div class="title">{{ item.title }}</div>
  110. <br>
  111. <p>{{ item.description }}</p>
  112. </div>
  113. {% endif %}
  114. {% endfor %}
  115. </div>
  116. </div>
  117. {% endfor %}
  118. </div>
  119. </div>
  120. </div>
  121. <div class="row doc_container">
  122. <div class="columns medium-12 small-11 images type">
  123. <div class="row">
  124. {% for elem in page.header.images %}
  125. {% if t == elem.title|hyphenize %}
  126. {% set class = "requested" %}
  127. {% else %}
  128. {% set class = "" %}
  129. {% endif %}
  130. <div class=" elem columns small-4 {{ class }}">
  131. <!-- <div class="overlay"></div> -->
  132. {% for img in elem.image_list %}
  133. <a style="background-image:url('{{page.url}}/{{img.name}}')" href="{{page.url}}/{{img.name}}" data-lightbox="{{ elem.title|hyphenize }}" data-title="{{ elem.title }} - {{ img.meta.caption }}">
  134. <div class="title">{{ elem.title }} ({{ elem.image_list|length }} photos)</div>
  135. </a>
  136. {% endfor %}
  137. </div>
  138. {% endfor %}
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. <div class="columns medium-12 small-11 video type">
  144. <div class="row">
  145. {% for elem in page.header.vid %}
  146. <div class="elem columns small-4">
  147. {% set id = elem.url|split("=") %}
  148. <a style="background-image:url(' https://img.youtube.com/vi/{{ id[1]}}/0.jpg')" href="{{ elem.url }}">
  149. <div class="title">{{ elem.title }}</div>
  150. </a>
  151. </div>
  152. {% endfor %}
  153. </div>
  154. </div>
  155. <div class="columns medium-12 small-11 pod type">
  156. <div class="row">
  157. {% for elem in page.header.pod %}
  158. <div class="elem pod_thumb columns large-4 small-10 small-offset-1">
  159. <mark>{{ elem.title }}</mark>
  160. <img src="{{page.url}}/{{elem.thumbnail|first.name}}" alt="">
  161. <br><br>
  162. {% for audio in elem.file %}
  163. <audio controls>
  164. <source src="{{page.url}}/{{audio.path}}" type="{{audio.type}}">
  165. Your browser does not support the audio element.
  166. </audio>
  167. {% endfor %}
  168. <p>
  169. {{ elem.desc }}
  170. </p>
  171. </div>
  172. {% endfor %}
  173. </div>
  174. </div>
  175. <div class="columns medium-12 small-11 newsletter type">
  176. <div class="row">
  177. {% for elem in page.header.nl %}
  178. <div class="columns small-12" style ="margin-bottom:1rem;">
  179. <a href="{{elem.url}}">
  180. <div class="row">
  181. <div class="newsletter_item small-12" >
  182. <h5>{{ elem.title }}</h5>
  183. </div>
  184. </div>
  185. </a>
  186. </div>
  187. {% endfor %}
  188. </div>
  189. </div>
  190. <div class="columns medium-12 small-11 media type">
  191. <div class="row">
  192. {% for elem in page.header.media %}
  193. <div class="columns small-12">
  194. <a href="{{elem.url}}">
  195. <div class="row">
  196. <div class="elem pod_thumb columns small-4">
  197. <img src="{{page.url}}/{{elem.thumbnail|first.name}}" alt="">
  198. </div>
  199. <div style="padding-left:1rem; margin:0;"class="elem small-8">
  200. <p><mark>{{ elem.title }}</mark><br></p>
  201. <p><b>{{elem.date|date("d-m-Y")}}</b></p>
  202. <p> {{ elem.desc }} </p>
  203. </div>
  204. </div>
  205. </a>
  206. </div>
  207. {% endfor %}
  208. </div>
  209. </div>
  210. </div>
  211. </div>
  212. <script>
  213. lightbox.option({
  214. 'resizeDuration': 200,
  215. 'wrapAround': true
  216. });
  217. function displaysection(elem){
  218. let v = $(elem).data("section");
  219. if($(elem).hasClass("active")){
  220. $('.selector').removeClass("active");
  221. $(".section .row").show();
  222. }else{
  223. $('.selector').removeClass("active");
  224. $(elem).addClass("active");
  225. $(".section .row").hide();
  226. $(".section").find(`[data-type='${v}']`).show();
  227. }
  228. }
  229. $(".selectable").each(function(){
  230. if($(this).hasClass("select")){
  231. console.log(this);
  232. var e=$(this).data("type");
  233. $(".type").hide();
  234. $("."+e).show();
  235. }
  236. });
  237. </script>
  238. {% endblock %}