imio.smartweb.core 1.2.38__py3-none-any.whl → 1.2.39__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.
- imio/smartweb/core/contents/rest/events/content.py +7 -0
- imio/smartweb/core/contents/rest/events/view.pt +1 -0
- imio/smartweb/core/contents/rest/events/view.py +4 -0
- imio/smartweb/core/contents/sections/common_templates/carousel.pt +5 -1
- imio/smartweb/core/contents/sections/events/content.py +7 -0
- imio/smartweb/core/contents/sections/events/view.py +7 -0
- imio/smartweb/core/contents/sections/external_content/view.pt +3 -3
- imio/smartweb/core/contents/sections/news/content.py +7 -0
- imio/smartweb/core/contents/sections/news/view.py +7 -0
- imio/smartweb/core/contents/sections/views.py +4 -0
- imio/smartweb/core/webcomponents/build/10512eee43c7b5ed4757.svg +1 -0
- imio/smartweb/core/webcomponents/build/10dd862b2cdd9c68e1a8.svg +1 -0
- imio/smartweb/core/webcomponents/build/1c1605a5fe9a2b10a88f.png +1 -0
- imio/smartweb/core/webcomponents/build/524db40e119aa11f4478.png +1 -0
- imio/smartweb/core/webcomponents/build/57d3b7cb1ab874660b39.svg +1 -0
- imio/smartweb/core/webcomponents/build/6cf03871df23ed2ee8b3.png +1 -0
- imio/smartweb/core/webcomponents/build/a38272f263f8328349f2.svg +1 -0
- imio/smartweb/core/webcomponents/build/css/373.smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/css/486.smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/css/686.smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/css/919.smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/css/smartweb-webcomponents-compiled.css +1 -1
- imio/smartweb/core/webcomponents/build/f79b479fdc5c0fe0d553.svg +1 -0
- imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/218.smartweb-webcomponents-compiled.js.LICENSE.txt +5 -8
- imio/smartweb/core/webcomponents/build/js/373.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/486.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/496.smartweb-webcomponents-compiled.js +2 -0
- imio/smartweb/core/webcomponents/build/js/{674.smartweb-webcomponents-compiled.js.LICENSE.txt → 496.smartweb-webcomponents-compiled.js.LICENSE.txt} +1 -8
- imio/smartweb/core/webcomponents/build/js/686.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/736.smartweb-webcomponents-compiled.js +2 -0
- imio/smartweb/core/webcomponents/build/js/736.smartweb-webcomponents-compiled.js.LICENSE.txt +32 -0
- imio/smartweb/core/webcomponents/build/js/799.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/824.smartweb-webcomponents-compiled.js +2 -0
- imio/smartweb/core/webcomponents/build/js/919.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/smartweb-webcomponents-compiled.js.LICENSE.txt +11 -14
- imio/smartweb/core/webcomponents/package.json +40 -40
- imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.jsx +17 -9
- imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.scss +227 -141
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/ContactContent.jsx +7 -6
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactList/ContactList.jsx +2 -2
- imio/smartweb/core/webcomponents/src/components/Annuaire/Filters/Filter.jsx +18 -18
- imio/smartweb/core/webcomponents/src/components/Annuaire/index.js +1 -1
- imio/smartweb/core/webcomponents/src/components/Events/EventCard/EventCard.jsx +2 -2
- imio/smartweb/core/webcomponents/src/components/Events/EventContent/EventContent.jsx +8 -8
- imio/smartweb/core/webcomponents/src/components/Events/EventList/EventList.jsx +2 -2
- imio/smartweb/core/webcomponents/src/components/Events/Events.jsx +20 -11
- imio/smartweb/core/webcomponents/src/components/Events/Events.scss +244 -161
- imio/smartweb/core/webcomponents/src/components/Events/Filters/Filter.jsx +9 -8
- imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.jsx +27 -27
- imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.scss +10 -7
- imio/smartweb/core/webcomponents/src/components/News/Filters/Filter.jsx +11 -12
- imio/smartweb/core/webcomponents/src/components/News/News.jsx +53 -45
- imio/smartweb/core/webcomponents/src/components/News/NewsContent/NewsContent.jsx +101 -100
- imio/smartweb/core/webcomponents/src/components/News/NewsList/NewsList.jsx +3 -3
- imio/smartweb/core/webcomponents/src/components/Search/ContactResult/ContactResult.jsx +11 -11
- imio/smartweb/core/webcomponents/src/components/Search/EventsResult/EventsResult.jsx +11 -11
- imio/smartweb/core/webcomponents/src/components/Search/Filters/Filter.jsx +4 -5
- imio/smartweb/core/webcomponents/src/components/Search/NewsResult/NewsResult.jsx +5 -5
- imio/smartweb/core/webcomponents/src/components/Search/Search.jsx +5 -4
- imio/smartweb/core/webcomponents/src/components/Search/Search.scss +125 -105
- imio/smartweb/core/webcomponents/src/components/Search/WebResult/WebResult.jsx +2 -2
- imio/smartweb/core/webcomponents/src/components/Search/index.js +1 -1
- imio/smartweb/core/webcomponents/src/hooks/useAxios.js +3 -3
- imio/smartweb/core/webcomponents/src/hooks/useFilterQuery.js +1 -2
- imio/smartweb/core/webcomponents/src/index.jsx +3 -3
- imio/smartweb/core/webcomponents/src/index.scss +86 -22
- imio/smartweb/core/webcomponents/src/utils/Map.jsx +10 -10
- imio/smartweb/core/webcomponents/src/utils/Map.scss +2 -2
- imio/smartweb/core/webcomponents/src/utils/translation.js +8 -8
- {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.39.dist-info}/METADATA +15 -3
- {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.39.dist-info}/RECORD +80 -71
- {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.39.dist-info}/WHEEL +1 -1
- imio/smartweb/core/webcomponents/build/js/209.smartweb-webcomponents-compiled.js +0 -2
- imio/smartweb/core/webcomponents/build/js/40.smartweb-webcomponents-compiled.js +0 -1
- imio/smartweb/core/webcomponents/build/js/674.smartweb-webcomponents-compiled.js +0 -2
- /imio/smartweb/core/webcomponents/build/js/{209.smartweb-webcomponents-compiled.js.LICENSE.txt → 824.smartweb-webcomponents-compiled.js.LICENSE.txt} +0 -0
- /imio.smartweb.core-1.2.38-py3.8-nspkg.pth → /imio.smartweb.core-1.2.39-py3.10-nspkg.pth +0 -0
- {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.39.dist-info}/LICENSE.GPL +0 -0
- {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.39.dist-info}/LICENSE.rst +0 -0
- {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.39.dist-info}/namespace_packages.txt +0 -0
- {imio.smartweb.core-1.2.38.dist-info → imio.smartweb.core-1.2.39.dist-info}/top_level.txt +0 -0
@@ -1,12 +1,12 @@
|
|
1
1
|
|
2
2
|
|
3
|
-
import React, { useState,useContext } from "react";
|
3
|
+
import React, { useState, useContext } from "react";
|
4
4
|
import DatePicker from 'react-datepicker';
|
5
5
|
import 'react-datepicker/dist/react-datepicker.css';
|
6
6
|
import moment from "moment";
|
7
7
|
import { Dropdown, DropdownButton } from 'react-bootstrap';
|
8
8
|
import { Translate, Translator } from "react-translated";
|
9
|
-
import { nl,fr,enGB,de } from 'date-fns/locale';
|
9
|
+
import { nl, fr, enGB, de } from 'date-fns/locale';
|
10
10
|
import './DateFilter.scss';
|
11
11
|
|
12
12
|
const languageList = {
|
@@ -28,9 +28,9 @@ function DateFilter({ language, setDates }) {
|
|
28
28
|
const filteredDates = dates.filter(date => date !== null);
|
29
29
|
const formattedDates = filteredDates.map(date => moment(date).format('YYYY-MM-DD'));
|
30
30
|
setDates({ "event_dates.query": formattedDates });
|
31
|
-
if(e.every(item => item === null)){
|
31
|
+
if (e.every(item => item === null)) {
|
32
32
|
setFilter(periodTitle.all);
|
33
|
-
}else {
|
33
|
+
} else {
|
34
34
|
setFilter(periodTitle.custom);
|
35
35
|
}
|
36
36
|
};
|
@@ -43,7 +43,7 @@ function DateFilter({ language, setDates }) {
|
|
43
43
|
thisWeekEnd: <Translate text='Ce week-end' />,
|
44
44
|
thisWeek: <Translate text='Cette semaine' />,
|
45
45
|
thisMonth: <Translate text='Ce mois-ci' />,
|
46
|
-
custom: <Translate text='Personnalisé (Du ... au ...)'/>
|
46
|
+
custom: <Translate text='Personnalisé (Du ... au ...)' />
|
47
47
|
}
|
48
48
|
|
49
49
|
const handleSelect = (eventKey) => {
|
@@ -97,27 +97,27 @@ function DateFilter({ language, setDates }) {
|
|
97
97
|
<Dropdown.Item eventKey="thisWeek">{periodTitle.thisWeek}</Dropdown.Item>
|
98
98
|
<Dropdown.Item eventKey="thisMonth">{periodTitle.thisMonth}</Dropdown.Item>
|
99
99
|
<div className="perdiod-filter-range">
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
100
|
+
{languageToLocale && <Translator>
|
101
|
+
{({ translate, language }) => (
|
102
|
+
<DatePicker
|
103
|
+
dateFormat="dd/MM/yyyy"
|
104
|
+
placeholderText={translate({
|
105
|
+
text: 'Personnalisé (Du ... au ...)'
|
106
|
+
})}
|
107
|
+
selectsRange={true}
|
108
|
+
startDate={startDate}
|
109
|
+
endDate={endDate}
|
110
|
+
minDate={new Date().setDate(new Date().getDate() + 1)}
|
111
|
+
onChange={(update) => {
|
112
|
+
setDateRange(update);
|
113
|
+
if (update[0] !== null && update[1] !== null || update[0] == null && update[1] == null) {
|
114
|
+
handleApply(update)
|
115
|
+
}
|
116
|
+
}}
|
117
|
+
isClearable={true}
|
118
|
+
locale={languageToLocale}
|
119
|
+
/>
|
120
|
+
)}
|
121
121
|
</Translator>}
|
122
122
|
</div>
|
123
123
|
</DropdownButton>
|
@@ -126,4 +126,4 @@ function DateFilter({ language, setDates }) {
|
|
126
126
|
);
|
127
127
|
}
|
128
128
|
|
129
|
-
export default DateFilter;
|
129
|
+
export default DateFilter;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.period-filter {
|
2
2
|
.period-filter-toggler {
|
3
|
-
|
3
|
+
&>button {
|
4
4
|
background: transparent;
|
5
5
|
color: hsl(0, 0%, 20%);
|
6
6
|
box-sizing: border-box;
|
@@ -8,7 +8,7 @@
|
|
8
8
|
font-size: 12px;
|
9
9
|
text-transform: uppercase;
|
10
10
|
letter-spacing: 1.2px;
|
11
|
-
|
11
|
+
|
12
12
|
-webkit-box-pack: justify;
|
13
13
|
-webkit-justify-content: space-between;
|
14
14
|
justify-content: space-between;
|
@@ -24,17 +24,19 @@
|
|
24
24
|
border-width: 1px;
|
25
25
|
box-sizing: border-box;
|
26
26
|
height: 50px;
|
27
|
+
|
27
28
|
&:hover {
|
28
29
|
background-color: transparent;
|
29
30
|
border-color: hsl(0, 0%, 70%);
|
30
31
|
color: hsl(0, 0%, 20%);
|
31
32
|
}
|
33
|
+
|
32
34
|
&:focus,
|
33
35
|
&:active {
|
34
|
-
border-color: #2684FF!important;
|
35
|
-
background: transparent!important;
|
36
|
-
color: hsl(0, 0%, 20%)!important;
|
37
|
-
box-shadow: 0 0 0 1px #2684FF!important;
|
36
|
+
border-color: #2684FF !important;
|
37
|
+
background: transparent !important;
|
38
|
+
color: hsl(0, 0%, 20%) !important;
|
39
|
+
box-shadow: 0 0 0 1px #2684FF !important;
|
38
40
|
}
|
39
41
|
}
|
40
42
|
}
|
@@ -43,11 +45,12 @@
|
|
43
45
|
|
44
46
|
.perdiod-filter-range {
|
45
47
|
padding: 5px 16px;
|
48
|
+
|
46
49
|
input {
|
47
50
|
border: solid 1px hsl(0, 0%, 42%) !important;
|
48
51
|
border-radius: 5px;
|
49
52
|
padding: 5px 9px;
|
50
53
|
color: hsl(0, 0%, 20%);
|
51
|
-
border: solid 1px hsl(0, 0%, 70%)!important;
|
54
|
+
border: solid 1px hsl(0, 0%, 70%) !important;
|
52
55
|
}
|
53
56
|
}
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import React, { useEffect, useCallback, useRef, useState } from "react";
|
2
2
|
import Select from "react-select";
|
3
|
-
import {
|
3
|
+
import { useNavigate } from "react-router-dom";
|
4
4
|
import useAxios from "../../../hooks/useAxios";
|
5
5
|
import { Translator } from "react-translated";
|
6
|
+
import queryString from 'query-string';
|
6
7
|
|
7
8
|
function Filters(props) {
|
8
|
-
let
|
9
|
-
const queryString = require("query-string");
|
10
|
-
|
9
|
+
let navigate = useNavigate();
|
11
10
|
const [inputValues, setInputValues] = useState(props.activeFilter);
|
12
11
|
const [topicsFilter, setTopicsFilter] = useState(null);
|
13
12
|
const [taxonomyFilter, setTaxonomyFilter] = useState(null);
|
@@ -29,9 +28,9 @@ function Filters(props) {
|
|
29
28
|
}));
|
30
29
|
const optionsTaxonomy = response.category
|
31
30
|
? response.category.map((d) => ({
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
value: d.token,
|
32
|
+
label: d.title,
|
33
|
+
}))
|
35
34
|
: "";
|
36
35
|
setTopicsFilter(optionsTopics);
|
37
36
|
setTaxonomyFilter(optionsTaxonomy);
|
@@ -69,7 +68,7 @@ function Filters(props) {
|
|
69
68
|
firstUpdate.current = false;
|
70
69
|
return;
|
71
70
|
}
|
72
|
-
|
71
|
+
navigate({
|
73
72
|
pathname: "./",
|
74
73
|
search: queryString.stringify(inputValues),
|
75
74
|
});
|
@@ -124,7 +123,7 @@ function Filters(props) {
|
|
124
123
|
onChange={onChangeHandler}
|
125
124
|
placeholder={translate({
|
126
125
|
text: 'Recherche'
|
127
|
-
|
126
|
+
})}
|
128
127
|
/>
|
129
128
|
)}
|
130
129
|
</Translator>
|
@@ -144,7 +143,7 @@ function Filters(props) {
|
|
144
143
|
options={topicsFilter && topicsFilter}
|
145
144
|
placeholder={translate({
|
146
145
|
text: 'Thématiques'
|
147
|
-
|
146
|
+
})}
|
148
147
|
value={actTopi && actTopi[0]}
|
149
148
|
/>
|
150
149
|
)}
|
@@ -163,7 +162,7 @@ function Filters(props) {
|
|
163
162
|
options={taxonomyFilter && taxonomyFilter}
|
164
163
|
placeholder={translate({
|
165
164
|
text: 'Catégories'
|
166
|
-
|
165
|
+
})}
|
167
166
|
value={actTaxo && actTaxo[0]}
|
168
167
|
/>
|
169
168
|
)}
|
@@ -173,4 +172,4 @@ function Filters(props) {
|
|
173
172
|
);
|
174
173
|
}
|
175
174
|
|
176
|
-
export default Filters;
|
175
|
+
export default Filters;
|
@@ -1,5 +1,9 @@
|
|
1
1
|
import React, { useEffect, useState, createContext, useContex } from "react";
|
2
|
-
import {
|
2
|
+
import {
|
3
|
+
BrowserRouter,
|
4
|
+
Routes,
|
5
|
+
Route,
|
6
|
+
} from "react-router-dom";
|
3
7
|
import Filters from "./Filters/Filter";
|
4
8
|
import NewsContent from "./NewsContent/NewsContent";
|
5
9
|
import NewsList from "./NewsList/NewsList";
|
@@ -8,12 +12,13 @@ import "./News.scss";
|
|
8
12
|
import useFilterQuery from "../../hooks/useFilterQuery";
|
9
13
|
import { Provider, Translate } from "react-translated";
|
10
14
|
import translation from '../../utils/translation';
|
15
|
+
import queryString from 'query-string';
|
11
16
|
|
12
17
|
export const LanguageContext = createContext("fr");
|
13
18
|
export default function News(props) {
|
14
19
|
return (
|
15
20
|
<LanguageContext.Provider value={props.currentLanguage}>
|
16
|
-
<
|
21
|
+
<BrowserRouter basename={props.viewPath}>
|
17
22
|
<Provider language={props.currentLanguage} translation={translation}>
|
18
23
|
<NewsView
|
19
24
|
queryFilterUrl={props.queryFilterUrl}
|
@@ -22,12 +27,11 @@ export default function News(props) {
|
|
22
27
|
batchSize={props.batchSize}
|
23
28
|
/>
|
24
29
|
</Provider>
|
25
|
-
</
|
30
|
+
</BrowserRouter>
|
26
31
|
</LanguageContext.Provider>
|
27
32
|
);
|
28
33
|
}
|
29
34
|
const NewsView = (props) => {
|
30
|
-
const queryString = require("query-string");
|
31
35
|
const { u, ...parsed } = Object.assign(
|
32
36
|
{ b_start: 0, fullobjects: 1 },
|
33
37
|
queryString.parse(useFilterQuery().toString())
|
@@ -104,58 +108,62 @@ const NewsView = (props) => {
|
|
104
108
|
<div>
|
105
109
|
<div className="r-wrapper r-actu-wrapper">
|
106
110
|
<div className="r-result r-annuaire-result">
|
107
|
-
<
|
108
|
-
<Route exact path="/"
|
109
|
-
|
110
|
-
<
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
<
|
111
|
+
<Routes>
|
112
|
+
<Route exact path="/" element={
|
113
|
+
<>
|
114
|
+
<div className="r-result-filter actu-result-filter">
|
115
|
+
<Filters
|
116
|
+
url={props.queryFilterUrl}
|
117
|
+
activeFilter={filters}
|
118
|
+
onChange={filtersChange}
|
119
|
+
/>
|
120
|
+
{props.proposeUrl &&
|
121
|
+
(
|
122
|
+
<div className="r-add-news">
|
123
|
+
<a target="_blank" href={props.proposeUrl}><Translate text='Proposer une actualité' /></a>
|
124
|
+
</div>
|
125
|
+
)
|
126
|
+
}
|
127
|
+
{itemsNumber > 0 ? (
|
128
|
+
<p className="r-results-numbers">
|
129
|
+
<span>{itemsNumber}</span>{" "}
|
130
|
+
{itemsNumber > 1
|
131
|
+
? <Translate text='Actualités trouvées' />
|
132
|
+
: <Translate text='Actualité trouvée' />}
|
133
|
+
</p>
|
134
|
+
) : (
|
135
|
+
<p className="r-results-numbers"><Translate text='Aucun résultat' /></p>
|
136
|
+
)}
|
137
|
+
</div>
|
138
|
+
<div>{listRender}</div>
|
139
|
+
<div className="r-load-more">
|
140
|
+
{itemsNumber - props.batchSize > batchStart ? (
|
141
|
+
<div>
|
142
|
+
<span className="no-more-result">
|
143
|
+
{isLoading ? divLoader : ""}
|
144
|
+
</span>
|
145
|
+
<button onClick={loadMore} className="btn-grad">
|
146
|
+
{isLoading ? <Translate text='Chargement...' /> : <Translate text='Plus de résultats' />}
|
147
|
+
</button>
|
119
148
|
</div>
|
120
|
-
)
|
121
|
-
}
|
122
|
-
{itemsNumber > 0 ? (
|
123
|
-
<p className="r-results-numbers">
|
124
|
-
<span>{itemsNumber}</span>{" "}
|
125
|
-
{itemsNumber > 1
|
126
|
-
? <Translate text='Actualités trouvées' />
|
127
|
-
: <Translate text='Actualité trouvée' />}
|
128
|
-
</p>
|
129
|
-
) : (
|
130
|
-
<p className="r-results-numbers"><Translate text='Aucun résultat' /></p>
|
131
|
-
)}
|
132
|
-
</div>
|
133
|
-
<div>{listRender}</div>
|
134
|
-
<div className="r-load-more">
|
135
|
-
{itemsNumber - props.batchSize > batchStart ? (
|
136
|
-
<div>
|
149
|
+
) : (
|
137
150
|
<span className="no-more-result">
|
138
151
|
{isLoading ? divLoader : ""}
|
139
152
|
</span>
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
) : (
|
145
|
-
<span className="no-more-result">
|
146
|
-
{isLoading ? divLoader : ""}
|
147
|
-
</span>
|
148
|
-
)}
|
149
|
-
</div>
|
153
|
+
)}
|
154
|
+
</div>
|
155
|
+
</>
|
156
|
+
}>
|
150
157
|
</Route>
|
151
|
-
<Route path={"/:name"}
|
158
|
+
<Route path={"/:name"} element={
|
152
159
|
<NewsContent
|
153
160
|
onChange={clickID}
|
154
161
|
onReturn={filtersChange}
|
155
162
|
queryUrl={props.queryUrl}
|
156
163
|
/>
|
164
|
+
}>
|
157
165
|
</Route>
|
158
|
-
</
|
166
|
+
</Routes>
|
159
167
|
</div>
|
160
168
|
</div>
|
161
169
|
</div>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
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";
|
@@ -8,72 +8,73 @@ 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
|
+
import queryString from 'query-string';
|
12
|
+
|
11
13
|
const ContactContent = ({ queryUrl, onChange }) => {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
}, [response]);
|
14
|
+
let navigate = useNavigate();
|
15
|
+
const parsed = queryString.parse(useFilterQuery().toString());
|
16
|
+
const parsed2 = { ...parsed, UID: parsed["u"], fullobjects: 1 };
|
17
|
+
const [params, setParams] = useState(parsed2);
|
18
|
+
const [item, setitem] = useState({});
|
19
|
+
const [files, setFiles] = useState();
|
20
|
+
const [gallery, setGallery] = useState();
|
21
|
+
const { response, error, isLoading } = useAxios(
|
22
|
+
{
|
23
|
+
method: "get",
|
24
|
+
url: "",
|
25
|
+
baseURL: queryUrl,
|
26
|
+
headers: {
|
27
|
+
Accept: "application/json",
|
28
|
+
},
|
29
|
+
params: params,
|
30
|
+
},
|
31
|
+
[]
|
32
|
+
);
|
33
|
+
useEffect(() => {
|
34
|
+
if (response !== null) {
|
35
|
+
setitem(response.items[0]);
|
36
|
+
}
|
37
|
+
window.scrollTo(0, 0);
|
38
|
+
}, [response]);
|
38
39
|
|
39
40
|
/// use to set file and gallery items
|
40
41
|
useEffect(() => {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
if (item.items && item.items.length > 0) {
|
43
|
+
setFiles(item.items.filter(files => files['@type'] === 'File'));
|
44
|
+
setGallery(item.items.filter(files => files['@type'] === 'Image'));
|
45
|
+
}
|
46
|
+
}, [item]);
|
46
47
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
function handleClick() {
|
49
|
+
navigate("..");
|
50
|
+
onChange(null);
|
51
|
+
}
|
51
52
|
moment.locale('fr')
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
53
|
+
const created = moment(item.created).startOf('minute').fromNow();
|
54
|
+
const lastModified = moment(item.modified).startOf('minute').fromNow();
|
55
|
+
return (
|
56
|
+
<div className="new-content r-content">
|
57
|
+
<button type="button" onClick={handleClick}>
|
57
58
|
<Translate text="Retour" />
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
59
|
+
</button>
|
60
|
+
<article>
|
61
|
+
<header>
|
62
|
+
<h2 className="r-content-title">{item.title}</h2>
|
63
|
+
<div className="r-content-description">
|
64
|
+
<ReactMarkdown>{item.description}</ReactMarkdown>
|
65
|
+
</div>
|
66
|
+
</header>
|
67
|
+
<figure>
|
68
|
+
<div
|
69
|
+
className="r-content-img"
|
70
|
+
style={{
|
71
|
+
backgroundImage: item.image_affiche_scale
|
72
|
+
? "url(" + item.image_affiche_scale + ")"
|
73
|
+
: "",
|
74
|
+
}}
|
75
|
+
/>
|
76
|
+
</figure>
|
77
|
+
<div className="r-content-news-info">
|
77
78
|
<div className="r-content-news-info-container">
|
78
79
|
{/* date */}
|
79
80
|
<div className="r-content-news-info-schedul">
|
@@ -88,26 +89,26 @@ const ContactContent = ({ queryUrl, onChange }) => {
|
|
88
89
|
</div>
|
89
90
|
<div className="dpinlb">
|
90
91
|
<div className="r-content-news-info--date">
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
92
|
+
<div className="r-content-date">
|
93
|
+
{
|
94
|
+
created === lastModified ?
|
95
|
+
(
|
96
|
+
<div className="r-content-date-publish">
|
97
|
+
<span>Publié {created}</span>
|
98
|
+
</div>
|
99
|
+
) :
|
100
|
+
(
|
101
|
+
<div>
|
102
|
+
<div className="r-content-date-publish">
|
103
|
+
<span>Publié {created}</span>
|
104
|
+
</div>
|
105
|
+
<div className="r-card-date-last">
|
106
|
+
<span>Actualisé {lastModified} </span>
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
)
|
110
|
+
}
|
107
111
|
</div>
|
108
|
-
)
|
109
|
-
}
|
110
|
-
</div>
|
111
112
|
</div>
|
112
113
|
</div>
|
113
114
|
</div>
|
@@ -217,32 +218,32 @@ const ContactContent = ({ queryUrl, onChange }) => {
|
|
217
218
|
)}
|
218
219
|
</div>
|
219
220
|
</div>
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
221
|
+
<div
|
222
|
+
className="r-content-text"
|
223
|
+
dangerouslySetInnerHTML={{
|
224
|
+
__html: item.text && item.text.data,
|
225
|
+
}}
|
226
|
+
></div>
|
226
227
|
{/* add files to download */}
|
227
228
|
{
|
228
229
|
files &&
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
230
|
+
<div className="r-content-files">
|
231
|
+
{files.map((file, i) => (
|
232
|
+
<div className="r-content-file">
|
233
|
+
<a key={i} href={file.targetUrl} className="r-content-file-link" rel="nofollow">
|
234
|
+
<span className="r-content-file-title">{file.title}</span>
|
235
|
+
<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>
|
236
|
+
</a>
|
237
|
+
</div>
|
238
|
+
))}
|
239
|
+
</div>
|
239
240
|
}
|
240
241
|
{/* add gallery */}
|
241
242
|
{
|
242
243
|
gallery &&
|
243
244
|
<div className="r-content-gallery">
|
244
245
|
<div class="spotlight-group flexbin r-content-gallery">
|
245
|
-
{gallery.map((image,i) => (
|
246
|
+
{gallery.map((image, i) => (
|
246
247
|
<a key={i} class="spotlight" href={image.image_full_scale} >
|
247
248
|
<img src={image.image_preview_scale} alt="" />
|
248
249
|
</a>
|
@@ -250,8 +251,8 @@ const ContactContent = ({ queryUrl, onChange }) => {
|
|
250
251
|
</div>
|
251
252
|
</div>
|
252
253
|
}
|
253
|
-
|
254
|
-
|
255
|
-
|
254
|
+
</article>
|
255
|
+
</div>
|
256
|
+
);
|
256
257
|
};
|
257
|
-
export default ContactContent;
|
258
|
+
export default ContactContent;
|
@@ -19,14 +19,14 @@ const NewsList = ({ itemsArray, onChange, parentCallback }) => {
|
|
19
19
|
className="r-news-list-item-link"
|
20
20
|
style={{ textDecoration: "none" }}
|
21
21
|
to={{
|
22
|
-
pathname: "/"+removeAccents(item.title).replace(/[^a-zA-Z ]/g, "").replace(/\s/g, "-").toLowerCase(),
|
22
|
+
pathname: "/" + removeAccents(item.title).replace(/[^a-zA-Z ]/g, "").replace(/\s/g, "-").toLowerCase(),
|
23
23
|
search: `?u=${item.UID}`,
|
24
24
|
state: {
|
25
25
|
idItem: item.UID,
|
26
26
|
},
|
27
27
|
}}
|
28
28
|
>
|
29
|
-
|
29
|
+
<NewsCard item={item} key={item.created} />
|
30
30
|
</Link>
|
31
31
|
</li>
|
32
32
|
))}
|
@@ -34,4 +34,4 @@ const NewsList = ({ itemsArray, onChange, parentCallback }) => {
|
|
34
34
|
</React.Fragment>
|
35
35
|
);
|
36
36
|
};
|
37
|
-
export default NewsList;
|
37
|
+
export default NewsList;
|