imio.smartweb.core 1.2.65__py3-none-any.whl → 1.2.66__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/browser/faceted/block_view.pt +4 -4
- imio/smartweb/core/browser/faceted/summary_view.pt +4 -4
- imio/smartweb/core/browser/static/smartweb-view-compiled.css +1 -1
- imio/smartweb/core/browser/static/src/view.less +4 -0
- imio/smartweb/core/contents/folder/block_view.pt +8 -8
- imio/smartweb/core/contents/folder/summary_view.pt +4 -4
- imio/smartweb/core/contents/rest/directory/view.pt +2 -1
- imio/smartweb/core/contents/rest/events/view.pt +2 -1
- imio/smartweb/core/contents/rest/news/view.pt +2 -1
- imio/smartweb/core/contents/rest/view.py +4 -0
- imio/smartweb/core/contents/sections/external_content/view.pt +1 -1
- imio/smartweb/core/webcomponents/build/css/smartweb-webcomponents-compiled.css +1 -1
- 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/884.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.jsx +12 -2
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactCard/ContactCard.jsx +76 -61
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/ContactContent.jsx +14 -1
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactList/ContactList.jsx +6 -2
- imio/smartweb/core/webcomponents/src/components/Events/EventCard/EventCard.jsx +56 -39
- imio/smartweb/core/webcomponents/src/components/Events/EventContent/EventContent.jsx +17 -3
- imio/smartweb/core/webcomponents/src/components/Events/EventList/EventList.jsx +10 -7
- imio/smartweb/core/webcomponents/src/components/Events/Events.jsx +4 -2
- imio/smartweb/core/webcomponents/src/components/News/News.jsx +3 -0
- imio/smartweb/core/webcomponents/src/components/News/NewsCard/NewsCard.jsx +60 -48
- imio/smartweb/core/webcomponents/src/components/News/NewsContent/NewsContent.jsx +17 -3
- imio/smartweb/core/webcomponents/src/components/News/NewsList/NewsList.jsx +15 -7
- imio/smartweb/core/webcomponents/src/index.scss +188 -174
- imio.smartweb.core-1.2.66-py3.8-nspkg.pth +2 -0
- {imio.smartweb.core-1.2.65.dist-info → imio.smartweb.core-1.2.66.dist-info}/METADATA +15 -3
- {imio.smartweb.core-1.2.65.dist-info → imio.smartweb.core-1.2.66.dist-info}/RECORD +36 -36
- {imio.smartweb.core-1.2.65.dist-info → imio.smartweb.core-1.2.66.dist-info}/WHEEL +1 -1
- imio.smartweb.core-1.2.65-py3.10-nspkg.pth +0 -3
- {imio.smartweb.core-1.2.65.dist-info → imio.smartweb.core-1.2.66.dist-info}/LICENSE.GPL +0 -0
- {imio.smartweb.core-1.2.65.dist-info → imio.smartweb.core-1.2.66.dist-info}/LICENSE.rst +0 -0
- {imio.smartweb.core-1.2.65.dist-info → imio.smartweb.core-1.2.66.dist-info}/namespace_packages.txt +0 -0
- {imio.smartweb.core-1.2.65.dist-info → imio.smartweb.core-1.2.66.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
2
2
|
import { Translate } from "react-translated";
|
3
3
|
|
4
|
-
const ContactCard = ({ item }) => {
|
4
|
+
const ContactCard = ({ item, contextAuthenticatedUser }) => {
|
5
5
|
const [image, setImage] = useState(new Image());
|
6
6
|
const [imageClassName, setImageClassName] = useState("");
|
7
7
|
const title = item.title && item.title;
|
@@ -56,73 +56,88 @@ const ContactCard = ({ item }) => {
|
|
56
56
|
}, [item]);
|
57
57
|
|
58
58
|
return (
|
59
|
-
|
60
|
-
{
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
src={image.src}
|
70
|
-
alt=""
|
71
|
-
/>
|
72
|
-
</div>
|
73
|
-
</>
|
59
|
+
<>
|
60
|
+
{contextAuthenticatedUser === "False" ? (
|
61
|
+
<a
|
62
|
+
href={item["@id"]}
|
63
|
+
target="_blank"
|
64
|
+
title="Editer la fiche"
|
65
|
+
className="edit-rest-elements"
|
66
|
+
>
|
67
|
+
<i class="bi bi-pencil-square"></i>
|
68
|
+
</a>
|
74
69
|
) : (
|
75
|
-
|
76
|
-
<div className="r-item-img r-item-img-placeholder"></div>
|
77
|
-
</>
|
70
|
+
""
|
78
71
|
)}
|
79
|
-
|
80
|
-
|
81
|
-
{
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
<
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
<Translate text="Itinéraire" />
|
94
|
-
</a>
|
95
|
-
</div>
|
96
|
-
</div>
|
97
|
-
) : (
|
98
|
-
""
|
99
|
-
)}
|
100
|
-
<div className="r-item-contact">
|
101
|
-
<div className="phones">
|
102
|
-
{phones
|
103
|
-
? phones.map((phone, i) => {
|
104
|
-
return <span key={i}>{phone.number}</span>;
|
105
|
-
})
|
106
|
-
: ""}
|
107
|
-
</div>
|
108
|
-
<div className="mails">
|
109
|
-
{mails
|
110
|
-
? mails.map((mail, i) => {
|
111
|
-
return <span key={i}>{mail.mail_address}</span>;
|
112
|
-
})
|
113
|
-
: ""}
|
72
|
+
|
73
|
+
<div className="r-list-item">
|
74
|
+
{image && image.src ? (
|
75
|
+
<>
|
76
|
+
<div className="r-item-img">
|
77
|
+
<div
|
78
|
+
className="r-content-figure-blur"
|
79
|
+
style={{ backgroundImage: "url(" + image.src + ")" }}
|
80
|
+
/>
|
81
|
+
<img
|
82
|
+
className={"r-content-figure-img" + " " + imageClassName}
|
83
|
+
src={image.src}
|
84
|
+
alt=""
|
85
|
+
/>
|
114
86
|
</div>
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
87
|
+
</>
|
88
|
+
) : (
|
89
|
+
<>
|
90
|
+
<div className="r-item-img r-item-img-placeholder"></div>
|
91
|
+
</>
|
92
|
+
)}
|
93
|
+
<div className="r-item-text">
|
94
|
+
<span className="r-item-title">{title}</span>
|
95
|
+
{category ? <span className="r-item-categorie">{category.title}</span> : ""}
|
96
|
+
<div className="r-item-all">
|
97
|
+
{street ? (
|
98
|
+
<div className="r-item-adresse">
|
99
|
+
{number ? <span>{number + " "}</span> : ""}
|
100
|
+
{street ? <span>{street + ", "}</span> : ""}
|
101
|
+
{complement ? <span>{complement + ", "}</span> : ""}
|
102
|
+
<br />
|
103
|
+
{zipcode ? <span>{zipcode + " "}</span> : ""}
|
104
|
+
{city ? <span>{city}</span> : ""}
|
105
|
+
<div className="itineraty">
|
106
|
+
<a href={itineraryLink} target="_blank" rel="noreferrer">
|
107
|
+
<Translate text="Itinéraire" />
|
108
|
+
</a>
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
) : (
|
112
|
+
""
|
113
|
+
)}
|
114
|
+
<div className="r-item-contact">
|
115
|
+
<div className="phones">
|
116
|
+
{phones
|
117
|
+
? phones.map((phone, i) => {
|
118
|
+
return <span key={i}>{phone.number}</span>;
|
119
|
+
})
|
120
|
+
: ""}
|
121
|
+
</div>
|
122
|
+
<div className="mails">
|
123
|
+
{mails
|
124
|
+
? mails.map((mail, i) => {
|
125
|
+
return <span key={i}>{mail.mail_address}</span>;
|
126
|
+
})
|
127
|
+
: ""}
|
128
|
+
</div>
|
129
|
+
<div className="topics">
|
130
|
+
{topics
|
131
|
+
? topics.slice(0, 3).map((mail, i) => {
|
132
|
+
return <span key={i}>{mail.title}</span>;
|
133
|
+
})
|
134
|
+
: ""}
|
135
|
+
</div>
|
121
136
|
</div>
|
122
137
|
</div>
|
123
138
|
</div>
|
124
139
|
</div>
|
125
|
-
|
140
|
+
</>
|
126
141
|
);
|
127
142
|
};
|
128
143
|
|
@@ -8,7 +8,7 @@ import "../../../../node_modules/flexbin/flexbin.css";
|
|
8
8
|
import { Translate } from "react-translated";
|
9
9
|
import queryString from "query-string";
|
10
10
|
|
11
|
-
const ContactContent = ({ queryUrl, onChange }) => {
|
11
|
+
const ContactContent = ({ queryUrl, onChange, contextAuthenticatedUser }) => {
|
12
12
|
const navigate = useNavigate();
|
13
13
|
const { u, ...parsed } = Object.assign({
|
14
14
|
UID: queryString.parse(useFilterQuery().toString())["u"],
|
@@ -103,6 +103,19 @@ const ContactContent = ({ queryUrl, onChange }) => {
|
|
103
103
|
<button type="button" onClick={handleClick}>
|
104
104
|
<Translate text="Retour" />
|
105
105
|
</button>
|
106
|
+
|
107
|
+
{contextAuthenticatedUser === "False" ? (
|
108
|
+
<a
|
109
|
+
href={item["@id"]}
|
110
|
+
target="_blank"
|
111
|
+
title="Editer la fiche"
|
112
|
+
className="edit-rest-elements edit-rest-elements-content"
|
113
|
+
>
|
114
|
+
<i class="bi bi-pencil-square"></i>
|
115
|
+
</a>
|
116
|
+
) : (
|
117
|
+
""
|
118
|
+
)}
|
106
119
|
<article>
|
107
120
|
<header>
|
108
121
|
<h2 className="r-content-title">{item.title}</h2>
|
@@ -3,7 +3,7 @@ import ContactCard from "../ContactCard/ContactCard";
|
|
3
3
|
import { Link } from "react-router-dom";
|
4
4
|
import removeAccents from "remove-accents";
|
5
5
|
import { ScrollContext } from "../../../hooks/ScrollContext";
|
6
|
-
const ContactList = ({ contactArray, onChange, onHover,
|
6
|
+
const ContactList = ({ contactArray, onChange, onHover, contextAuthenticatedUser }) => {
|
7
7
|
const { scrollPos, updateScrollPos } = useContext(ScrollContext);
|
8
8
|
|
9
9
|
function handleClick(event) {
|
@@ -45,7 +45,11 @@ const ContactList = ({ contactArray, onChange, onHover, parentCallback }) => {
|
|
45
45
|
},
|
46
46
|
}}
|
47
47
|
></Link>
|
48
|
-
<ContactCard
|
48
|
+
<ContactCard
|
49
|
+
item={item}
|
50
|
+
contextAuthenticatedUser={contextAuthenticatedUser}
|
51
|
+
key={item.created}
|
52
|
+
/>
|
49
53
|
</li>
|
50
54
|
))}
|
51
55
|
</ul>
|
@@ -2,54 +2,71 @@ import React from "react";
|
|
2
2
|
import moment from "moment";
|
3
3
|
import { Translate } from "react-translated";
|
4
4
|
|
5
|
-
const ContactCard = ({ item, showCategoriesOrTopics }) => {
|
5
|
+
const ContactCard = ({ item, showCategoriesOrTopics, contextAuthenticatedUser }) => {
|
6
6
|
moment.locale("be");
|
7
7
|
const title = item.title && item.title;
|
8
8
|
const start = moment.utc(item.start).format("DD-MM-YYYY");
|
9
9
|
const end = moment.utc(item.end).format("DD-MM-YYYY");
|
10
10
|
return (
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
item
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
11
|
+
<>
|
12
|
+
{contextAuthenticatedUser === "False" ? (
|
13
|
+
<a
|
14
|
+
href={item["@id"]}
|
15
|
+
target="_blank"
|
16
|
+
title="Editer la fiche"
|
17
|
+
className="edit-rest-elements"
|
18
|
+
>
|
19
|
+
<i class="bi bi-pencil-square"></i>
|
20
|
+
</a>
|
21
|
+
) : (
|
22
|
+
""
|
23
|
+
)}
|
24
|
+
<div className="r-list-item">
|
25
|
+
<div
|
26
|
+
className={
|
27
|
+
item.image_vignette_scale
|
28
|
+
? "r-item-img"
|
29
|
+
: "r-item-img r-item-img-placeholder"
|
30
|
+
}
|
31
|
+
style={{
|
32
|
+
backgroundImage: item.image_vignette_scale
|
33
|
+
? "url(" + item.image_vignette_scale + ")"
|
34
|
+
: "",
|
35
|
+
}}
|
36
|
+
/>
|
22
37
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
38
|
+
<div className="r-item-text">
|
39
|
+
{start && (
|
40
|
+
<span className="r-item-date">
|
41
|
+
{start === end ? (
|
42
|
+
start
|
43
|
+
) : (
|
44
|
+
<>
|
45
|
+
{start} <Translate text="au" /> {end}
|
46
|
+
</>
|
47
|
+
)}
|
48
|
+
</span>
|
49
|
+
)}
|
50
|
+
<span className="r-item-title">{title}</span>
|
51
|
+
{showCategoriesOrTopics === "topic" ? (
|
52
|
+
item.topics &&
|
53
|
+
item.topics[0] && (
|
54
|
+
<span className="r-item-categorie">{item.topics[0].title}</span>
|
55
|
+
)
|
56
|
+
) : showCategoriesOrTopics === "category" ? (
|
57
|
+
item.local_category ? (
|
58
|
+
<span className="r-item-categorie">{item.local_category.title}</span>
|
28
59
|
) : (
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
)}
|
33
|
-
</span>
|
34
|
-
)}
|
35
|
-
<span className="r-item-title">{title}</span>
|
36
|
-
{showCategoriesOrTopics === "topic" ? (
|
37
|
-
item.topics && item.topics[0] && (
|
38
|
-
<span className="r-item-categorie">{item.topics[0].title}</span>
|
39
|
-
)
|
40
|
-
) : showCategoriesOrTopics === "category" ? (
|
41
|
-
item.local_category ? (
|
42
|
-
<span className="r-item-categorie">{item.local_category.title}</span>
|
43
|
-
) : (
|
44
|
-
item.category && (
|
45
|
-
<span className="r-item-categorie">{item.category.title}</span>
|
60
|
+
item.category && (
|
61
|
+
<span className="r-item-categorie">{item.category.title}</span>
|
62
|
+
)
|
46
63
|
)
|
47
|
-
)
|
48
|
-
|
49
|
-
|
50
|
-
|
64
|
+
) : (
|
65
|
+
""
|
66
|
+
)}
|
67
|
+
</div>
|
51
68
|
</div>
|
52
|
-
|
69
|
+
</>
|
53
70
|
);
|
54
71
|
};
|
55
72
|
|
@@ -9,7 +9,7 @@ import "../../../../node_modules/flexbin/flexbin.css";
|
|
9
9
|
import { Translate } from "react-translated";
|
10
10
|
import queryString from "query-string";
|
11
11
|
|
12
|
-
const ContactContent = ({ queryUrl, onChange, onlyPastEvents }) => {
|
12
|
+
const ContactContent = ({ queryUrl, onChange, onlyPastEvents, contextAuthenticatedUser }) => {
|
13
13
|
let navigate = useNavigate();
|
14
14
|
const { u, ...parsed } = Object.assign({
|
15
15
|
UID: queryString.parse(useFilterQuery().toString())["u"],
|
@@ -59,8 +59,8 @@ const ContactContent = ({ queryUrl, onChange, onlyPastEvents }) => {
|
|
59
59
|
window.scrollTo({
|
60
60
|
top: 0,
|
61
61
|
left: 0,
|
62
|
-
behavior:
|
63
|
-
|
62
|
+
behavior: "instant",
|
63
|
+
});
|
64
64
|
}, [response]);
|
65
65
|
/// use to set file and gallery items
|
66
66
|
useEffect(() => {
|
@@ -126,6 +126,20 @@ const ContactContent = ({ queryUrl, onChange, onlyPastEvents }) => {
|
|
126
126
|
<button type="button" onClick={handleClick}>
|
127
127
|
<Translate text="Retour" />
|
128
128
|
</button>
|
129
|
+
|
130
|
+
{contextAuthenticatedUser === "False" ? (
|
131
|
+
<a
|
132
|
+
href={item["@id"]}
|
133
|
+
target="_blank"
|
134
|
+
title="Editer la fiche"
|
135
|
+
className="edit-rest-elements edit-rest-elements-content"
|
136
|
+
>
|
137
|
+
<i class="bi bi-pencil-square"></i>
|
138
|
+
</a>
|
139
|
+
) : (
|
140
|
+
""
|
141
|
+
)}
|
142
|
+
|
129
143
|
<article>
|
130
144
|
<header className="r-content-header">
|
131
145
|
<h2 className="r-content-title">{item.title}</h2>
|
@@ -3,10 +3,15 @@ import EventCard from "../EventCard/EventCard";
|
|
3
3
|
import { Link } from "react-router-dom";
|
4
4
|
import removeAccents from "remove-accents";
|
5
5
|
import { ScrollContext } from "../../../hooks/ScrollContext";
|
6
|
-
const ContactList = ({
|
7
|
-
|
6
|
+
const ContactList = ({
|
7
|
+
itemsArray,
|
8
|
+
onChange,
|
9
|
+
onHover,
|
10
|
+
showCategoriesOrTopics,
|
11
|
+
contextAuthenticatedUser,
|
12
|
+
}) => {
|
8
13
|
const { scrollPos, updateScrollPos } = useContext(ScrollContext);
|
9
|
-
|
14
|
+
|
10
15
|
function handleClick(event) {
|
11
16
|
onChange(event);
|
12
17
|
updateScrollPos(window.scrollY);
|
@@ -17,10 +22,7 @@ const ContactList = ({ itemsArray, onChange, onHover, showCategoriesOrTopics })
|
|
17
22
|
}
|
18
23
|
|
19
24
|
useEffect(() => {
|
20
|
-
window.scrollTo(
|
21
|
-
{ top: scrollPos,
|
22
|
-
left: 0,
|
23
|
-
behavior: 'instant'});
|
25
|
+
window.scrollTo({ top: scrollPos, left: 0, behavior: "instant" });
|
24
26
|
}, [itemsArray]);
|
25
27
|
|
26
28
|
return (
|
@@ -54,6 +56,7 @@ const ContactList = ({ itemsArray, onChange, onHover, showCategoriesOrTopics })
|
|
54
56
|
item={item}
|
55
57
|
showCategoriesOrTopics={showCategoriesOrTopics}
|
56
58
|
key={item.created}
|
59
|
+
contextAuthenticatedUser={contextAuthenticatedUser}
|
57
60
|
/>
|
58
61
|
</li>
|
59
62
|
))}
|
@@ -33,8 +33,8 @@ export default function Events(props) {
|
|
33
33
|
displayMap={props.displayMap}
|
34
34
|
onlyPastEvents={props.onlyPastEvents}
|
35
35
|
language={props.currentLanguage}
|
36
|
-
|
37
|
-
|
36
|
+
showCategoriesOrTopics={props.showCategoriesOrTopics}
|
37
|
+
contextAuthenticatedUser={props.contextAuthenticatedUser}
|
38
38
|
/>
|
39
39
|
</ScrollContext.Provider>
|
40
40
|
</Provider>
|
@@ -143,6 +143,7 @@ function EventsView(props) {
|
|
143
143
|
itemsArray={itemsArray}
|
144
144
|
onHover={hoverID}
|
145
145
|
showCategoriesOrTopics={props.showCategoriesOrTopics}
|
146
|
+
contextAuthenticatedUser={props.contextAuthenticatedUser}
|
146
147
|
/>
|
147
148
|
);
|
148
149
|
MapRender = (
|
@@ -279,6 +280,7 @@ function EventsView(props) {
|
|
279
280
|
queryUrl={props.queryUrl}
|
280
281
|
onChange={clickID}
|
281
282
|
onlyPastEvents={props.onlyPastEvents}
|
283
|
+
contextAuthenticatedUser={props.contextAuthenticatedUser}
|
282
284
|
/>
|
283
285
|
</div>
|
284
286
|
{displayMap && (
|
@@ -31,6 +31,7 @@ export default function News(props) {
|
|
31
31
|
proposeUrl={props.proposeUrl}
|
32
32
|
batchSize={props.batchSize}
|
33
33
|
showCategoriesOrTopics={props.showCategoriesOrTopics}
|
34
|
+
contextAuthenticatedUser={props.contextAuthenticatedUser}
|
34
35
|
/>
|
35
36
|
</ScrollContext.Provider>
|
36
37
|
</Provider>
|
@@ -111,6 +112,7 @@ const NewsView = (props) => {
|
|
111
112
|
onChange={clickID}
|
112
113
|
itemsArray={itemsArray}
|
113
114
|
showCategoriesOrTopics={props.showCategoriesOrTopics}
|
115
|
+
contextAuthenticatedUser={props.contextAuthenticatedUser}
|
114
116
|
/>
|
115
117
|
);
|
116
118
|
} else if (!isLoading) {
|
@@ -215,6 +217,7 @@ const NewsView = (props) => {
|
|
215
217
|
onChange={clickID}
|
216
218
|
onReturn={filtersChange}
|
217
219
|
queryUrl={props.queryUrl}
|
220
|
+
contextAuthenticatedUser={props.contextAuthenticatedUser}
|
218
221
|
/>
|
219
222
|
}
|
220
223
|
></Route>
|
@@ -3,7 +3,7 @@ import moment from "moment";
|
|
3
3
|
import ReactMarkdown from "react-markdown";
|
4
4
|
import { Translate } from "react-translated";
|
5
5
|
import { LanguageContext } from "../News.jsx";
|
6
|
-
const NewsCard = ({ item, showCategoriesOrTopics }) => {
|
6
|
+
const NewsCard = ({ item, showCategoriesOrTopics, contextAuthenticatedUser }) => {
|
7
7
|
const [limitDescription, setLimitDescription] = useState();
|
8
8
|
const [itemTopic, setItemTopic] = useState(null);
|
9
9
|
|
@@ -13,7 +13,11 @@ const NewsCard = ({ item, showCategoriesOrTopics }) => {
|
|
13
13
|
|
14
14
|
useEffect(() => {
|
15
15
|
if (description.length >= numberLimit) {
|
16
|
-
|
16
|
+
let truncatedDescription = description.substring(0, numberLimit);
|
17
|
+
if (description.endsWith("**")) {
|
18
|
+
truncatedDescription += "**";
|
19
|
+
}
|
20
|
+
setLimitDescription(truncatedDescription + "...");
|
17
21
|
} else {
|
18
22
|
setLimitDescription(description);
|
19
23
|
}
|
@@ -27,57 +31,65 @@ const NewsCard = ({ item, showCategoriesOrTopics }) => {
|
|
27
31
|
const created = moment(item.created).startOf("minute").fromNow();
|
28
32
|
const lastModified = moment(item.modified).startOf("minute").fromNow();
|
29
33
|
return (
|
30
|
-
|
31
|
-
<div
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
34
|
+
<>
|
35
|
+
<div className="r-list-item">
|
36
|
+
<div
|
37
|
+
className={
|
38
|
+
item.image_vignette_scale
|
39
|
+
? "r-item-img"
|
40
|
+
: "r-item-img r-item-img-placeholder"
|
41
|
+
}
|
42
|
+
style={{
|
43
|
+
backgroundImage: item.image_vignette_scale
|
44
|
+
? "url(" + item.image_vignette_scale + ")"
|
45
|
+
: "",
|
46
|
+
}}
|
47
|
+
/>
|
48
|
+
<div className="r-item-text">
|
49
|
+
<span className="r-item-title">{title}</span>
|
50
|
+
{showCategoriesOrTopics === "topic" ? (
|
51
|
+
itemTopic && (
|
52
|
+
<span className="r-item-categorie">{item.topics[0].title}</span>
|
53
|
+
)
|
54
|
+
) : showCategoriesOrTopics === "category" ? (
|
55
|
+
item.local_category ? (
|
56
|
+
<span className="r-item-categorie">{item.local_category.title}</span>
|
57
|
+
) : (
|
58
|
+
item.category && (
|
59
|
+
<span className="r-item-categorie">{item.category.title}</span>
|
60
|
+
)
|
51
61
|
)
|
52
|
-
)
|
53
|
-
) : (
|
54
|
-
""
|
55
|
-
)}
|
56
|
-
{description ? (
|
57
|
-
<ReactMarkdown className="r-item-description">{limitDescription}</ReactMarkdown>
|
58
|
-
) : (
|
59
|
-
""
|
60
|
-
)}
|
61
|
-
<div className="r-item-read-more" style={{ textDecoration: "none" }}>
|
62
|
-
{created === lastModified ? (
|
63
|
-
<div className="r-card-date-last">
|
64
|
-
<span>
|
65
|
-
<Translate text="Publié" />{" "}
|
66
|
-
</span>
|
67
|
-
<span>{created}</span>
|
68
|
-
</div>
|
69
62
|
) : (
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
</
|
63
|
+
""
|
64
|
+
)}
|
65
|
+
{description ? (
|
66
|
+
<ReactMarkdown className="r-item-description">
|
67
|
+
{limitDescription}
|
68
|
+
</ReactMarkdown>
|
69
|
+
) : (
|
70
|
+
""
|
76
71
|
)}
|
72
|
+
<div className="r-item-read-more" style={{ textDecoration: "none" }}>
|
73
|
+
{created === lastModified ? (
|
74
|
+
<div className="r-card-date-last">
|
75
|
+
<span>
|
76
|
+
<Translate text="Publié" />{" "}
|
77
|
+
</span>
|
78
|
+
<span>{created}</span>
|
79
|
+
</div>
|
80
|
+
) : (
|
81
|
+
<div className="r-card-date-last">
|
82
|
+
<span>
|
83
|
+
<Translate text="Actualisé" />{" "}
|
84
|
+
</span>
|
85
|
+
<span>{lastModified}</span>
|
86
|
+
</div>
|
87
|
+
)}
|
88
|
+
</div>
|
77
89
|
</div>
|
90
|
+
<div className="r-item-arrow-more"></div>
|
78
91
|
</div>
|
79
|
-
|
80
|
-
</div>
|
92
|
+
</>
|
81
93
|
);
|
82
94
|
};
|
83
95
|
|
@@ -10,7 +10,7 @@ import "../../../../node_modules/flexbin/flexbin.css";
|
|
10
10
|
import { Translate } from "react-translated";
|
11
11
|
import queryString from "query-string";
|
12
12
|
|
13
|
-
const ContactContent = ({ queryUrl, onChange }) => {
|
13
|
+
const ContactContent = ({ queryUrl, onChange, contextAuthenticatedUser }) => {
|
14
14
|
let navigate = useNavigate();
|
15
15
|
const parsed = queryString.parse(useFilterQuery().toString());
|
16
16
|
const parsed2 = { ...parsed, UID: parsed["u"], fullobjects: 1 };
|
@@ -37,8 +37,8 @@ const ContactContent = ({ queryUrl, onChange }) => {
|
|
37
37
|
window.scrollTo({
|
38
38
|
top: 0,
|
39
39
|
left: 0,
|
40
|
-
behavior:
|
41
|
-
|
40
|
+
behavior: "instant",
|
41
|
+
});
|
42
42
|
}, [response]);
|
43
43
|
|
44
44
|
/// use to set file and gallery items
|
@@ -61,6 +61,20 @@ const ContactContent = ({ queryUrl, onChange }) => {
|
|
61
61
|
<button type="button" onClick={handleClick}>
|
62
62
|
<Translate text="Retour" />
|
63
63
|
</button>
|
64
|
+
|
65
|
+
{contextAuthenticatedUser === "False" ? (
|
66
|
+
<a
|
67
|
+
href={item["@id"]}
|
68
|
+
target="_blank"
|
69
|
+
title="Editer la fiche"
|
70
|
+
className="edit-rest-elements edit-rest-elements-content"
|
71
|
+
>
|
72
|
+
<i class="bi bi-pencil-square"></i>
|
73
|
+
</a>
|
74
|
+
) : (
|
75
|
+
""
|
76
|
+
)}
|
77
|
+
|
64
78
|
<article>
|
65
79
|
<header>
|
66
80
|
<h2 className="r-content-title">{item.title}</h2>
|