imio.smartweb.core 1.2.11__py3-none-any.whl → 1.2.19__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 (99) hide show
  1. imio/smartweb/core/browser/configure.zcml +1 -1
  2. imio/smartweb/core/browser/dashboards/configure.zcml +0 -2
  3. imio/smartweb/core/browser/dashboards/plausible.py +4 -4
  4. imio/smartweb/core/browser/static/smartweb-edit-compiled.js +1 -1
  5. imio/smartweb/core/browser/static/src/edit.js +5 -0
  6. imio/smartweb/core/browser/utils.py +4 -30
  7. imio/smartweb/core/contents/__init__.py +2 -0
  8. imio/smartweb/core/contents/rest/base.py +12 -0
  9. imio/smartweb/core/contents/rest/configure.zcml +7 -0
  10. imio/smartweb/core/contents/rest/directory/content.py +2 -2
  11. imio/smartweb/core/contents/rest/directory/view.pt +2 -1
  12. imio/smartweb/core/contents/rest/directory/view.py +3 -0
  13. imio/smartweb/core/contents/rest/events/content.py +2 -2
  14. imio/smartweb/core/contents/rest/events/view.pt +2 -1
  15. imio/smartweb/core/contents/rest/events/view.py +3 -0
  16. imio/smartweb/core/contents/rest/news/content.py +2 -2
  17. imio/smartweb/core/contents/rest/news/view.pt +2 -1
  18. imio/smartweb/core/contents/rest/news/view.py +3 -0
  19. imio/smartweb/core/contents/rest/search/endpoint.py +1 -1
  20. imio/smartweb/core/contents/rest/traversal.py +18 -0
  21. imio/smartweb/core/contents/rest/view.py +7 -0
  22. imio/smartweb/core/contents/sections/events/view.py +1 -1
  23. imio/smartweb/core/contents/sections/news/view.py +1 -1
  24. imio/smartweb/core/interfaces.py +4 -0
  25. imio/smartweb/core/profiles/default/actions.xml +15 -0
  26. imio/smartweb/core/profiles/default/metadata.xml +1 -1
  27. imio/smartweb/core/rest/authentic_sources.py +47 -10
  28. imio/smartweb/core/rest/configure.zcml +54 -0
  29. imio/smartweb/core/tests/test_rest.py +120 -0
  30. imio/smartweb/core/tests/utils.py +15 -0
  31. imio/smartweb/core/upgrades/configure.zcml +18 -0
  32. imio/smartweb/core/upgrades/profiles/1051_to_1052/actions.xml +20 -0
  33. imio/smartweb/core/utils.py +31 -0
  34. imio/smartweb/core/viewlets/configure.zcml +11 -0
  35. imio/smartweb/core/viewlets/httpheaders.py +13 -0
  36. imio/smartweb/core/viewlets/ogp_tag_header.pt +10 -0
  37. imio/smartweb/core/viewlets/ogptags.py +8 -0
  38. imio/smartweb/core/webcomponents/build/css/54.smartweb-webcomponents-compiled.css +1 -0
  39. imio/smartweb/core/webcomponents/build/css/647.smartweb-webcomponents-compiled.css +1 -0
  40. imio/smartweb/core/webcomponents/build/js/3.smartweb-webcomponents-compiled.js +2 -0
  41. imio/smartweb/core/webcomponents/build/js/323.smartweb-webcomponents-compiled.js +1 -1
  42. imio/smartweb/core/webcomponents/build/js/363.smartweb-webcomponents-compiled.js +2 -0
  43. imio/smartweb/core/webcomponents/build/js/493.smartweb-webcomponents-compiled.js +1 -0
  44. imio/smartweb/core/webcomponents/build/js/54.smartweb-webcomponents-compiled.js +1 -0
  45. imio/smartweb/core/webcomponents/build/js/647.smartweb-webcomponents-compiled.js +2 -0
  46. imio/smartweb/core/webcomponents/build/js/647.smartweb-webcomponents-compiled.js.LICENSE.txt +1 -0
  47. imio/smartweb/core/webcomponents/build/js/smartweb-webcomponents-compiled.js +1 -1
  48. imio/smartweb/core/webcomponents/package.json +14 -17
  49. imio/smartweb/core/webcomponents/src/assets/contentIcon/download.svg +1 -0
  50. imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.jsx +85 -84
  51. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactCard/ContactCard.jsx +22 -23
  52. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/ContactContent.jsx +109 -93
  53. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/download.svg +1 -0
  54. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactList/ContactList.jsx +7 -7
  55. imio/smartweb/core/webcomponents/src/components/Events/EventCard/EventCard.jsx +43 -0
  56. imio/smartweb/core/webcomponents/src/components/Events/{ContactContent/ContactContent.jsx → EventContent/EventContent.jsx} +76 -81
  57. imio/smartweb/core/webcomponents/src/components/Events/{ContactList/ContactList.jsx → EventList/EventList.jsx} +9 -9
  58. imio/smartweb/core/webcomponents/src/components/Events/Events.jsx +99 -98
  59. imio/smartweb/core/webcomponents/src/components/Events/Events.scss +1 -1
  60. imio/smartweb/core/webcomponents/src/components/News/News.jsx +23 -25
  61. imio/smartweb/core/webcomponents/src/components/News/News.scss +3 -5
  62. imio/smartweb/core/webcomponents/src/components/News/{ContactCard/ContactCard.jsx → NewsCard/NewsCard.jsx} +14 -27
  63. imio/smartweb/core/webcomponents/src/components/News/{ContactContent/ContactContent.jsx → NewsContent/NewsContent.jsx} +37 -40
  64. imio/smartweb/core/webcomponents/src/components/News/{ContactList/ContactList.jsx → NewsList/NewsList.jsx} +9 -9
  65. imio/smartweb/core/webcomponents/src/components/Search/ContactResult/ContactResult.jsx +5 -5
  66. imio/smartweb/core/webcomponents/src/components/Search/EventsResult/EventsResult.jsx +5 -5
  67. imio/smartweb/core/webcomponents/src/components/Search/NewsResult/NewsResult.jsx +5 -5
  68. imio/smartweb/core/webcomponents/src/components/Search/WebResult/WebResult.jsx +3 -3
  69. imio/smartweb/core/webcomponents/src/{components/Events/ContactMap/ContactMap.jsx → utils/Map.jsx} +60 -64
  70. {imio.smartweb.core-1.2.11.dist-info → imio.smartweb.core-1.2.19.dist-info}/METADATA +72 -1
  71. {imio.smartweb.core-1.2.11.dist-info → imio.smartweb.core-1.2.19.dist-info}/RECORD +81 -83
  72. imio/smartweb/core/webcomponents/build/css/267.smartweb-webcomponents-compiled.css +0 -1
  73. imio/smartweb/core/webcomponents/build/css/779.smartweb-webcomponents-compiled.css +0 -1
  74. imio/smartweb/core/webcomponents/build/js/267.smartweb-webcomponents-compiled.js +0 -1
  75. imio/smartweb/core/webcomponents/build/js/552.smartweb-webcomponents-compiled.js +0 -2
  76. imio/smartweb/core/webcomponents/build/js/565.smartweb-webcomponents-compiled.js +0 -1
  77. imio/smartweb/core/webcomponents/build/js/612.smartweb-webcomponents-compiled.js +0 -2
  78. imio/smartweb/core/webcomponents/build/js/779.smartweb-webcomponents-compiled.js +0 -1
  79. imio/smartweb/core/webcomponents/pnpm-lock.yaml +0 -7066
  80. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactMap/ContactMap.jsx +0 -156
  81. imio/smartweb/core/webcomponents/src/components/Annuaire/Skeleton/LoaderCss.jsx +0 -7
  82. imio/smartweb/core/webcomponents/src/components/Annuaire/Skeleton/Skeleton.jsx +0 -20
  83. imio/smartweb/core/webcomponents/src/components/Events/ContactCard/ContactCard.jsx +0 -49
  84. imio/smartweb/core/webcomponents/src/components/Events/ContactMap/ContactMap.scss +0 -0
  85. imio/smartweb/core/webcomponents/src/components/Events/Skeleton/Skeleton.jsx +0 -20
  86. imio/smartweb/core/webcomponents/src/components/News/ContactMap/ContactMap.jsx +0 -127
  87. imio/smartweb/core/webcomponents/src/components/News/ContactMap/ContactMap.scss +0 -4
  88. imio/smartweb/core/webcomponents/src/components/News/Skeleton/Skeleton.jsx +0 -20
  89. imio/smartweb/core/webcomponents/src/components/Search/Skeleton/Skeleton.jsx +0 -20
  90. /imio/smartweb/core/webcomponents/build/css/{552.smartweb-webcomponents-compiled.css → 363.smartweb-webcomponents-compiled.css} +0 -0
  91. /imio/smartweb/core/webcomponents/build/js/{552.smartweb-webcomponents-compiled.js.LICENSE.txt → 3.smartweb-webcomponents-compiled.js.LICENSE.txt} +0 -0
  92. /imio/smartweb/core/webcomponents/build/js/{612.smartweb-webcomponents-compiled.js.LICENSE.txt → 363.smartweb-webcomponents-compiled.js.LICENSE.txt} +0 -0
  93. /imio/smartweb/core/webcomponents/src/{components/Annuaire/ContactMap/ContactMap.scss → utils/Map.scss} +0 -0
  94. /imio.smartweb.core-1.2.11-py3.10-nspkg.pth → /imio.smartweb.core-1.2.19-py3.10-nspkg.pth +0 -0
  95. {imio.smartweb.core-1.2.11.dist-info → imio.smartweb.core-1.2.19.dist-info}/LICENSE.GPL +0 -0
  96. {imio.smartweb.core-1.2.11.dist-info → imio.smartweb.core-1.2.19.dist-info}/LICENSE.rst +0 -0
  97. {imio.smartweb.core-1.2.11.dist-info → imio.smartweb.core-1.2.19.dist-info}/WHEEL +0 -0
  98. {imio.smartweb.core-1.2.11.dist-info → imio.smartweb.core-1.2.19.dist-info}/namespace_packages.txt +0 -0
  99. {imio.smartweb.core-1.2.11.dist-info → imio.smartweb.core-1.2.19.dist-info}/top_level.txt +0 -0
