imio.smartweb.core 1.2.47__py3-none-any.whl → 1.2.48__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 (72) hide show
  1. imio/smartweb/core/contents/sections/events/view.py +2 -1
  2. imio/smartweb/core/contents/sections/news/view.py +2 -1
  3. imio/smartweb/core/contents/sections/text/views.py +2 -0
  4. imio/smartweb/core/contents/sections/views.py +2 -0
  5. imio/smartweb/core/tests/resources/json_rest_events.json +4 -1
  6. imio/smartweb/core/tests/test_rest.py +4 -1
  7. imio/smartweb/core/tests/test_section_events.py +9 -8
  8. imio/smartweb/core/tests/test_section_news.py +6 -6
  9. imio/smartweb/core/tests/test_vocabularies.py +2 -2
  10. imio/smartweb/core/utils.py +1 -1
  11. imio/smartweb/core/viewlets/footer.pt +5 -0
  12. imio/smartweb/core/viewlets/footer.py +5 -0
  13. imio/smartweb/core/vocabularies.py +2 -2
  14. imio/smartweb/core/webcomponents/build/css/373.smartweb-webcomponents-compiled.css +1 -1
  15. imio/smartweb/core/webcomponents/build/css/486.smartweb-webcomponents-compiled.css +1 -1
  16. imio/smartweb/core/webcomponents/build/css/884.smartweb-webcomponents-compiled.css +1 -0
  17. imio/smartweb/core/webcomponents/build/css/smartweb-webcomponents-compiled.css +1 -1
  18. imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js +1 -1
  19. imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js.LICENSE.txt +5 -0
  20. imio/smartweb/core/webcomponents/build/js/373.smartweb-webcomponents-compiled.js +1 -1
  21. imio/smartweb/core/webcomponents/build/js/486.smartweb-webcomponents-compiled.js +1 -1
  22. imio/smartweb/core/webcomponents/build/js/736.smartweb-webcomponents-compiled.js +1 -1
  23. imio/smartweb/core/webcomponents/build/js/736.smartweb-webcomponents-compiled.js.LICENSE.txt +3 -3
  24. imio/smartweb/core/webcomponents/build/js/884.smartweb-webcomponents-compiled.js +1 -0
  25. imio/smartweb/core/webcomponents/build/js/919.smartweb-webcomponents-compiled.js +1 -1
  26. imio/smartweb/core/webcomponents/build/js/smartweb-webcomponents-compiled.js +1 -1
  27. imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.jsx +101 -74
  28. imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.scss +4 -22
  29. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactCard/ContactCard.jsx +22 -18
  30. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/ContactContent.jsx +4 -2
  31. imio/smartweb/core/webcomponents/src/components/Annuaire/ContactList/ContactList.jsx +7 -2
  32. imio/smartweb/core/webcomponents/src/components/Annuaire/Filters/Filter.jsx +211 -98
  33. imio/smartweb/core/webcomponents/src/components/Events/EventContent/EventContent.jsx +506 -378
  34. imio/smartweb/core/webcomponents/src/components/Events/EventList/EventList.jsx +13 -4
  35. imio/smartweb/core/webcomponents/src/components/Events/Events.jsx +117 -82
  36. imio/smartweb/core/webcomponents/src/components/Events/Events.scss +52 -28
  37. imio/smartweb/core/webcomponents/src/components/Events/Filters/Filter.jsx +257 -90
  38. imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.jsx +62 -54
  39. imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.scss +60 -12
  40. imio/smartweb/core/webcomponents/src/components/Filters/IamData.jsx +42 -0
  41. imio/smartweb/core/webcomponents/src/components/Filters/MainFilter.scss +217 -0
  42. imio/smartweb/core/webcomponents/src/components/Filters/PublicTargetData.jsx +94 -0
  43. imio/smartweb/core/webcomponents/src/components/Filters/SelectStyles.js +58 -0
  44. imio/smartweb/core/webcomponents/src/components/Filters/TaxonomyFilter.jsx +149 -0
  45. imio/smartweb/core/webcomponents/src/components/Filters/TaxonomyFilter.scss +70 -0
  46. imio/smartweb/core/webcomponents/src/components/News/Filters/Filter.jsx +127 -82
  47. imio/smartweb/core/webcomponents/src/components/News/News.jsx +86 -53
  48. imio/smartweb/core/webcomponents/src/components/News/News.scss +29 -9
  49. imio/smartweb/core/webcomponents/src/components/News/NewsCard/NewsCard.jsx +34 -31
  50. imio/smartweb/core/webcomponents/src/components/News/NewsContent/NewsContent.jsx +264 -244
  51. imio/smartweb/core/webcomponents/src/components/News/NewsList/NewsList.jsx +13 -8
  52. imio/smartweb/core/webcomponents/src/components/Search/ContactResult/ContactResult.jsx +23 -12
  53. imio/smartweb/core/webcomponents/src/components/Search/EventsResult/EventsResult.jsx +23 -12
  54. imio/smartweb/core/webcomponents/src/components/Search/Filters/Filter.jsx +5 -5
  55. imio/smartweb/core/webcomponents/src/components/Search/NewsResult/NewsResult.jsx +23 -12
  56. imio/smartweb/core/webcomponents/src/components/Search/Search.jsx +4 -4
  57. imio/smartweb/core/webcomponents/src/components/Search/WebResult/WebResult.jsx +13 -4
  58. imio/smartweb/core/webcomponents/src/index.jsx +3 -3
  59. imio/smartweb/core/webcomponents/src/index.scss +11 -65
  60. imio/smartweb/core/webcomponents/src/utils/Map.jsx +18 -9
  61. imio/smartweb/core/webcomponents/src/utils/translation.js +18 -0
  62. imio.smartweb.core-1.2.48-py3.10-nspkg.pth +3 -0
  63. {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/METADATA +22 -3
  64. {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/RECORD +69 -63
  65. {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/WHEEL +1 -1
  66. imio/smartweb/core/webcomponents/build/css/686.smartweb-webcomponents-compiled.css +0 -1
  67. imio/smartweb/core/webcomponents/build/js/686.smartweb-webcomponents-compiled.js +0 -1
  68. imio.smartweb.core-1.2.47-py3.8-nspkg.pth +0 -2
  69. {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/LICENSE.GPL +0 -0
  70. {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/LICENSE.rst +0 -0
  71. {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/namespace_packages.txt +0 -0
  72. {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/top_level.txt +0 -0
@@ -1,19 +1,16 @@
1
1
  import React, { useEffect, useState, useRef } from "react";
2
- import {
3
- BrowserRouter,
4
- Routes,
5
- Route,
6
- } from "react-router-dom";
2
+ import { BrowserRouter, Routes, Route } from "react-router-dom";
7
3
  import Filters from "./Filters/Filter";
8
4
  import ContactContent from "./ContactContent/ContactContent";
9
5
  import ContactList from "./ContactList/ContactList";
10
6
  import Map from "../../utils/Map";
11
7
  import useAxios from "../../hooks/useAxios";
12
8
  import "./Annuaire.scss";
9
+ import "../Filters/MainFilter.scss";
13
10
  import useFilterQuery from "../../hooks/useFilterQuery";
14
11
  import { Provider, Translate } from "react-translated";
15
- import translation from '../../utils/translation';
16
- import queryString from 'query-string';
12
+ import translation from "../../utils/translation";
13
+ import queryString from "query-string";
17
14
 
18
15
  export default function Annuaire(props) {
19
16
  return (
@@ -104,15 +101,15 @@ function AnnuaireView(props) {
104
101
  }, [batchStart]);
105
102
 
106
103
  // filter top style
107
- let portalHeader = document.getElementById("portal-header");
108
- let portalHeaderHeight = portalHeader.offsetHeight;
109
-
110
104
  const filterRef = useRef();
111
105
  const [style, setStyle] = React.useState({ height: 0 });
106
+ const [headerHeight, setHeaderHeight] = useState(0);
107
+
112
108
  useEffect(() => {
113
109
  setStyle({
114
110
  height: filterRef.current.clientHeight,
115
111
  });
112
+ setHeaderHeight(filterRef.current.offsetTop);
116
113
  }, [filterRef.current]);
117
114
 
118
115
  // coditional list render
@@ -124,7 +121,7 @@ function AnnuaireView(props) {
124
121
  );
125
122
  MapRender = (
126
123
  <Map
127
- headerHeight={style.height + portalHeaderHeight}
124
+ headerHeight={style.height + headerHeight}
128
125
  clickId={clickId}
129
126
  hoverId={hoverId}
130
127
  items={contactArray}
@@ -132,16 +129,33 @@ function AnnuaireView(props) {
132
129
  />
133
130
  );
134
131
  } else if (!isLoading) {
135
- listRender = <p><Translate text="Aucun contact n'a été trouvé" /></p>;
132
+ listRender = (
133
+ <p>
134
+ <Translate text="Aucun contact n'a été trouvé" />
135
+ </p>
136
+ );
136
137
  }
137
138
 
138
- const divLoader = <div className="lds-roller-container"><div className="lds-roller"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div></div>;
139
+ const divLoader = (
140
+ <div className="lds-roller-container">
141
+ <div className="lds-roller">
142
+ <div></div>
143
+ <div></div>
144
+ <div></div>
145
+ <div></div>
146
+ <div></div>
147
+ <div></div>
148
+ <div></div>
149
+ <div></div>
150
+ </div>
151
+ </div>
152
+ );
139
153
  return (
140
154
  <div className={`ref ${displayMap ? "view-map" : "no-map"}`}>
141
155
  <div
142
156
  className="r-result-filter-container"
143
157
  ref={filterRef}
144
- style={{ top: portalHeaderHeight }}
158
+ style={{ top: headerHeight }}
145
159
  >
146
160
  <div
147
161
  id="r-result-filter"
@@ -152,81 +166,94 @@ function AnnuaireView(props) {
152
166
  activeFilter={filters}
153
167
  onChange={filtersChange}
154
168
  />
155
- {props.proposeUrl &&
156
- (
157
- <div className="r-add-contact">
158
- <a target="_blank" rel="noreferrer" href={props.proposeUrl}><Translate text='Proposer un contact' /></a>
159
- </div>
160
- )
161
- }
169
+ {props.proposeUrl && (
170
+ <div className="r-add-contact">
171
+ <a target="_blank" rel="noreferrer" href={props.proposeUrl}>
172
+ <Translate text="Proposer un contact" />
173
+ </a>
174
+ </div>
175
+ )}
162
176
  {contactNumber > 0 ? (
163
177
  <p className="r-results-numbers">
164
178
  <span>{contactNumber}</span>
165
- {contactNumber > 1
166
- ? <Translate text='contacts trouvés' />
167
- : <Translate text='contact trouvé' />}
179
+ {contactNumber > 1 ? (
180
+ <Translate text="contacts trouvés" />
181
+ ) : (
182
+ <Translate text="contact trouvé" />
183
+ )}
168
184
  </p>
169
185
  ) : (
170
- <p className="r-results-numbers"><Translate text='Aucun résultat' /></p>
186
+ <p className="r-results-numbers">
187
+ <Translate text="Aucun résultat" />
188
+ </p>
171
189
  )}
172
190
  </div>
173
191
  </div>
174
192
  <Routes>
175
- <Route exact path="/" element={
176
- <div className="r-wrapper container r-annuaire-wrapper">
177
- <div className="r-result r-annuaire-result">
178
- <div>{listRender}</div>
179
- <div className="r-load-more">
180
- {contactNumber - props.batchSize > batchStart ? (
181
- <div>
193
+ <Route
194
+ exact
195
+ path="/"
196
+ element={
197
+ <div className="r-wrapper container r-annuaire-wrapper">
198
+ <div className="r-result r-annuaire-result">
199
+ <div>{listRender}</div>
200
+ <div className="r-load-more">
201
+ {contactNumber - props.batchSize > batchStart ? (
202
+ <div>
203
+ <span className="no-more-result">
204
+ {isLoading ? divLoader : ""}
205
+ </span>
206
+ <button onClick={loadMore} className="btn-grad">
207
+ {isLoading ? (
208
+ <Translate text="Chargement..." />
209
+ ) : (
210
+ <Translate text="Plus de résultats" />
211
+ )}
212
+ </button>
213
+ </div>
214
+ ) : (
182
215
  <span className="no-more-result">
183
216
  {isLoading ? divLoader : ""}
184
217
  </span>
185
- <button onClick={loadMore} className="btn-grad">
186
- {isLoading ? <Translate text='Chargement...' /> : <Translate text='Plus de résultats' />}
187
- </button>
188
- </div>
189
- ) : (
190
- <span className="no-more-result">
191
- {isLoading ? divLoader : ""}
192
- </span>
193
- )}
218
+ )}
219
+ </div>
194
220
  </div>
221
+ {displayMap && (
222
+ <div
223
+ className="r-map annuaire-map"
224
+ style={{
225
+ top: style.height + headerHeight,
226
+ height: "calc(100vh-" + style.height + headerHeight,
227
+ }}
228
+ >
229
+ {MapRender}
230
+ </div>
231
+ )}
195
232
  </div>
196
- {displayMap && <div
197
- className="r-map annuaire-map"
198
- style={{
199
- top: style.height + portalHeaderHeight,
200
- height: "calc(100vh-" + style.height + portalHeaderHeight,
201
- }}
202
- >
203
- {MapRender}
204
- </div>
205
- }
206
- </div>
207
- }>
208
-
209
- </Route>
210
- <Route path={"/:name"} element={
211
- <div className="r-wrapper container r-annuaire-wrapper">
212
- <div className="r-result r-annuaire-result">
213
- <ContactContent queryUrl={props.queryUrl} onChange={clickID} />
214
- </div>
215
- {displayMap && <div
216
- className="r-map annuaire-map"
217
- style={{
218
- top: style.height + portalHeaderHeight,
219
- height: "calc(100vh-" + style.height + portalHeaderHeight,
220
- }}
221
- >
222
- {MapRender}
233
+ }
234
+ ></Route>
235
+ <Route
236
+ path={"/:name"}
237
+ element={
238
+ <div className="r-wrapper container r-annuaire-wrapper">
239
+ <div className="r-result r-annuaire-result">
240
+ <ContactContent queryUrl={props.queryUrl} onChange={clickID} />
241
+ </div>
242
+ {displayMap && (
243
+ <div
244
+ className="r-map annuaire-map"
245
+ style={{
246
+ top: style.height + headerHeight,
247
+ height: "calc(100vh-" + style.height + headerHeight,
248
+ }}
249
+ >
250
+ {MapRender}
251
+ </div>
252
+ )}
223
253
  </div>
224
- }
225
- </div>
226
- }>
227
-
228
- </Route>
254
+ }
255
+ ></Route>
229
256
  </Routes>
230
257
  </div>
231
258
  );
232
- }
259
+ }
@@ -36,18 +36,7 @@ body .outer-wrapper {
36
36
  padding: 0 !important;
37
37
  }
38
38
 
39
- .r-result-filter-container {
40
- @media screen and (min-width:1200px) {
41
- position: sticky;
42
- }
43
-
44
- background: #fff;
45
- z-index: 1;
46
- }
47
39
 
48
- .annuaire-result-filter {
49
- padding: 0 .75rem;
50
- }
51
40
 
52
41
  #portal-column-content {
53
42
  h1 {
@@ -83,17 +72,6 @@ article>header {
83
72
 
84
73
  /////////
85
74
 
86
-
87
-
88
- .r-results-numbers {
89
- width: 100%;
90
- margin-bottom: 0.5rem;
91
-
92
- span {
93
- font-weight: bold;
94
- }
95
- }
96
-
97
75
  .r-wrapper {
98
76
  display: block;
99
77
 
@@ -142,6 +120,10 @@ article>header {
142
120
  z-index: -1;
143
121
  background-color: #000;
144
122
 
123
+ &.r-item-img-placeholder {
124
+ background: #f2f2f2;
125
+ }
126
+
145
127
  @media screen and (min-width:600px) {
146
128
  width: 246px;
147
129
  height: 149px;
@@ -5,8 +5,7 @@ const ContactCard = ({ item }) => {
5
5
  const [image, setImage] = useState(new Image());
6
6
  const [imageClassName, setImageClassName] = useState("");
7
7
  const title = item.title && item.title;
8
- const category =
9
- item.taxonomy_contact_category && item.taxonomy_contact_category[0];
8
+ const category = item.taxonomy_contact_category && item.taxonomy_contact_category[0];
10
9
  const number = item.number ? item.number : "";
11
10
  const street = item.street ? item.street : "";
12
11
  const complement = item.complement ? item.complement : "";
@@ -15,7 +14,7 @@ const ContactCard = ({ item }) => {
15
14
  const phones = item.phones ? item.phones : "";
16
15
  const mails = item.mails ? item.mails : "";
17
16
  const topics = item.topics ? item.topics : "";
18
- let countryTitle = item.country && item.country.title
17
+ let countryTitle = item.country && item.country.title;
19
18
  let itineraryLink =
20
19
  "https://www.google.com/maps/dir/?api=1&destination=" +
21
20
  item.street +
@@ -28,9 +27,9 @@ const ContactCard = ({ item }) => {
28
27
  "+" +
29
28
  item.city +
30
29
  "+" +
31
- countryTitle
30
+ countryTitle;
32
31
 
33
- itineraryLink = itineraryLink.replaceAll('+null', '')
32
+ itineraryLink = itineraryLink.replaceAll("+null", "");
34
33
 
35
34
  // Set image and image className
36
35
  useEffect(() => {
@@ -58,20 +57,25 @@ const ContactCard = ({ item }) => {
58
57
 
59
58
  return (
60
59
  <div className="r-list-item">
61
- {image && image.src
62
- ? <>
60
+ {image && image.src ? (
61
+ <>
63
62
  <div className="r-item-img">
64
- <div className="r-content-figure-blur"
63
+ <div
64
+ className="r-content-figure-blur"
65
65
  style={{ backgroundImage: "url(" + image.src + ")" }}
66
66
  />
67
- <img className={"r-content-figure-img" + " " + imageClassName}
68
- src={image.src} alt="" />
67
+ <img
68
+ className={"r-content-figure-img" + " " + imageClassName}
69
+ src={image.src}
70
+ alt=""
71
+ />
69
72
  </div>
70
73
  </>
71
- : <>
74
+ ) : (
75
+ <>
72
76
  <div className="r-item-img r-item-img-placeholder"></div>
73
77
  </>
74
- }
78
+ )}
75
79
  <div className="r-item-text">
76
80
  <span className="r-item-title">{title}</span>
77
81
  {category ? <span className="r-item-categorie">{category.title}</span> : ""}
@@ -97,22 +101,22 @@ const ContactCard = ({ item }) => {
97
101
  <div className="phones">
98
102
  {phones
99
103
  ? phones.map((phone, i) => {
100
- return <span key={i}>{phone.number}</span>;
101
- })
104
+ return <span key={i}>{phone.number}</span>;
105
+ })
102
106
  : ""}
103
107
  </div>
104
108
  <div className="mails">
105
109
  {mails
106
110
  ? mails.map((mail, i) => {
107
- return <span key={i}>{mail.mail_address}</span>;
108
- })
111
+ return <span key={i}>{mail.mail_address}</span>;
112
+ })
109
113
  : ""}
110
114
  </div>
111
115
  <div className="topics">
112
116
  {topics
113
117
  ? topics.map((mail, i) => {
114
- return <span key={i}>{mail.title}</span>;
115
- })
118
+ return <span key={i}>{mail.title}</span>;
119
+ })
116
120
  : ""}
117
121
  </div>
118
122
  </div>
@@ -128,7 +128,9 @@ const ContactContent = ({ queryUrl, onChange }) => {
128
128
  <ReactMarkdown>{item.description}</ReactMarkdown>
129
129
  </div>
130
130
  <div className="contactTextAll">
131
- <p className="annuaire-info-title"><Translate text="Infos pratiques" /></p>
131
+ <p className="annuaire-info-title">
132
+ <Translate text="Infos pratiques" />
133
+ </p>
132
134
  {item.category ? <span>{item.category}</span> : ""}
133
135
  {item.street ? (
134
136
  <div className="annaire-adresse">
@@ -190,7 +192,7 @@ const ContactContent = ({ queryUrl, onChange }) => {
190
192
  : "annuaire-day-open"
191
193
  }
192
194
  >
193
- <Translate text={item.schedule_for_today} />
195
+ <Translate text={item.schedule_for_today} />
194
196
  </span>
195
197
  <svg
196
198
  xmlns="http://www.w3.org/2000/svg"
@@ -25,7 +25,12 @@ const ContactList = ({ contactArray, onChange, onHover, parentCallback }) => {
25
25
  className="r-list-item-link"
26
26
  style={{ textDecoration: "none" }}
27
27
  to={{
28
- pathname: "/" + removeAccents(item.title).replace(/[^a-zA-Z ]/g, "").replace(/\s/g, "-").toLowerCase(),
28
+ pathname:
29
+ "/" +
30
+ removeAccents(item.title)
31
+ .replace(/[^a-zA-Z ]/g, "")
32
+ .replace(/\s/g, "-")
33
+ .toLowerCase(),
29
34
  search: `?u=${item.UID}`,
30
35
  state: {
31
36
  idItem: item.UID,
@@ -39,4 +44,4 @@ const ContactList = ({ contactArray, onChange, onHover, parentCallback }) => {
39
44
  </React.Fragment>
40
45
  );
41
46
  };
42
- export default ContactList;
47
+ export default ContactList;