imio.smartweb.core 1.2.38__py3-none-any.whl → 1.2.79__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. imio/smartweb/core/behaviors/categorization.py +24 -0
  2. imio/smartweb/core/behaviors/configure.zcml +7 -0
  3. imio/smartweb/core/browser/controlpanel.py +43 -0
  4. imio/smartweb/core/browser/faceted/block_view.pt +4 -4
  5. imio/smartweb/core/browser/faceted/summary_view.pt +4 -4
  6. imio/smartweb/core/browser/sitemap.py +10 -3
  7. imio/smartweb/core/browser/static/icons/action-delete.svg +3 -0
  8. imio/smartweb/core/browser/static/icons/action-engagement-2.svg +4 -0
  9. imio/smartweb/core/browser/static/icons/action-panneaux.svg +3 -0
  10. imio/smartweb/core/browser/static/icons/action-vote.svg +3 -0
  11. imio/smartweb/core/browser/static/icons/categorie-attention.svg +3 -0
  12. imio/smartweb/core/browser/static/icons/categorie-infos-travaux-2.svg +4 -0
  13. imio/smartweb/core/browser/static/icons/categorie-nature.svg +3 -0
  14. imio/smartweb/core/browser/static/icons/categorie-parcs-a-conteneurs.svg +4 -0
  15. imio/smartweb/core/browser/static/icons/categorie-plus.svg +3 -0
  16. imio/smartweb/core/browser/static/icons/categorie-primes-2.svg +5 -0
  17. imio/smartweb/core/browser/static/icons/categorie-sport-natation.svg +4 -0
  18. imio/smartweb/core/browser/static/icons/organisation-ecole-sac.svg +4 -0
  19. imio/smartweb/core/browser/static/icons/organisation-scout.svg +3 -0
  20. imio/smartweb/core/browser/static/icons/reseausocial-behance.svg +3 -0
  21. imio/smartweb/core/browser/static/icons/reseausocial-linkedin.svg +3 -0
  22. imio/smartweb/core/browser/static/smartweb-edit-compiled.css +1 -1
  23. imio/smartweb/core/browser/static/smartweb-view-compiled.css +1 -1
  24. imio/smartweb/core/browser/static/src/edit.less +42 -0
  25. imio/smartweb/core/browser/static/src/view.less +109 -56
  26. imio/smartweb/core/browser/vocabulary.py +8 -3
  27. imio/smartweb/core/contents/__init__.py +2 -0
  28. imio/smartweb/core/contents/configure.zcml +1 -0
  29. imio/smartweb/core/contents/folder/block_view.pt +8 -8
  30. imio/smartweb/core/contents/folder/summary_view.pt +4 -4
  31. imio/smartweb/core/contents/pages/cirkwi/content.py +5 -0
  32. imio/smartweb/core/contents/pages/cirkwi/view.py +2 -1
  33. imio/smartweb/core/contents/pages/configure.zcml +1 -0
  34. imio/smartweb/core/contents/pages/portal_page/view.py +3 -0
  35. imio/smartweb/core/contents/pages/views.py +47 -1
  36. imio/smartweb/core/contents/publication/__init__.py +0 -0
  37. imio/smartweb/core/contents/publication/configure.zcml +5 -0
  38. imio/smartweb/core/contents/publication/content.py +23 -0
  39. imio/smartweb/core/contents/rest/base.py +9 -7
  40. imio/smartweb/core/contents/rest/directory/endpoint.py +2 -2
  41. imio/smartweb/core/contents/rest/directory/view.pt +2 -1
  42. imio/smartweb/core/contents/rest/events/content.py +13 -0
  43. imio/smartweb/core/contents/rest/events/endpoint.py +5 -3
  44. imio/smartweb/core/contents/rest/events/view.pt +5 -1
  45. imio/smartweb/core/contents/rest/events/view.py +12 -0
  46. imio/smartweb/core/contents/rest/news/content.py +6 -0
  47. imio/smartweb/core/contents/rest/news/endpoint.py +4 -2
  48. imio/smartweb/core/contents/rest/news/view.pt +4 -1
  49. imio/smartweb/core/contents/rest/news/view.py +8 -0
  50. imio/smartweb/core/contents/rest/utils.py +0 -1
  51. imio/smartweb/core/contents/rest/view.py +4 -0
  52. imio/smartweb/core/contents/sections/common_templates/carousel.pt +5 -1
  53. imio/smartweb/core/contents/sections/common_templates/table.pt +18 -4
  54. imio/smartweb/core/contents/sections/configure.zcml +18 -0
  55. imio/smartweb/core/contents/sections/contact/content.py +2 -2
  56. imio/smartweb/core/contents/sections/contact/macros.pt +28 -3
  57. imio/smartweb/core/contents/sections/contact/utils.py +2 -0
  58. imio/smartweb/core/contents/sections/contact/view.py +28 -12
  59. imio/smartweb/core/contents/sections/events/content.py +12 -4
  60. imio/smartweb/core/contents/sections/events/view.py +20 -2
  61. imio/smartweb/core/contents/sections/external_content/view.pt +4 -4
  62. imio/smartweb/core/contents/sections/external_content/views.py +6 -4
  63. imio/smartweb/core/contents/sections/files/content.py +7 -1
  64. imio/smartweb/core/contents/sections/files/view.py +43 -12
  65. imio/smartweb/core/contents/sections/links/view.py +5 -0
  66. imio/smartweb/core/contents/sections/macros.pt +26 -0
  67. imio/smartweb/core/contents/sections/news/content.py +11 -3
  68. imio/smartweb/core/contents/sections/news/view.py +20 -2
  69. imio/smartweb/core/contents/sections/text/views.py +2 -0
  70. imio/smartweb/core/contents/sections/views.py +73 -10
  71. imio/smartweb/core/interfaces.py +4 -0
  72. imio/smartweb/core/profiles/default/metadata.xml +1 -1
  73. imio/smartweb/core/profiles/default/taxonomies/page_category.xml +16 -0
  74. imio/smartweb/core/profiles/default/taxonomies/procedure_category.xml +26 -0
  75. imio/smartweb/core/profiles/default/types/imio.smartweb.EventsView.xml +1 -0
  76. imio/smartweb/core/profiles/default/types/imio.smartweb.NewsView.xml +1 -0
  77. imio/smartweb/core/profiles/default/types/imio.smartweb.Publication.xml +38 -0
  78. imio/smartweb/core/profiles/default/types/imio.smartweb.SectionEvents.xml +1 -0
  79. imio/smartweb/core/profiles/default/types/imio.smartweb.SectionFiles.xml +2 -0
  80. imio/smartweb/core/profiles/default/types/imio.smartweb.SectionNews.xml +1 -0
  81. imio/smartweb/core/profiles/default/types.xml +1 -0
  82. imio/smartweb/core/profiles/icons/basic/registry.xml +120 -0
  83. imio/smartweb/core/rest/authentic_sources.py +17 -2
  84. imio/smartweb/core/subscribers.py +48 -0
  85. imio/smartweb/core/subscribers.zcml +12 -0
  86. imio/smartweb/core/tests/resources/json_iadeliberations_institutions.json +60 -0
  87. imio/smartweb/core/tests/resources/json_iadeliberations_publication.json +105 -0
  88. imio/smartweb/core/tests/resources/json_iadeliberations_publications.json +270 -0
  89. imio/smartweb/core/tests/resources/json_rest_events.json +6 -2
  90. imio/smartweb/core/tests/resources/json_rest_news.json +2 -2
  91. imio/smartweb/core/tests/resources/json_rest_specific_events.json +1 -1
  92. imio/smartweb/core/tests/test_htmx_in_sections.py +131 -0
  93. imio/smartweb/core/tests/test_iadeliberations.py +136 -0
  94. imio/smartweb/core/tests/test_icons.py +1 -1
  95. imio/smartweb/core/tests/test_rest.py +58 -17
  96. imio/smartweb/core/tests/test_section_contact.py +42 -10
  97. imio/smartweb/core/tests/test_section_events.py +28 -5
  98. imio/smartweb/core/tests/test_section_external_content.py +28 -2
  99. imio/smartweb/core/tests/test_section_news.py +30 -8
  100. imio/smartweb/core/tests/test_sections.py +17 -0
  101. imio/smartweb/core/tests/test_vocabularies.py +60 -3
  102. imio/smartweb/core/tests/test_vocabulary.py +43 -0
  103. imio/smartweb/core/upgrades/configure.zcml +108 -0
  104. imio/smartweb/core/upgrades/profiles/1055_to_1056/types/imio.smartweb.SectionFiles.xml +12 -0
  105. imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.EventsView.xml +11 -0
  106. imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.NewsView.xml +11 -0
  107. imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.SectionEvents.xml +11 -0
  108. imio/smartweb/core/upgrades/profiles/1056_to_1057/types/imio.smartweb.SectionNews.xml +11 -0
  109. imio/smartweb/core/upgrades/profiles/1057_to_1058/taxonomies/page_category.cfg +9 -0
  110. imio/smartweb/core/upgrades/profiles/1057_to_1058/taxonomies/page_category.xml +73 -0
  111. imio/smartweb/core/upgrades/profiles/1057_to_1058/taxonomies/procedure_category.cfg +9 -0
  112. imio/smartweb/core/upgrades/profiles/1057_to_1058/taxonomies/procedure_category.xml +118 -0
  113. imio/smartweb/core/upgrades/profiles/1058_to_1059/registry/linkedin-icon.xml +126 -0
  114. imio/smartweb/core/upgrades/profiles/1059_to_1060/registry/iadeliberation.xml +9 -0
  115. imio/smartweb/core/upgrades/profiles/1060_to_1061/types/imio.smartweb.Publication.xml +38 -0
  116. imio/smartweb/core/upgrades/profiles/1060_to_1061/types/imio.smartweb.SectionFiles.xml +11 -0
  117. imio/smartweb/core/upgrades/profiles/1060_to_1061/types.xml +4 -0
  118. imio/smartweb/core/upgrades/profiles/1060_to_1061/workflows.xml +6 -0
  119. imio/smartweb/core/utils.py +33 -2
  120. imio/smartweb/core/viewlets/configure.zcml +23 -1
  121. imio/smartweb/core/viewlets/footer.pt +5 -0
  122. imio/smartweb/core/viewlets/footer.py +5 -0
  123. imio/smartweb/core/viewlets/htmx.py +15 -0
  124. imio/smartweb/core/viewlets/htmx_js_header.pt +64 -0
  125. imio/smartweb/core/viewlets/ogptags.py +4 -3
  126. imio/smartweb/core/viewlets/social.py +23 -0
  127. imio/smartweb/core/vocabularies.py +65 -3
  128. imio/smartweb/core/vocabularies.zcml +18 -0
  129. imio/smartweb/core/webcomponents/build/1c1605a5fe9a2b10a88f.png +1 -0
  130. imio/smartweb/core/webcomponents/build/524db40e119aa11f4478.png +1 -0
  131. imio/smartweb/core/webcomponents/build/57d3b7cb1ab874660b39.svg +1 -0
  132. imio/smartweb/core/webcomponents/build/6cf03871df23ed2ee8b3.png +1 -0
  133. imio/smartweb/core/webcomponents/build/css/373.smartweb-webcomponents-compiled.css +1 -1
  134. imio/smartweb/core/webcomponents/build/css/486.smartweb-webcomponents-compiled.css +1 -1
  135. imio/smartweb/core/webcomponents/build/css/884.smartweb-webcomponents-compiled.css +1 -0
  136. imio/smartweb/core/webcomponents/build/css/919.smartweb-webcomponents-compiled.css +1 -1
  137. imio/smartweb/core/webcomponents/build/css/smartweb-webcomponents-compiled.css +1 -1
  138. imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js +1 -1
  139. imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js.LICENSE.txt +10 -8
  140. imio/smartweb/core/webcomponents/build/js/373.smartweb-webcomponents-compiled.js +2 -1
  141. imio/smartweb/core/webcomponents/build/js/{568.smartweb-webcomponents-compiled.js.LICENSE.txt → 373.smartweb-webcomponents-compiled.js.LICENSE.txt} +0 -4
  142. imio/smartweb/core/webcomponents/build/js/486.smartweb-webcomponents-compiled.js +1 -1
  143. imio/smartweb/core/webcomponents/build/js/499.smartweb-webcomponents-compiled.js +2 -0
  144. imio/smartweb/core/webcomponents/build/js/{674.smartweb-webcomponents-compiled.js.LICENSE.txt → 499.smartweb-webcomponents-compiled.js.LICENSE.txt} +1 -8
  145. imio/smartweb/core/webcomponents/build/js/799.smartweb-webcomponents-compiled.js +1 -1
  146. imio/smartweb/core/webcomponents/build/js/824.smartweb-webcomponents-compiled.js +2 -0
  147. imio/smartweb/core/webcomponents/build/js/828.smartweb-webcomponents-compiled.js +2 -0
  148. imio/smartweb/core/webcomponents/build/js/828.smartweb-webcomponents-compiled.js.LICENSE.txt +32 -0
  149. imio/smartweb/core/webcomponents/build/js/884.smartweb-webcomponents-compiled.js +1 -0
  150. imio/smartweb/core/webcomponents/build/js/919.smartweb-webcomponents-compiled.js +1 -1
  151. imio/smartweb/core/webcomponents/build/js/{568.smartweb-webcomponents-compiled.js → 963.smartweb-webcomponents-compiled.js} +2 -2
  152. imio/smartweb/core/webcomponents/build/js/963.smartweb-webcomponents-compiled.js.LICENSE.txt +3 -0
  153. imio/smartweb/core/webcomponents/build/js/smartweb-webcomponents-compiled.js +1 -1
  154. imio/smartweb/core/webcomponents/build/js/smartweb-webcomponents-compiled.js.LICENSE.txt +11 -14
  155. imio/smartweb/core/webcomponents/package.json +42 -40
  156. imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.jsx +146 -79
  157. imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.scss +415 -351
  158. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactCard/ContactCard.jsx +95 -62
  159. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/ContactContent.jsx +328 -168
  160. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactList/ContactList.jsx +21 -4
  161. imio/smartweb/core/webcomponents/src/components/Annuaire/Filters/Filter.jsx +213 -100
  162. imio/smartweb/core/webcomponents/src/components/Annuaire/index.js +1 -1
  163. imio/smartweb/core/webcomponents/src/components/Events/EventCard/EventCard.jsx +76 -33
  164. imio/smartweb/core/webcomponents/src/components/Events/EventContent/EventContent.jsx +604 -377
  165. imio/smartweb/core/webcomponents/src/components/Events/EventList/EventList.jsx +29 -4
  166. imio/smartweb/core/webcomponents/src/components/Events/Events.jsx +162 -88
  167. imio/smartweb/core/webcomponents/src/components/Events/Events.scss +496 -378
  168. imio/smartweb/core/webcomponents/src/components/Events/Filters/Filter.jsx +259 -91
  169. imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.jsx +62 -55
  170. imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.scss +68 -17
  171. imio/smartweb/core/webcomponents/src/components/Filters/IamData.jsx +42 -0
  172. imio/smartweb/core/webcomponents/src/components/Filters/MainFilter.scss +229 -0
  173. imio/smartweb/core/webcomponents/src/components/Filters/PublicTargetData.jsx +94 -0
  174. imio/smartweb/core/webcomponents/src/components/Filters/SelectStyles.js +58 -0
  175. imio/smartweb/core/webcomponents/src/components/Filters/TaxonomyFilter.jsx +149 -0
  176. imio/smartweb/core/webcomponents/src/components/Filters/TaxonomyFilter.scss +70 -0
  177. imio/smartweb/core/webcomponents/src/components/News/Filters/Filter.jsx +139 -83
  178. imio/smartweb/core/webcomponents/src/components/News/News.jsx +133 -67
  179. imio/smartweb/core/webcomponents/src/components/News/News.scss +170 -127
  180. imio/smartweb/core/webcomponents/src/components/News/NewsCard/NewsCard.jsx +76 -44
  181. imio/smartweb/core/webcomponents/src/components/News/NewsContent/NewsContent.jsx +261 -188
  182. imio/smartweb/core/webcomponents/src/components/News/NewsList/NewsList.jsx +48 -9
  183. imio/smartweb/core/webcomponents/src/components/Search/ContactResult/ContactResult.jsx +21 -10
  184. imio/smartweb/core/webcomponents/src/components/Search/EventsResult/EventsResult.jsx +21 -10
  185. imio/smartweb/core/webcomponents/src/components/Search/Filters/Filter.jsx +8 -9
  186. imio/smartweb/core/webcomponents/src/components/Search/NewsResult/NewsResult.jsx +23 -12
  187. imio/smartweb/core/webcomponents/src/components/Search/Search.jsx +7 -6
  188. imio/smartweb/core/webcomponents/src/components/Search/Search.scss +115 -96
  189. imio/smartweb/core/webcomponents/src/components/Search/WebResult/WebResult.jsx +12 -3
  190. imio/smartweb/core/webcomponents/src/components/Search/index.js +1 -1
  191. imio/smartweb/core/webcomponents/src/hooks/ScrollContext.jsx +3 -0
  192. imio/smartweb/core/webcomponents/src/hooks/useAxios.js +3 -3
  193. imio/smartweb/core/webcomponents/src/hooks/useFilterQuery.js +1 -2
  194. imio/smartweb/core/webcomponents/src/index.scss +255 -211
  195. imio/smartweb/core/webcomponents/src/utils/Map.jsx +26 -19
  196. imio/smartweb/core/webcomponents/src/utils/Map.scss +2 -2
  197. imio/smartweb/core/webcomponents/src/utils/translation.js +129 -9
  198. imio.smartweb.core-1.2.79-py3.8-nspkg.pth +2 -0
  199. {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.79.dist-info}/METADATA +403 -10
  200. {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.79.dist-info}/RECORD +206 -160
  201. {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.79.dist-info}/WHEEL +1 -1
  202. imio/smartweb/core/webcomponents/build/assets/location-bla.1423bcce16ddcb21141430cac1428dc1.svg +0 -1
  203. imio/smartweb/core/webcomponents/build/assets/next-react-white.819cb069ac8eec300a9db6a7707712d6.svg +0 -1
  204. imio/smartweb/core/webcomponents/build/assets/next-react.17bc43ff4a6a86f4520f5782f6a89a72.svg +0 -1
  205. imio/smartweb/core/webcomponents/build/assets/search.57bdbf5b191499cd77514097d1c4972c.svg +0 -1
  206. imio/smartweb/core/webcomponents/build/css/686.smartweb-webcomponents-compiled.css +0 -1
  207. imio/smartweb/core/webcomponents/build/js/209.smartweb-webcomponents-compiled.js +0 -2
  208. imio/smartweb/core/webcomponents/build/js/40.smartweb-webcomponents-compiled.js +0 -1
  209. imio/smartweb/core/webcomponents/build/js/674.smartweb-webcomponents-compiled.js +0 -2
  210. imio/smartweb/core/webcomponents/build/js/686.smartweb-webcomponents-compiled.js +0 -1
  211. imio/smartweb/core/webcomponents/src/assets/facebook-news.svg +0 -1
  212. imio/smartweb/core/webcomponents/src/assets/location-bla.svg +0 -1
  213. imio/smartweb/core/webcomponents/src/assets/next-react.svg +0 -1
  214. imio/smartweb/core/webcomponents/src/assets/search.svg +0 -1
  215. imio/smartweb/core/webcomponents/src/assets/skeleton.svg +0 -1
  216. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/download.svg +0 -1
  217. imio.smartweb.core-1.2.38-py3.8-nspkg.pth +0 -3
  218. /imio/smartweb/core/webcomponents/build/js/{209.smartweb-webcomponents-compiled.js.LICENSE.txt → 824.smartweb-webcomponents-compiled.js.LICENSE.txt} +0 -0
  219. {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.79.dist-info}/LICENSE.GPL +0 -0
  220. {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.79.dist-info}/LICENSE.rst +0 -0
  221. {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.79.dist-info}/namespace_packages.txt +0 -0
  222. {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.79.dist-info}/top_level.txt +0 -0