@@ -3,7 +3,7 @@ import React, { useEffect, useState } from "react";
3
3
  import useAxios from "../../../hooks/useAxios";
4
4
  import useFilterQuery from "../../../hooks/useFilterQuery";
5
5
  import ReactMarkdown from 'react-markdown';
6
- import Spotlight from "spotlight.js";
6
+ import "spotlight.js";
7
7
  import "../../../../node_modules/flexbin/flexbin.css"
8
8
  import { Translate } from "react-translated";
9
9
 
@@ -14,14 +14,13 @@ const ContactContent = ({ queryUrl, onChange }) => {
14
14
  { UID: queryString.parse(useFilterQuery().toString())['u'], fullobjects: 1 },
15
15
  );
16
16
  const [params, setParams] = useState(parsed);
17
- const [contactItem, setcontactItem] = useState({});
18
- const [files, setFiles] = useState(0);
19
- const [gallery, setGallery] = useState(0);
17
+ const [item, setitem] = useState({});
18
+ const [files, setFiles] = useState();
19
+ const [gallery, setGallery] = useState();
20
20
  const [social, setSocial] = useState([]);
21
- const [website, setWebsite] = useState([]);
22
21
  const [image, setImage] = useState();
23
22
 
24
- const { response, error, isLoading } = useAxios(
23
+ const { response } = useAxios(
25
24
  {
26
25
  method: "get",
27
26
  url: "",
@@ -40,53 +39,52 @@ const ContactContent = ({ queryUrl, onChange }) => {
40
39
  // set all contacts state
41
40
  useEffect(() => {
42
41
  if (response !== null) {
43
- setcontactItem(response.items[0]);
42
+ setitem(response.items[0]);
44
43
  }
45
44
  window.scrollTo(0, 0);
46
45
  }, [response]);
47
46
 
48
47
  // set image
49
48
  useEffect(() => {
50
- if (contactItem.image_affiche_scale) {
49
+ if (item.image_affiche_scale) {
51
50
  const img = new Image();
52
- img.src = contactItem.image_affiche_scale
51
+ img.src = item.image_affiche_scale
53
52
  img.onload = () => {
54
53
  setImage(img);
55
54
  };
56
55
  }
57
- }, [contactItem]);
56
+ }, [item]);
58
57
 
59
58
 
60
59
  // set social link
61
60
  useEffect(() => {
62
- contactItem.urls && setSocial(contactItem.urls.filter(urls => urls.type !== 'website'));
63
- contactItem.urls && setWebsite(contactItem.urls.filter(urls => urls.type === 'website'));
64
- }, [contactItem]);
61
+ item.urls && setSocial(item.urls.filter(urls => urls.type !== 'website'));
62
+ }, [item]);
65
63
 
66
64
  /// use to set file and gallery items
67
65
  useEffect(() => {
68
- if (contactItem.items && contactItem.items.length > 0) {
69
- setFiles(contactItem.items.filter(files => files['@type'] === 'File'));
70
- setGallery(contactItem.items.filter(files => files['@type'] === 'Image'));
66
+ if (item.items && item.items.length > 0) {
67
+ setFiles(item.items.filter(files => files['@type'] === 'File'));
68
+ setGallery(item.items.filter(files => files['@type'] === 'Image'));
71
69
  }
72
- }, [contactItem]);
70
+ }, [item]);
73
71
 
74
72
  function handleClick() {
75
73
  history.push("./");
76
74
  onChange(null);
77
75
  }
78
- let countryTitle = contactItem.country && contactItem.country.title
76
+ let countryTitle = item.country && item.country.title
79
77
  let itineraryLink =
80
78
  "https://www.google.com/maps/dir/?api=1&destination=" +
81
- contactItem.street +
79
+ item.street +
82
80
  "+" +
83
- contactItem.number +
81
+ item.number +
84
82
  "+" +
85
- contactItem.complement +
83
+ item.complement +
86
84
  "+" +
87
- contactItem.zipcode +
85
+ item.zipcode +
88
86
  "+" +
89
- contactItem.city +
87
+ item.city +
90
88
  "+" +
91
89
  countryTitle
92
90
 
@@ -98,20 +96,20 @@ const ContactContent = ({ queryUrl, onChange }) => {
98
96
  </button>
99
97
  <article>
100
98
  <header>
101
- <h2 className="r-content-title">{contactItem.title}</h2>
102
- {contactItem.subtitle ? (
103
- <h3 className="r-content-subtitle">{contactItem.subtitle}</h3>
99
+ <h2 className="r-content-title">{item.title}</h2>
100
+ {item.subtitle ? (
101
+ <h3 className="r-content-subtitle">{item.subtitle}</h3>
104
102
  ) : (
105
103
  ""
106
104
  )}
107
105
  </header>
108
- {contactItem.image_affiche_scale && (
106
+ {item.image_affiche_scale && (
109
107
  <figure className="r-content-figure">
110
108
  <div
111
109
  className="r-content-figure-blur"
112
- style={{ backgroundImage: "url(" + contactItem.image_affiche_scale + ")" }} />
110
+ style={{ backgroundImage: "url(" + item.image_affiche_scale + ")" }} />
113
111
  <img className="r-content-figure-img"
114
- src={contactItem.image_affiche_scale}
112
+ src={item.image_affiche_scale}
115
113
  style={{ objectFit: image && image.width >= image.height ? "cover" : "contain" }} />
116
114
  </figure>
117
115
  )}
@@ -120,29 +118,29 @@ const ContactContent = ({ queryUrl, onChange }) => {
120
118
  <div className="contactCard">
121
119
  <div className="contactText">
122
120
  <div className="r-content-description">
123
- <ReactMarkdown>{contactItem.description}</ReactMarkdown>
121
+ <ReactMarkdown>{item.description}</ReactMarkdown>
124
122
  </div>
125
123
  <div className="contactTextAll">
126
124
  <p className="annuaire-info-title">Infos pratiques</p>
127
- {contactItem.category ? <span>{contactItem.category}</span> : ""}
128
- {contactItem.street ? (
125
+ {item.category ? <span>{item.category}</span> : ""}
126
+ {item.street ? (
129
127
  <div className="annaire-adresse">
130
128
  <div className="annaire-adresse-icon">
131
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-geo-alt-fill" viewBox="0 0 16 16">
129
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
132
130
  <path d="M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10zm0-7a3 3 0 1 1 0-6 3 3 0 0 1 0 6z" />
133
131
  </svg>
134
132
  </div>
135
133
  <div className="annaire-adresse-content">
136
- <a href={itineraryLink} target="_blank">
137
- {contactItem.number ? <span>{contactItem.number + " "}</span> : ""}
138
- {contactItem.street ? <span>{contactItem.street + ", "}</span> : ""}
139
- {contactItem.complement ? (
140
- <span>{contactItem.complement + ", "}</span>
134
+ <a href={itineraryLink} target="_blank" rel="noreferrer">
135
+ {item.number ? <span>{item.number + " "}</span> : ""}
136
+ {item.street ? <span>{item.street + ", "}</span> : ""}
137
+ {item.complement ? (
138
+ <span>{item.complement + ", "}</span>
141
139
  ) : (
142
140
  ""
143
141
  )}
144
- {contactItem.zipcode ? <span>{contactItem.zipcode + " "}</span> : ""}
145
- {contactItem.city ? <span>{contactItem.city}</span> : ""}
142
+ {item.zipcode ? <span>{item.zipcode + " "}</span> : ""}
143
+ {item.city ? <span>{item.city}</span> : ""}
146
144
  </a>
147
145
  </div>
148
146
 
@@ -152,17 +150,17 @@ const ContactContent = ({ queryUrl, onChange }) => {
152
150
  ""
153
151
  )}
154
152
 
155
- {contactItem.phones && contactItem.phones.length > 0
153
+ {item.phones && item.phones.length > 0
156
154
  ? (<div className="annuaire-phone">
157
155
  <div className="annuaire-phone-icon">
158
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-telephone-fill" viewBox="0 0 16 16">
159
- <path fill-rule="evenodd" d="M1.885.511a1.745 1.745 0 0 1 2.61.163L6.29 2.98c.329.423.445.974.315 1.494l-.547 2.19a.678.678 0 0 0 .178.643l2.457 2.457a.678.678 0 0 0 .644.178l2.189-.547a1.745 1.745 0 0 1 1.494.315l2.306 1.794c.829.645.905 1.87.163 2.611l-1.034 1.034c-.74.74-1.846 1.065-2.877.702a18.634 18.634 0 0 1-7.01-4.42 18.634 18.634 0 0 1-4.42-7.009c-.362-1.03-.037-2.137.703-2.877L1.885.511z" />
156
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
157
+ <path d="M1.885.511a1.745 1.745 0 0 1 2.61.163L6.29 2.98c.329.423.445.974.315 1.494l-.547 2.19a.678.678 0 0 0 .178.643l2.457 2.457a.678.678 0 0 0 .644.178l2.189-.547a1.745 1.745 0 0 1 1.494.315l2.306 1.794c.829.645.905 1.87.163 2.611l-1.034 1.034c-.74.74-1.846 1.065-2.877.702a18.634 18.634 0 0 1-7.01-4.42 18.634 18.634 0 0 1-4.42-7.009c-.362-1.03-.037-2.137.703-2.877L1.885.511z" />
160
158
  </svg>
161
159
  </div>
162
160
  <div className="annuaire-phone-content">
163
- {contactItem.phones.map((phone) => {
161
+ {item.phones.map((phone, i) => {
164
162
  return (
165
- <span>
163
+ <span key={i}>
166
164
  {phone.label ? phone.label + ": " : ""}
167
165
  <a href={"tel:" + phone.number}>
168
166
  {phone.number}
@@ -174,17 +172,17 @@ const ContactContent = ({ queryUrl, onChange }) => {
174
172
  </div>)
175
173
  : ""}
176
174
 
177
- {contactItem.mails && contactItem.mails.length > 0
175
+ {item.mails && item.mails.length > 0
178
176
  ? <div className="annuaire-website-mails">
179
177
  <div className="annuaire-website-mails-icon">
180
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-envelope-fill" viewBox="0 0 16 16">
178
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
181
179
  <path d="M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414.05 3.555ZM0 4.697v7.104l5.803-3.558L0 4.697ZM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586l-1.239-.757Zm3.436-.586L16 11.801V4.697l-5.803 3.546Z" />
182
180
  </svg>
183
181
  </div>
184
182
  <div className="annuaire-website-mails-content">
185
- {contactItem.mails.map((mail) => {
183
+ {item.mails.map((mail, i) => {
186
184
  return (
187
- <span>
185
+ <span key={i}>
188
186
  {mail.label ? mail.label + ": " : ""}
189
187
  <a href={"mailto:" + mail.mail_address}>
190
188
  {mail.mail_address}
@@ -196,19 +194,19 @@ const ContactContent = ({ queryUrl, onChange }) => {
196
194
  </div>
197
195
  : ""}
198
196
 
199
- {contactItem.urls && contactItem.urls.length > 0
197
+ {item.urls && item.urls.length > 0
200
198
  ? <div className="annuaire-website-link">
201
199
  <div className="annuaire-website-link-icon">
202
- <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-laptop-fill" viewBox="0 0 16 16">
200
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
203
201
  <path d="M2.5 2A1.5 1.5 0 0 0 1 3.5V12h14V3.5A1.5 1.5 0 0 0 13.5 2h-11zM0 12.5h16a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 0 12.5z" />
204
202
  </svg>
205
203
  </div>
206
204
  <ul className="annuaire-website-link-content">
207
- {contactItem.urls.filter(url => url.type === "website").map(website => {
205
+ {item.urls.filter(url => url.type === "website").map((website, i) => {
208
206
  return (
209
207
  <>
210
- <li>
211
- <a href={website.url} target="_blank">
208
+ <li key={i}>
209
+ <a href={website.url} target="_blank" rel="noreferrer">
212
210
  {(website.url)}
213
211
  </a>
214
212
  </li>
@@ -224,32 +222,32 @@ const ContactContent = ({ queryUrl, onChange }) => {
224
222
  <div className="annuaire-social-link">
225
223
  {social.length > 1 ? (
226
224
  <ul>
227
- {social.map(url => {
225
+ {social.map((url, i) => {
228
226
  return (
229
- <li>
230
- <a href={url.url} target="_blank">
227
+ <li key={i}>
228
+ <a href={url.url} target="_blank" rel="noreferrer">
231
229
  {url.type === "facebook" ? (
232
- <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-facebook" viewBox="0 0 16 16">
230
+ <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" viewBox="0 0 16 16">
233
231
  <path d="M16 8.049c0-4.446-3.582-8.05-8-8.05C3.58 0-.002 3.603-.002 8.05c0 4.017 2.926 7.347 6.75 7.951v-5.625h-2.03V8.05H6.75V6.275c0-2.017 1.195-3.131 3.022-3.131.876 0 1.791.157 1.791.157v1.98h-1.009c-.993 0-1.303.621-1.303 1.258v1.51h2.218l-.354 2.326H9.25V16c3.824-.604 6.75-3.934 6.75-7.951z" />
234
232
  </svg>
235
233
  )
236
234
  : url.type === "instagram" ? (
237
- <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-instagram" viewBox="0 0 16 16">
235
+ <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" viewBox="0 0 16 16">
238
236
  <path d="M8 0C5.829 0 5.556.01 4.703.048 3.85.088 3.269.222 2.76.42a3.917 3.917 0 0 0-1.417.923A3.927 3.927 0 0 0 .42 2.76C.222 3.268.087 3.85.048 4.7.01 5.555 0 5.827 0 8.001c0 2.172.01 2.444.048 3.297.04.852.174 1.433.372 1.942.205.526.478.972.923 1.417.444.445.89.719 1.416.923.51.198 1.09.333 1.942.372C5.555 15.99 5.827 16 8 16s2.444-.01 3.298-.048c.851-.04 1.434-.174 1.943-.372a3.916 3.916 0 0 0 1.416-.923c.445-.445.718-.891.923-1.417.197-.509.332-1.09.372-1.942C15.99 10.445 16 10.173 16 8s-.01-2.445-.048-3.299c-.04-.851-.175-1.433-.372-1.941a3.926 3.926 0 0 0-.923-1.417A3.911 3.911 0 0 0 13.24.42c-.51-.198-1.092-.333-1.943-.372C10.443.01 10.172 0 7.998 0h.003zm-.717 1.442h.718c2.136 0 2.389.007 3.232.046.78.035 1.204.166 1.486.275.373.145.64.319.92.599.28.28.453.546.598.92.11.281.24.705.275 1.485.039.843.047 1.096.047 3.231s-.008 2.389-.047 3.232c-.035.78-.166 1.203-.275 1.485a2.47 2.47 0 0 1-.599.919c-.28.28-.546.453-.92.598-.28.11-.704.24-1.485.276-.843.038-1.096.047-3.232.047s-2.39-.009-3.233-.047c-.78-.036-1.203-.166-1.485-.276a2.478 2.478 0 0 1-.92-.598 2.48 2.48 0 0 1-.6-.92c-.109-.281-.24-.705-.275-1.485-.038-.843-.046-1.096-.046-3.233 0-2.136.008-2.388.046-3.231.036-.78.166-1.204.276-1.486.145-.373.319-.64.599-.92.28-.28.546-.453.92-.598.282-.11.705-.24 1.485-.276.738-.034 1.024-.044 2.515-.045v.002zm4.988 1.328a.96.96 0 1 0 0 1.92.96.96 0 0 0 0-1.92zm-4.27 1.122a4.109 4.109 0 1 0 0 8.217 4.109 4.109 0 0 0 0-8.217zm0 1.441a2.667 2.667 0 1 1 0 5.334 2.667 2.667 0 0 1 0-5.334z" />
239
237
  </svg>
240
238
  )
241
239
  : url.type === "twitter" ? (
242
- <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-twitter" viewBox="0 0 16 16">
240
+ <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" viewBox="0 0 16 16">
243
241
  <path d="M5.026 15c6.038 0 9.341-5.003 9.341-9.334 0-.14 0-.282-.006-.422A6.685 6.685 0 0 0 16 3.542a6.658 6.658 0 0 1-1.889.518 3.301 3.301 0 0 0 1.447-1.817 6.533 6.533 0 0 1-2.087.793A3.286 3.286 0 0 0 7.875 6.03a9.325 9.325 0 0 1-6.767-3.429 3.289 3.289 0 0 0 1.018 4.382A3.323 3.323 0 0 1 .64 6.575v.045a3.288 3.288 0 0 0 2.632 3.218 3.203 3.203 0 0 1-.865.115 3.23 3.23 0 0 1-.614-.057 3.283 3.283 0 0 0 3.067 2.277A6.588 6.588 0 0 1 .78 13.58a6.32 6.32 0 0 1-.78-.045A9.344 9.344 0 0 0 5.026 15z" />
244
242
  </svg>
245
243
  )
246
244
  : url.type === "youtube" ? (
247
- <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-youtube" viewBox="0 0 16 16">
245
+ <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" viewBox="0 0 16 16">
248
246
  <path d="M8.051 1.999h.089c.822.003 4.987.033 6.11.335a2.01 2.01 0 0 1 1.415 1.42c.101.38.172.883.22 1.402l.01.104.022.26.008.104c.065.914.073 1.77.074 1.957v.075c-.001.194-.01 1.108-.082 2.06l-.008.105-.009.104c-.05.572-.124 1.14-.235 1.558a2.007 2.007 0 0 1-1.415 1.42c-1.16.312-5.569.334-6.18.335h-.142c-.309 0-1.587-.006-2.927-.052l-.17-.006-.087-.004-.171-.007-.171-.007c-1.11-.049-2.167-.128-2.654-.26a2.007 2.007 0 0 1-1.415-1.419c-.111-.417-.185-.986-.235-1.558L.09 9.82l-.008-.104A31.4 31.4 0 0 1 0 7.68v-.123c.002-.215.01-.958.064-1.778l.007-.103.003-.052.008-.104.022-.26.01-.104c.048-.519.119-1.023.22-1.402a2.007 2.007 0 0 1 1.415-1.42c.487-.13 1.544-.21 2.654-.26l.17-.007.172-.006.086-.003.171-.007A99.788 99.788 0 0 1 7.858 2h.193zM6.4 5.209v4.818l4.157-2.408L6.4 5.209z" />
249
247
  </svg>
250
248
  )
251
249
  : url.type === "pinterest" ? (
252
- <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-pinterest" viewBox="0 0 16 16">
250
+ <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" viewBox="0 0 16 16">
253
251
  <path d="M8 0a8 8 0 0 0-2.915 15.452c-.07-.633-.134-1.606.027-2.297.146-.625.938-3.977.938-3.977s-.239-.479-.239-1.187c0-1.113.645-1.943 1.448-1.943.682 0 1.012.512 1.012 1.127 0 .686-.437 1.712-.663 2.663-.188.796.4 1.446 1.185 1.446 1.422 0 2.515-1.5 2.515-3.664 0-1.915-1.377-3.254-3.342-3.254-2.276 0-3.612 1.707-3.612 3.471 0 .688.265 1.425.595 1.826a.24.24 0 0 1 .056.23c-.061.252-.196.796-.222.907-.035.146-.116.177-.268.107-1-.465-1.624-1.926-1.624-3.1 0-2.523 1.834-4.84 5.286-4.84 2.775 0 4.932 1.977 4.932 4.62 0 2.757-1.739 4.976-4.151 4.976-.811 0-1.573-.421-1.834-.919l-.498 1.902c-.181.695-.669 1.566-.995 2.097A8 8 0 1 0 8 0z" />
254
252
  </svg>
255
253
  )
@@ -261,29 +259,29 @@ const ContactContent = ({ queryUrl, onChange }) => {
261
259
  </ul>
262
260
  ) : (
263
261
  <div>
264
- <a href={social[0] && social[0].url} target="_blank">
262
+ <a href={social[0] && social[0].url} target="_blank" rel="noreferrer">
265
263
  {social[0] && social[0].type === "facebook" ? (
266
- <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-facebook" viewBox="0 0 16 16">
264
+ <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" viewBox="0 0 16 16">
267
265
  <path d="M16 8.049c0-4.446-3.582-8.05-8-8.05C3.58 0-.002 3.603-.002 8.05c0 4.017 2.926 7.347 6.75 7.951v-5.625h-2.03V8.05H6.75V6.275c0-2.017 1.195-3.131 3.022-3.131.876 0 1.791.157 1.791.157v1.98h-1.009c-.993 0-1.303.621-1.303 1.258v1.51h2.218l-.354 2.326H9.25V16c3.824-.604 6.75-3.934 6.75-7.951z" />
268
266
  </svg>
269
267
  )
270
268
  : social[0] && social[0].type === "instagram" ? (
271
- <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-instagram" viewBox="0 0 16 16">
269
+ <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" viewBox="0 0 16 16">
272
270
  <path d="M8 0C5.829 0 5.556.01 4.703.048 3.85.088 3.269.222 2.76.42a3.917 3.917 0 0 0-1.417.923A3.927 3.927 0 0 0 .42 2.76C.222 3.268.087 3.85.048 4.7.01 5.555 0 5.827 0 8.001c0 2.172.01 2.444.048 3.297.04.852.174 1.433.372 1.942.205.526.478.972.923 1.417.444.445.89.719 1.416.923.51.198 1.09.333 1.942.372C5.555 15.99 5.827 16 8 16s2.444-.01 3.298-.048c.851-.04 1.434-.174 1.943-.372a3.916 3.916 0 0 0 1.416-.923c.445-.445.718-.891.923-1.417.197-.509.332-1.09.372-1.942C15.99 10.445 16 10.173 16 8s-.01-2.445-.048-3.299c-.04-.851-.175-1.433-.372-1.941a3.926 3.926 0 0 0-.923-1.417A3.911 3.911 0 0 0 13.24.42c-.51-.198-1.092-.333-1.943-.372C10.443.01 10.172 0 7.998 0h.003zm-.717 1.442h.718c2.136 0 2.389.007 3.232.046.78.035 1.204.166 1.486.275.373.145.64.319.92.599.28.28.453.546.598.92.11.281.24.705.275 1.485.039.843.047 1.096.047 3.231s-.008 2.389-.047 3.232c-.035.78-.166 1.203-.275 1.485a2.47 2.47 0 0 1-.599.919c-.28.28-.546.453-.92.598-.28.11-.704.24-1.485.276-.843.038-1.096.047-3.232.047s-2.39-.009-3.233-.047c-.78-.036-1.203-.166-1.485-.276a2.478 2.478 0 0 1-.92-.598 2.48 2.48 0 0 1-.6-.92c-.109-.281-.24-.705-.275-1.485-.038-.843-.046-1.096-.046-3.233 0-2.136.008-2.388.046-3.231.036-.78.166-1.204.276-1.486.145-.373.319-.64.599-.92.28-.28.546-.453.92-.598.282-.11.705-.24 1.485-.276.738-.034 1.024-.044 2.515-.045v.002zm4.988 1.328a.96.96 0 1 0 0 1.92.96.96 0 0 0 0-1.92zm-4.27 1.122a4.109 4.109 0 1 0 0 8.217 4.109 4.109 0 0 0 0-8.217zm0 1.441a2.667 2.667 0 1 1 0 5.334 2.667 2.667 0 0 1 0-5.334z" />
273
271
  </svg>
274
272
  )
275
273
  : social[0] && social[0].type === "twitter" ? (
276
- <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-twitter" viewBox="0 0 16 16">
274
+ <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" viewBox="0 0 16 16">
277
275
  <path d="M5.026 15c6.038 0 9.341-5.003 9.341-9.334 0-.14 0-.282-.006-.422A6.685 6.685 0 0 0 16 3.542a6.658 6.658 0 0 1-1.889.518 3.301 3.301 0 0 0 1.447-1.817 6.533 6.533 0 0 1-2.087.793A3.286 3.286 0 0 0 7.875 6.03a9.325 9.325 0 0 1-6.767-3.429 3.289 3.289 0 0 0 1.018 4.382A3.323 3.323 0 0 1 .64 6.575v.045a3.288 3.288 0 0 0 2.632 3.218 3.203 3.203 0 0 1-.865.115 3.23 3.23 0 0 1-.614-.057 3.283 3.283 0 0 0 3.067 2.277A6.588 6.588 0 0 1 .78 13.58a6.32 6.32 0 0 1-.78-.045A9.344 9.344 0 0 0 5.026 15z" />
278
276
  </svg>
279
277
  )
280
278
  : social[0] && social[0].type === "youtube" ? (
281
- <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-youtube" viewBox="0 0 16 16">
279
+ <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" viewBox="0 0 16 16">
282
280
  <path d="M8.051 1.999h.089c.822.003 4.987.033 6.11.335a2.01 2.01 0 0 1 1.415 1.42c.101.38.172.883.22 1.402l.01.104.022.26.008.104c.065.914.073 1.77.074 1.957v.075c-.001.194-.01 1.108-.082 2.06l-.008.105-.009.104c-.05.572-.124 1.14-.235 1.558a2.007 2.007 0 0 1-1.415 1.42c-1.16.312-5.569.334-6.18.335h-.142c-.309 0-1.587-.006-2.927-.052l-.17-.006-.087-.004-.171-.007-.171-.007c-1.11-.049-2.167-.128-2.654-.26a2.007 2.007 0 0 1-1.415-1.419c-.111-.417-.185-.986-.235-1.558L.09 9.82l-.008-.104A31.4 31.4 0 0 1 0 7.68v-.123c.002-.215.01-.958.064-1.778l.007-.103.003-.052.008-.104.022-.26.01-.104c.048-.519.119-1.023.22-1.402a2.007 2.007 0 0 1 1.415-1.42c.487-.13 1.544-.21 2.654-.26l.17-.007.172-.006.086-.003.171-.007A99.788 99.788 0 0 1 7.858 2h.193zM6.4 5.209v4.818l4.157-2.408L6.4 5.209z" />
283
281
  </svg>
284
282
  )
285
283
  : social[0] && social[0].type === "pinterest" ? (
286
- <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-pinterest" viewBox="0 0 16 16">
284
+ <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" viewBox="0 0 16 16">
287
285
  <path d="M8 0a8 8 0 0 0-2.915 15.452c-.07-.633-.134-1.606.027-2.297.146-.625.938-3.977.938-3.977s-.239-.479-.239-1.187c0-1.113.645-1.943 1.448-1.943.682 0 1.012.512 1.012 1.127 0 .686-.437 1.712-.663 2.663-.188.796.4 1.446 1.185 1.446 1.422 0 2.515-1.5 2.515-3.664 0-1.915-1.377-3.254-3.342-3.254-2.276 0-3.612 1.707-3.612 3.471 0 .688.265 1.425.595 1.826a.24.24 0 0 1 .056.23c-.061.252-.196.796-.222.907-.035.146-.116.177-.268.107-1-.465-1.624-1.926-1.624-3.1 0-2.523 1.834-4.84 5.286-4.84 2.775 0 4.932 1.977 4.932 4.62 0 2.757-1.739 4.976-4.151 4.976-.811 0-1.573-.421-1.834-.919l-.498 1.902c-.181.695-.669 1.566-.995 2.097A8 8 0 1 0 8 0z" />
288
286
  </svg>
289
287
  )
@@ -295,10 +293,29 @@ const ContactContent = ({ queryUrl, onChange }) => {
295
293
  }
296
294
  </div>
297
295
  }
298
- {contactItem.logo_thumb_scale &&
296
+
297
+ {/* add topics */}
298
+ <div className="topics">
299
+ {item.topics
300
+ ? item.topics.map((mail, i) => {
301
+ return <span key={i}>{mail.title}</span>;
302
+ })
303
+ : ""}
304
+ </div>
305
+
306
+ {item.logo_thumb_scale ? (
307
+ <img
308
+ className="annuaire-logo"
309
+ src={item.logo_thumb_scale}
310
+ alt="Logo"
311
+ />
312
+ ) : (
313
+ ""
314
+ )}
315
+ {item.logo_thumb_scale &&
299
316
  <img
300
317
  className="annuaire-logo"
301
- src={contactItem.logo_thumb_scale}
318
+ src={item.logo_thumb_scale}
302
319
  alt="Logo"
303
320
  />
304
321
  }
@@ -306,33 +323,32 @@ const ContactContent = ({ queryUrl, onChange }) => {
306
323
  </div>
307
324
  {/* add files to download */}
308
325
  {
309
- files ? (
310
- <div className="r-content-files">
311
- {files.map((file) => (
312
- <div className="r-content-file">
313
- <a href={file.targetUrl} className="r-content-file-link" rel="nofollow">
314
- <span className="r-content-file-title">{file.title}</span>
315
- {/* <span className="r-content-file-size">{file.file.size}</span> */}
316
- <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>
317
- </a>
318
- </div>
319
- ))}
320
- </div>
321
- ) : ("")
326
+ files &&
327
+ <div className="r-content-files">
328
+ {files.map((file, i) => (
329
+ <div key={i} className="r-content-file">
330
+ <a href={file.targetUrl} className="r-content-file-link" rel="nofollow">
331
+ <span className="r-content-file-title">{file.title}</span>
332
+ <span className="r-content-file-icon">
333
+ <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>
334
+ </span>
335
+ </a>
336
+ </div>
337
+ ))}
338
+ </div>
322
339
  }
323
340
  {/* add gallery */}
324
341
  {
325
- gallery ? (
326
- <div className="r-content-gallery">
327
- <div className="spotlight-group flexbin r-content-gallery">
328
- {gallery.map((image) => (
329
- <a className="spotlight" href={image.image_full_scale} >
330
- <img src={image.image_preview_scale} />
331
- </a>
332
- ))}
333
- </div>
342
+ gallery &&
343
+ <div className="r-content-gallery">
344
+ <div className="spotlight-group flexbin r-content-gallery">
345
+ {gallery.map((image, i) => (
346
+ <a key={i} className="spotlight" href={image.image_extralarge_scale} >
347
+ <img src={image.image_vignette_scale} />
348
+ </a>
349
+ ))}
334
350
  </div>
335
- ) : ("")
351
+ </div>
336
352
  }
337
353
  </div>
338
354
  </div>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17.5 17.94"><path d="M14.88 17.94H2.62C1.17 17.94 0 16.76 0 15.32v-4.38h1.75v4.38c0 .48.39.88.88.88h12.25c.48 0 .88-.39.88-.88v-4.38h1.75v4.38c0 1.45-1.18 2.62-2.62 2.62Zm-6.12-5.76L3.14 6.56l1.24-1.24 3.5 3.5V0h1.75v8.83l3.5-3.5 1.24 1.24-5.61 5.61Z" style="fill:#8899a4;stroke-width:0"/></svg>
@@ -13,26 +13,26 @@ const ContactList = ({ contactArray, onChange, onHover, parentCallback }) => {
13
13
  return (
14
14
  <React.Fragment>
15
15
  <ul className="r-result-list annuaire-result-list">
16
- {contactArray.map((contactItem, i) => (
16
+ {contactArray.map((item, i) => (
17
17
  <li
18
18
  key={i}
19
19
  className="r-list-item-group"
20
- onMouseEnter={() => handleHover(contactItem.UID)}
20
+ onMouseEnter={() => handleHover(item.UID)}
21
21
  onMouseLeave={() => handleHover(null)}
22
- onClick={() => handleClick(contactItem.UID)}
22
+ onClick={() => handleClick(item.UID)}
23
23
  >
24
24
  <Link
25
25
  className="r-list-item-link"
26
26
  style={{ textDecoration: "none" }}
27
27
  to={{
28
- pathname: removeAccents(contactItem.title).replace(/[^a-zA-Z ]/g, "").replace(/\s/g, "-").toLowerCase(),
29
- search: `?u=${contactItem.UID}`,
28
+ pathname: removeAccents(item.title).replace(/[^a-zA-Z ]/g, "").replace(/\s/g, "-").toLowerCase(),
29
+ search: `?u=${item.UID}`,
30
30
  state: {
31
- idItem: contactItem.UID,
31
+ idItem: item.UID,
32
32
  },
33
33
  }}
34
34
  ></Link>
35
- <ContactCard contactItem={contactItem} key={contactItem.created} />
35
+ <ContactCard item={item} key={item.created} />
36
36
  </li>
37
37
  ))}
38
38
  </ul>
@@ -0,0 +1,43 @@
1
+ import React from "react";
2
+ import moment from "moment";
3
+ import Moment from "react-moment";
4
+ const ContactCard = ({ item }) => {
5
+ const title = item.title && item.title;
6
+ const category =
7
+ item.taxonomy_contact_category && item.taxonomy_contact_category[0];
8
+ const start = moment(item.start && item.start);
9
+
10
+ const number = item.number ? item.number : "";
11
+ const street = item.street ? item.street : "";
12
+ const complement = item.complement ? item.complement : "";
13
+ const zipcode = item.zipcode ? item.zipcode : "";
14
+ const city = item.city ? item.city : "";
15
+ const country = item.country ? item.country : "";
16
+ const phones = item.phones ? item.phones : "";
17
+ const mails = item.mails ? item.mails : "";
18
+ const topics = item.topics ? item.topics : "";
19
+ return (
20
+ <div className="r-list-item">
21
+ <div
22
+ className={item.image_vignette_scale?"r-item-img":"r-item-img r-item-img-placeholder"}
23
+ style={{
24
+ backgroundImage: item.image_vignette_scale
25
+ ? "url(" + item.image_vignette_scale + ")"
26
+ : "",
27
+ }}
28
+ />
29
+
30
+ <div className="r-item-text">
31
+ {start &&
32
+ <span className="r-item-date">
33
+ <Moment format="DD-MM-YYYY">{start}</Moment>
34
+ </span>
35
+ }
36
+ <span className="r-item-title">{title}</span>
37
+ {item.category && <span className="r-item-categorie">{item.category.title}</span>}
38
+ </div>
39
+ </div>
40
+ );
41
+ };
42
+
43
+ export default ContactCard;