@@ -1,21 +1,22 @@
1
- import { useHistory } from "react-router-dom";
1
+ import { useNavigate } from "react-router-dom";
2
2
  import React, { useEffect, useState } from "react";
3
3
  import useAxios from "../../../hooks/useAxios";
4
4
  import useFilterQuery from "../../../hooks/useFilterQuery";
5
5
  import moment from "moment";
6
6
  import Moment from "react-moment";
7
- import ReactMarkdown from 'react-markdown'
7
+ import ReactMarkdown from "react-markdown";
8
8
  import Spotlight from "spotlight.js";
9
9
  import "../../../../node_modules/flexbin/flexbin.css";
10
10
  import { Translate } from "react-translated";
11
- const ContactContent = ({ queryUrl, onChange }) => {
12
- let history = useHistory();
13
- const queryString = require("query-string");
11
+ import queryString from "query-string";
12
+
13
+ const ContactContent = ({ queryUrl, onChange, contextAuthenticatedUser }) => {
14
+ let navigate = useNavigate();
14
15
  const parsed = queryString.parse(useFilterQuery().toString());
15
16
  const parsed2 = { ...parsed, UID: parsed["u"], fullobjects: 1 };
16
17
  const [params, setParams] = useState(parsed2);
17
18
  const [item, setitem] = useState({});
18
- const [files, setFiles] = useState();
19
+ const [files, setFiles] = useState(null);
19
20
  const [gallery, setGallery] = useState();
20
21
  const { response, error, isLoading } = useAxios(
21
22
  {
@@ -33,35 +34,81 @@ const ContactContent = ({ queryUrl, onChange }) => {
33
34
  if (response !== null) {
34
35
  setitem(response.items[0]);
35
36
  }
36
- window.scrollTo(0, 0);
37
+ window.scrollTo({
38
+ top: 0,
39
+ left: 0,
40
+ behavior: "instant",
41
+ });
37
42
  }, [response]);
38
43
 
39
- /// use to set file and gallery items
40
- useEffect(() => {
44
+ /// use to set file and gallery items
45
+ useEffect(() => {
41
46
  if (item.items && item.items.length > 0) {
42
- setFiles(item.items.filter(files => files['@type'] === 'File'));
43
- setGallery(item.items.filter(files => files['@type'] === 'Image'));
47
+ setFiles(item.items.filter((files) => files["@type"] === "File"));
48
+ setGallery(item.items.filter((files) => files["@type"] === "Image"));
44
49
  }
45
50
  }, [item]);
46
51
 
47
52
  function handleClick() {
48
- history.push("./");
53
+ navigate("..");
49
54
  onChange(null);
50
55
  }
51
- moment.locale('fr')
52
- const created = moment(item.created).startOf('minute').fromNow();
53
- const lastModified = moment(item.modified).startOf('minute').fromNow();
56
+
57
+ // Function to generate iframe URL
58
+ const getIframeSrc = (url) => {
59
+ console.log(item.video_url);
60
+ if (url.includes("youtube.com") || url.includes("youtu.be")) {
61
+ const urlParams = new URLSearchParams(new URL(url).search);
62
+ const videoId = urlParams.get("v") || url.split("/").pop();
63
+ return `https://www.youtube.com/embed/${videoId}`;
64
+ } else if (url.includes("vimeo.com")) {
65
+ const videoId = url.split("/").pop();
66
+ return `https://player.vimeo.com/video/${videoId}`;
67
+ }
68
+ return null;
69
+ };
70
+
71
+ moment.locale("fr");
72
+ const created = moment(item.created).startOf("minute").fromNow();
73
+ const lastModified = moment(item.modified).startOf("minute").fromNow();
54
74
  return (
55
75
  <div className="new-content r-content">
56
76
  <button type="button" onClick={handleClick}>
57
- <Translate text="Retour" />
77
+ <Translate text="Retour" />
58
78
  </button>
79
+
80
+ {contextAuthenticatedUser === "False" ? (
81
+ <a
82
+ href={item["@id"]}
83
+ target="_blank"
84
+ title="Editer la fiche"
85
+ className="edit-rest-elements edit-rest-elements-content"
86
+ >
87
+ <svg
88
+ xmlns="http://www.w3.org/2000/svg"
89
+ width="16"
90
+ height="16"
91
+ fill="currentColor"
92
+ class="bi bi-pencil-square"
93
+ viewBox="0 0 16 16"
94
+ >
95
+ <path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z" />
96
+ <path
97
+ fill-rule="evenodd"
98
+ d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5z"
99
+ />
100
+ </svg>
101
+ </a>
102
+ ) : (
103
+ ""
104
+ )}
105
+
59
106
  <article>
60
107
  <header>
61
108
  <h2 className="r-content-title">{item.title}</h2>
62
109
  <div className="r-content-description">
63
- <ReactMarkdown>{item.description}</ReactMarkdown>
64
- </div>
110
+ <ReactMarkdown>{item.description}</ReactMarkdown>
111
+ </div>
65
112
  </header>
66
113
  <figure>
67
114
  <div
@@ -74,182 +121,208 @@ const ContactContent = ({ queryUrl, onChange }) => {
74
121
  />
75
122
  </figure>
76
123
  <div className="r-content-news-info">
77
- <div className="r-content-news-info-container">
78
- {/* date */}
79
- <div className="r-content-news-info-schedul">
80
- <div className="icon-baseline">
81
- <svg
82
- xmlns="http://www.w3.org/2000/svg"
83
- preserveAspectRatio="xMinYMin"
84
- viewBox="0 0 19.41 19.41"
85
- >
86
- <path d="M16.09,2.74H14.35V.85a.44.44,0,0,0-.43-.44H12.47A.44.44,0,0,0,12,.85V2.74H7.38V.85A.44.44,0,0,0,7,.41H5.5a.44.44,0,0,0-.44.44V2.74H3.32A1.74,1.74,0,0,0,1.58,4.48V17.26A1.74,1.74,0,0,0,3.32,19H16.09a1.74,1.74,0,0,0,1.75-1.74V4.48A1.74,1.74,0,0,0,16.09,2.74Zm-.21,14.52H3.54A.22.22,0,0,1,3.32,17h0V6.22H16.09V17a.21.21,0,0,1-.21.22Z" />
87
- </svg>
88
- </div>
89
- <div className="dpinlb">
90
- <div className="r-content-news-info--date">
91
- <div className="r-content-date">
92
- {
93
- created === lastModified ?
94
- (
95
- <div className="r-content-date-publish">
96
- <span>Publié {created}</span>
97
- </div>
98
- ):
99
- (
100
- <div>
101
- <div className="r-content-date-publish">
102
- <span>Publié {created}</span>
103
- </div>
104
- <div className="r-card-date-last">
105
- <span>Actualisé {lastModified} </span>
106
- </div>
107
- </div>
108
- )
109
- }
124
+ <div className="r-content-news-info-container">
125
+ {/* date */}
126
+ <div className="r-content-news-info-schedul">
127
+ <div className="icon-baseline">
128
+ <svg
129
+ xmlns="http://www.w3.org/2000/svg"
130
+ preserveAspectRatio="xMinYMin"
131
+ viewBox="0 0 19.41 19.41"
132
+ >
133
+ <path d="M16.09,2.74H14.35V.85a.44.44,0,0,0-.43-.44H12.47A.44.44,0,0,0,12,.85V2.74H7.38V.85A.44.44,0,0,0,7,.41H5.5a.44.44,0,0,0-.44.44V2.74H3.32A1.74,1.74,0,0,0,1.58,4.48V17.26A1.74,1.74,0,0,0,3.32,19H16.09a1.74,1.74,0,0,0,1.75-1.74V4.48A1.74,1.74,0,0,0,16.09,2.74Zm-.21,14.52H3.54A.22.22,0,0,1,3.32,17h0V6.22H16.09V17a.21.21,0,0,1-.21.22Z" />
134
+ </svg>
135
+ </div>
136
+ <div className="dpinlb">
137
+ <div className="r-content-news-info--date">
138
+ <div className="r-content-date">
139
+ {created === lastModified ? (
140
+ <div className="r-content-date-publish">
141
+ <span>
142
+ <Translate text="Publié" /> {created}
143
+ </span>
144
+ </div>
145
+ ) : (
146
+ <div>
147
+ <div className="r-content-date-publish">
148
+ <span>
149
+ <Translate text="Publié" /> {created}
150
+ </span>
151
+ </div>
152
+ <div className="r-card-date-last">
153
+ <span>
154
+ <Translate text="Actualisé" />{" "}
155
+ {lastModified}{" "}
156
+ </span>
157
+ </div>
158
+ </div>
159
+ )}
160
+ </div>
161
+ </div>
162
+ </div>
163
+ </div>
164
+ {/* link */}
165
+ {item.site_url ? (
166
+ <div className="r-content-news-info-link">
167
+ <div className="icon-baseline">
168
+ <svg
169
+ xmlns="http://www.w3.org/2000/svg"
170
+ viewBox="0 0 19.41 19.41"
171
+ >
172
+ <path d="M16.36,2.22H3.06a1.3,1.3,0,0,0-1.3,1.3h0v9a1.3,1.3,0,0,0,1.3,1.3H7.52v1.74h-.7a.8.8,0,0,0,0,1.6h5.79a.8.8,0,0,0,0-1.6h-.7V13.85h4.45a1.31,1.31,0,0,0,1.3-1.3v-9A1.3,1.3,0,0,0,16.36,2.22Zm-1.9,10.83a.37.37,0,1,1,.36-.37h0a.36.36,0,0,1-.36.36Zm1.6.08a.45.45,0,1,1,.44-.45h0a.44.44,0,0,1-.44.45h0Zm.53-1.35H2.82V3.52a.23.23,0,0,1,.23-.23H16.36a.23.23,0,0,1,.23.23h0v8.27Z" />
173
+ </svg>
174
+ </div>
175
+ <div className="dpinlb">
176
+ {item.site_url === null ? (
177
+ ""
178
+ ) : (
179
+ <div className="r-content-news-info-event_link">
180
+ <a href={item.site_url}>{item.site_url}</a>
181
+ </div>
182
+ )}
183
+ </div>
110
184
  </div>
111
- </div>
112
- </div>
113
- </div>
114
- {/* link */}
115
- {item.site_url === null &&
116
- item.video_url === null ? (
117
- ""
118
- ) : (
119
- <div className="r-content-news-info-link">
120
- <div className="icon-baseline">
121
- <svg
122
- xmlns="http://www.w3.org/2000/svg"
123
- viewBox="0 0 19.41 19.41"
124
- >
125
- <path d="M16.36,2.22H3.06a1.3,1.3,0,0,0-1.3,1.3h0v9a1.3,1.3,0,0,0,1.3,1.3H7.52v1.74h-.7a.8.8,0,0,0,0,1.6h5.79a.8.8,0,0,0,0-1.6h-.7V13.85h4.45a1.31,1.31,0,0,0,1.3-1.3v-9A1.3,1.3,0,0,0,16.36,2.22Zm-1.9,10.83a.37.37,0,1,1,.36-.37h0a.36.36,0,0,1-.36.36Zm1.6.08a.45.45,0,1,1,.44-.45h0a.44.44,0,0,1-.44.45h0Zm.53-1.35H2.82V3.52a.23.23,0,0,1,.23-.23H16.36a.23.23,0,0,1,.23.23h0v8.27Z" />
126
- </svg>
127
- </div>
128
- <div className="dpinlb">
129
- {item.site_url === null ? (
130
- ""
131
- ) : (
132
- <div className="r-content-news-info-event_link">
133
- <a href={item.site_url}>{item.site_url}</a>
134
- </div>
135
- )}
136
- {item.video_url === null ? (
137
- ""
138
- ) : (
139
- <div className="r-content-news-info--video">
140
- <a href={item.video_url}>Lien vers la vidéo</a>
141
- </div>
142
- )}
143
- </div>
144
- </div>
145
- )}
146
- {/* Social */}
147
- {item.facebook === null &&
148
- item.instagram === null &&
149
- item.twitter === null ? (
150
- ""
151
- ) : (
152
- <div className="r-content-news-info-social">
153
- <ul>
154
- {!item.facebook ? (
155
- ""
156
- ) : (
157
- <li>
158
- <a href={item.facebook} target="_blank">
159
- <svg
160
- xmlns="http://www.w3.org/2000/svg"
161
- height="800"
162
- width="1200"
163
- viewBox="-204.79995 -341.33325 1774.9329 2047.9995"
164
- >
165
- <path
166
- d="M1365.333 682.667C1365.333 305.64 1059.693 0 682.667 0 305.64 0 0 305.64 0 682.667c0 340.738 249.641 623.16 576 674.373V880H402.667V682.667H576v-150.4c0-171.094 101.917-265.6 257.853-265.6 74.69 0 152.814 13.333 152.814 13.333v168h-86.083c-84.804 0-111.25 52.623-111.25 106.61v128.057h189.333L948.4 880H789.333v477.04c326.359-51.213 576-333.635 576-674.373"
167
- fill="#100f0d"
168
- />
169
- <path
170
- d="M948.4 880l30.267-197.333H789.333V554.609C789.333 500.623 815.78 448 900.584 448h86.083V280s-78.124-13.333-152.814-13.333c-155.936 0-257.853 94.506-257.853 265.6v150.4H402.667V880H576v477.04a687.805 687.805 0 00106.667 8.293c36.288 0 71.91-2.84 106.666-8.293V880H948.4"
171
- fill="#fff"
172
- />
173
- </svg>
174
- </a>
175
- </li>
176
- )}
177
- {!item.instagram ? (
178
- ""
179
- ) : (
180
- <li>
181
- <a href={item.instagram} target="_blank">
182
- <svg
183
- xmlns="http://www.w3.org/2000/svg"
184
- height="800"
185
- width="1200"
186
- viewBox="-100.7682 -167.947 873.3244 1007.682"
187
- >
188
- <g fill="#100f0d">
189
- <path d="M335.895 0c-91.224 0-102.663.387-138.49 2.021-35.752 1.631-60.169 7.31-81.535 15.612-22.088 8.584-40.82 20.07-59.493 38.743-18.674 18.673-30.16 37.407-38.743 59.495C9.33 137.236 3.653 161.653 2.02 197.405.386 233.232 0 244.671 0 335.895c0 91.222.386 102.661 2.02 138.488 1.633 35.752 7.31 60.169 15.614 81.534 8.584 22.088 20.07 40.82 38.743 59.495 18.674 18.673 37.405 30.159 59.493 38.743 21.366 8.302 45.783 13.98 81.535 15.612 35.827 1.634 47.266 2.021 138.49 2.021 91.222 0 102.661-.387 138.488-2.021 35.752-1.631 60.169-7.31 81.534-15.612 22.088-8.584 40.82-20.07 59.495-38.743 18.673-18.675 30.159-37.407 38.743-59.495 8.302-21.365 13.981-45.782 15.612-81.534 1.634-35.827 2.021-47.266 2.021-138.488 0-91.224-.387-102.663-2.021-138.49-1.631-35.752-7.31-60.169-15.612-81.534-8.584-22.088-20.07-40.822-38.743-59.495-18.675-18.673-37.407-30.159-59.495-38.743-21.365-8.302-45.782-13.981-81.534-15.612C438.556.387 427.117 0 335.895 0zm0 60.521c89.686 0 100.31.343 135.729 1.959 32.75 1.493 50.535 6.965 62.37 11.565 15.68 6.094 26.869 13.372 38.622 25.126 11.755 11.754 19.033 22.944 25.127 38.622 4.6 11.836 10.072 29.622 11.565 62.371 1.616 35.419 1.959 46.043 1.959 135.73 0 89.687-.343 100.311-1.959 135.73-1.493 32.75-6.965 50.535-11.565 62.37-6.094 15.68-13.372 26.869-25.127 38.622-11.753 11.755-22.943 19.033-38.621 25.127-11.836 4.6-29.622 10.072-62.371 11.565-35.413 1.616-46.036 1.959-135.73 1.959-89.694 0-100.315-.343-135.73-1.96-32.75-1.492-50.535-6.964-62.37-11.564-15.68-6.094-26.869-13.372-38.622-25.127-11.754-11.753-19.033-22.943-25.127-38.621-4.6-11.836-10.071-29.622-11.565-62.371-1.616-35.419-1.959-46.043-1.959-135.73 0-89.687.343-100.311 1.959-135.73 1.494-32.75 6.965-50.535 11.565-62.37 6.094-15.68 13.373-26.869 25.126-38.622 11.754-11.755 22.944-19.033 38.622-25.127 11.836-4.6 29.622-10.072 62.371-11.565 35.419-1.616 46.043-1.959 135.73-1.959" />
190
- <path d="M335.895 447.859c-61.838 0-111.966-50.128-111.966-111.964 0-61.838 50.128-111.966 111.966-111.966 61.836 0 111.964 50.128 111.964 111.966 0 61.836-50.128 111.964-111.964 111.964zm0-284.451c-95.263 0-172.487 77.224-172.487 172.487 0 95.261 77.224 172.485 172.487 172.485 95.261 0 172.485-77.224 172.485-172.485 0-95.263-77.224-172.487-172.485-172.487m219.608-6.815c0 22.262-18.047 40.307-40.308 40.307-22.26 0-40.307-18.045-40.307-40.307 0-22.261 18.047-40.308 40.307-40.308 22.261 0 40.308 18.047 40.308 40.308" />
191
- </g>
192
- </svg>
193
- </a>
194
- </li>
195
- )}
196
- {!item.twitter ? (
197
- ""
198
- ) : (
199
- <li>
200
- <a href={item.twitter} target="_blank">
201
- <svg
202
- xmlns="http://www.w3.org/2000/svg"
203
- height="800"
204
- width="1200"
205
- viewBox="-44.7006 -60.54775 387.4052 363.2865"
206
- >
207
- <path
208
- fill="#000"
209
- d="M93.719 242.19c112.46 0 173.96-93.168 173.96-173.96 0-2.646-.054-5.28-.173-7.903a124.338 124.338 0 0030.498-31.66c-10.955 4.87-22.744 8.148-35.11 9.626 12.622-7.57 22.313-19.543 26.885-33.817a122.62 122.62 0 01-38.824 14.841C239.798 7.433 223.915 0 206.326 0c-33.764 0-61.144 27.381-61.144 61.132 0 4.798.537 9.465 1.586 13.941-50.815-2.557-95.874-26.886-126.03-63.88a60.977 60.977 0 00-8.279 30.73c0 21.212 10.794 39.938 27.208 50.893a60.685 60.685 0 01-27.69-7.647c-.009.257-.009.507-.009.781 0 29.61 21.075 54.332 49.051 59.934a61.218 61.218 0 01-16.122 2.152 60.84 60.84 0 01-11.491-1.103c7.784 24.293 30.355 41.971 57.115 42.465-20.926 16.402-47.287 26.171-75.937 26.171-4.929 0-9.798-.28-14.584-.846 27.059 17.344 59.189 27.464 93.722 27.464"
210
- />
211
- </svg>
212
- </a>
213
- </li>
214
- )}
215
- </ul>
216
- </div>
217
- )}
218
- </div>
219
- </div>
185
+ ) : (
186
+ ""
187
+ )}
188
+ {/* Social */}
189
+ {item.facebook === null &&
190
+ item.instagram === null &&
191
+ item.twitter === null ? (
192
+ ""
193
+ ) : (
194
+ <div className="r-content-news-info-social">
195
+ <ul>
196
+ {!item.facebook ? (
197
+ ""
198
+ ) : (
199
+ <li>
200
+ <a href={item.facebook} target="_blank">
201
+ <svg
202
+ xmlns="http://www.w3.org/2000/svg"
203
+ height="800"
204
+ width="1200"
205
+ viewBox="-204.79995 -341.33325 1774.9329 2047.9995"
206
+ >
207
+ <path
208
+ d="M1365.333 682.667C1365.333 305.64 1059.693 0 682.667 0 305.64 0 0 305.64 0 682.667c0 340.738 249.641 623.16 576 674.373V880H402.667V682.667H576v-150.4c0-171.094 101.917-265.6 257.853-265.6 74.69 0 152.814 13.333 152.814 13.333v168h-86.083c-84.804 0-111.25 52.623-111.25 106.61v128.057h189.333L948.4 880H789.333v477.04c326.359-51.213 576-333.635 576-674.373"
209
+ fill="#100f0d"
210
+ />
211
+ <path
212
+ d="M948.4 880l30.267-197.333H789.333V554.609C789.333 500.623 815.78 448 900.584 448h86.083V280s-78.124-13.333-152.814-13.333c-155.936 0-257.853 94.506-257.853 265.6v150.4H402.667V880H576v477.04a687.805 687.805 0 00106.667 8.293c36.288 0 71.91-2.84 106.666-8.293V880H948.4"
213
+ fill="#fff"
214
+ />
215
+ </svg>
216
+ </a>
217
+ </li>
218
+ )}
219
+ {!item.instagram ? (
220
+ ""
221
+ ) : (
222
+ <li>
223
+ <a href={item.instagram} target="_blank">
224
+ <svg
225
+ xmlns="http://www.w3.org/2000/svg"
226
+ height="800"
227
+ width="1200"
228
+ viewBox="-100.7682 -167.947 873.3244 1007.682"
229
+ >
230
+ <g fill="#100f0d">
231
+ <path d="M335.895 0c-91.224 0-102.663.387-138.49 2.021-35.752 1.631-60.169 7.31-81.535 15.612-22.088 8.584-40.82 20.07-59.493 38.743-18.674 18.673-30.16 37.407-38.743 59.495C9.33 137.236 3.653 161.653 2.02 197.405.386 233.232 0 244.671 0 335.895c0 91.222.386 102.661 2.02 138.488 1.633 35.752 7.31 60.169 15.614 81.534 8.584 22.088 20.07 40.82 38.743 59.495 18.674 18.673 37.405 30.159 59.493 38.743 21.366 8.302 45.783 13.98 81.535 15.612 35.827 1.634 47.266 2.021 138.49 2.021 91.222 0 102.661-.387 138.488-2.021 35.752-1.631 60.169-7.31 81.534-15.612 22.088-8.584 40.82-20.07 59.495-38.743 18.673-18.675 30.159-37.407 38.743-59.495 8.302-21.365 13.981-45.782 15.612-81.534 1.634-35.827 2.021-47.266 2.021-138.488 0-91.224-.387-102.663-2.021-138.49-1.631-35.752-7.31-60.169-15.612-81.534-8.584-22.088-20.07-40.822-38.743-59.495-18.675-18.673-37.407-30.159-59.495-38.743-21.365-8.302-45.782-13.981-81.534-15.612C438.556.387 427.117 0 335.895 0zm0 60.521c89.686 0 100.31.343 135.729 1.959 32.75 1.493 50.535 6.965 62.37 11.565 15.68 6.094 26.869 13.372 38.622 25.126 11.755 11.754 19.033 22.944 25.127 38.622 4.6 11.836 10.072 29.622 11.565 62.371 1.616 35.419 1.959 46.043 1.959 135.73 0 89.687-.343 100.311-1.959 135.73-1.493 32.75-6.965 50.535-11.565 62.37-6.094 15.68-13.372 26.869-25.127 38.622-11.753 11.755-22.943 19.033-38.621 25.127-11.836 4.6-29.622 10.072-62.371 11.565-35.413 1.616-46.036 1.959-135.73 1.959-89.694 0-100.315-.343-135.73-1.96-32.75-1.492-50.535-6.964-62.37-11.564-15.68-6.094-26.869-13.372-38.622-25.127-11.754-11.753-19.033-22.943-25.127-38.621-4.6-11.836-10.071-29.622-11.565-62.371-1.616-35.419-1.959-46.043-1.959-135.73 0-89.687.343-100.311 1.959-135.73 1.494-32.75 6.965-50.535 11.565-62.37 6.094-15.68 13.373-26.869 25.126-38.622 11.754-11.755 22.944-19.033 38.622-25.127 11.836-4.6 29.622-10.072 62.371-11.565 35.419-1.616 46.043-1.959 135.73-1.959" />
232
+ <path d="M335.895 447.859c-61.838 0-111.966-50.128-111.966-111.964 0-61.838 50.128-111.966 111.966-111.966 61.836 0 111.964 50.128 111.964 111.966 0 61.836-50.128 111.964-111.964 111.964zm0-284.451c-95.263 0-172.487 77.224-172.487 172.487 0 95.261 77.224 172.485 172.487 172.485 95.261 0 172.485-77.224 172.485-172.485 0-95.263-77.224-172.487-172.485-172.487m219.608-6.815c0 22.262-18.047 40.307-40.308 40.307-22.26 0-40.307-18.045-40.307-40.307 0-22.261 18.047-40.308 40.307-40.308 22.261 0 40.308 18.047 40.308 40.308" />
233
+ </g>
234
+ </svg>
235
+ </a>
236
+ </li>
237
+ )}
238
+ {!item.twitter ? (
239
+ ""
240
+ ) : (
241
+ <li>
242
+ <a href={item.twitter} target="_blank">
243
+ <svg
244
+ xmlns="http://www.w3.org/2000/svg"
245
+ height="800"
246
+ width="1200"
247
+ viewBox="-44.7006 -60.54775 387.4052 363.2865"
248
+ >
249
+ <path
250
+ fill="#000"
251
+ d="M93.719 242.19c112.46 0 173.96-93.168 173.96-173.96 0-2.646-.054-5.28-.173-7.903a124.338 124.338 0 0030.498-31.66c-10.955 4.87-22.744 8.148-35.11 9.626 12.622-7.57 22.313-19.543 26.885-33.817a122.62 122.62 0 01-38.824 14.841C239.798 7.433 223.915 0 206.326 0c-33.764 0-61.144 27.381-61.144 61.132 0 4.798.537 9.465 1.586 13.941-50.815-2.557-95.874-26.886-126.03-63.88a60.977 60.977 0 00-8.279 30.73c0 21.212 10.794 39.938 27.208 50.893a60.685 60.685 0 01-27.69-7.647c-.009.257-.009.507-.009.781 0 29.61 21.075 54.332 49.051 59.934a61.218 61.218 0 01-16.122 2.152 60.84 60.84 0 01-11.491-1.103c7.784 24.293 30.355 41.971 57.115 42.465-20.926 16.402-47.287 26.171-75.937 26.171-4.929 0-9.798-.28-14.584-.846 27.059 17.344 59.189 27.464 93.722 27.464"
252
+ />
253
+ </svg>
254
+ </a>
255
+ </li>
256
+ )}
257
+ </ul>
258
+ </div>
259
+ )}
260
+ </div>
261
+ </div>
220
262
  <div
221
263
  className="r-content-text"
222
264
  dangerouslySetInnerHTML={{
223
265
  __html: item.text && item.text.data,
224
266
  }}
225
- ></div>
226
- {/* add files to download */}
227
- {
228
- files &&
229
- <div className="r-content-files">
230
- {files.map((file, i) => (
231
- <div className="r-content-file">
232
- <a key={i} href={file.targetUrl} className="r-content-file-link" rel="nofollow">
233
- <span className="r-content-file-title">{file.title}</span>
234
- <span className="r-content-file-icon"><svg width="21" height="21" viewBox="0 0 24 24" fill="none" stroke="#8899a4" stroke-width="2" stroke-linecap="square" stroke-linejoin="arcs"><path d="M3 15v4c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2v-4M17 9l-5 5-5-5M12 12.8V2.5"></path></svg> </span>
235
- </a>
236
- </div>
237
- ))}
238
- </div>
239
- }
240
- {/* add gallery */}
241
- {
242
- gallery &&
243
- <div className="r-content-gallery">
244
- <div class="spotlight-group flexbin r-content-gallery">
245
- {gallery.map((image,i) => (
246
- <a key={i} class="spotlight" href={image.image_full_scale} >
247
- <img src={image.image_preview_scale} alt="" />
248
- </a>
249
- ))}
250
- </div>
251
- </div>
252
- }
267
+ >
268
+ {/* add files to download */}
269
+ </div>
270
+ {item.video_url ? (
271
+ <div className="r-content-news-info--video">
272
+ <iframe
273
+ src={getIframeSrc(item.video_url)}
274
+ width="100%"
275
+ height="100%"
276
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
277
+ allowFullScreen
278
+ ></iframe>
279
+ </div>
280
+ ) : (
281
+ ""
282
+ )}
283
+ {/* add files to download */}
284
+ {files && (
285
+ <div className="r-content-files">
286
+ {files.map((file, i) => (
287
+ <div className="r-content-file">
288
+ <a
289
+ key={i}
290
+ href={file.targetUrl}
291
+ className="r-content-file-link"
292
+ rel="nofollow"
293
+ >
294
+ <span className="r-content-file-title">{file.title}</span>
295
+ <span className="r-content-file-icon">
296
+ <svg
297
+ width="21"
298
+ height="21"
299
+ viewBox="0 0 24 24"
300
+ fill="none"
301
+ stroke="#8899a4"
302
+ stroke-width="2"
303
+ stroke-linecap="square"
304
+ stroke-linejoin="arcs"
305
+ >
306
+ <path d="M3 15v4c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2v-4M17 9l-5 5-5-5M12 12.8V2.5"></path>
307
+ </svg>{" "}
308
+ </span>
309
+ </a>
310
+ </div>
311
+ ))}
312
+ </div>
313
+ )}
314
+ {/* add gallery */}
315
+ {gallery && (
316
+ <div className="r-content-gallery">
317
+ <div className="spotlight-group flexbin r-content-gallery">
318
+ {gallery.map((image, i) => (
319
+ <a key={i} className="spotlight" href={image.image_full_scale}>
320
+ <img src={image.image_preview_scale} alt="" />
321
+ </a>
322
+ ))}
323
+ </div>
324
+ </div>
325
+ )}
253
326
  </article>
254
327
  </div>
255
328
  );
@@ -1,32 +1,71 @@
1
+ import React, { useEffect, useContext } from "react";
1
2
  import NewsCard from "../NewsCard/NewsCard";
2
3
  import { Link } from "react-router-dom";
3
- import React from "react";
4
4
  import removeAccents from "remove-accents";
5
- const NewsList = ({ itemsArray, onChange, parentCallback }) => {
5
+ import { ScrollContext } from "../../../hooks/ScrollContext";
6
+ const NewsList = ({ itemsArray, onChange, showCategoriesOrTopics, contextAuthenticatedUser }) => {
7
+ const { scrollPos, updateScrollPos } = useContext(ScrollContext);
8
+
6
9
  function handleClick(event) {
7
10
  onChange(event);
11
+ updateScrollPos(window.scrollY);
8
12
  }
13
+
14
+ useEffect(() => {
15
+ window.scrollTo({ top: scrollPos, left: 0, behavior: "instant" });
16
+ }, [itemsArray]);
9
17
  return (
10
18
  <React.Fragment>
11
19
  <ul className="r-result-list actu-result-list">
12
20
  {itemsArray.map((item, i) => (
13
- <li
14
- key={i}
15
- className="r-list-item-group"
16
- onClick={() => handleClick(item.UID)}
17
- >
21
+ <li key={i} className="r-list-item-group" onClick={() => handleClick(item.UID)}>
22
+ {contextAuthenticatedUser === "False" ? (
23
+ <a
24
+ href={item["@id"]}
25
+ target="_blank"
26
+ title="Editer la fiche"
27
+ className="edit-rest-elements edit-rest-elements-news"
28
+ >
29
+ <svg
30
+ xmlns="http://www.w3.org/2000/svg"
31
+ width="16"
32
+ height="16"
33
+ fill="currentColor"
34
+ class="bi bi-pencil-square"
35
+ viewBox="0 0 16 16"
36
+ >
37
+ <path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z" />
38
+ <path
39
+ fill-rule="evenodd"
40
+ d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5z"
41
+ />
42
+ </svg>
43
+ </a>
44
+ ) : (
45
+ ""
46
+ )}
18
47
  <Link
19
48
  className="r-news-list-item-link"
20
49
  style={{ textDecoration: "none" }}
21
50
  to={{
22
- pathname: "/"+removeAccents(item.title).replace(/[^a-zA-Z ]/g, "").replace(/\s/g, "-").toLowerCase(),
51
+ pathname:
52
+ "/" +
53
+ removeAccents(item.title)
54
+ .replace(/[^a-zA-Z ]/g, "")
55
+ .replace(/\s/g, "-")
56
+ .toLowerCase(),
23
57
  search: `?u=${item.UID}`,
24
58
  state: {
25
59
  idItem: item.UID,
26
60
  },
27
61
  }}
28
62
  >
29
- <NewsCard item={item} key={item.created} />
63
+ <NewsCard
64
+ item={item}
65
+ showCategoriesOrTopics={showCategoriesOrTopics}
66
+ key={item.created}
67
+ contextAuthenticatedUser={contextAuthenticatedUser}
68
+ />
30
69
  </Link>
31
70
  </li>
32
71
  ))}