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.
- imio/smartweb/core/contents/sections/events/view.py +2 -1
- imio/smartweb/core/contents/sections/news/view.py +2 -1
- imio/smartweb/core/contents/sections/text/views.py +2 -0
- imio/smartweb/core/contents/sections/views.py +2 -0
- imio/smartweb/core/tests/resources/json_rest_events.json +4 -1
- imio/smartweb/core/tests/test_rest.py +4 -1
- imio/smartweb/core/tests/test_section_events.py +9 -8
- imio/smartweb/core/tests/test_section_news.py +6 -6
- imio/smartweb/core/tests/test_vocabularies.py +2 -2
- imio/smartweb/core/utils.py +1 -1
- imio/smartweb/core/viewlets/footer.pt +5 -0
- imio/smartweb/core/viewlets/footer.py +5 -0
- imio/smartweb/core/vocabularies.py +2 -2
- 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/884.smartweb-webcomponents-compiled.css +1 -0
- imio/smartweb/core/webcomponents/build/css/smartweb-webcomponents-compiled.css +1 -1
- 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 -0
- 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/736.smartweb-webcomponents-compiled.js +1 -1
- imio/smartweb/core/webcomponents/build/js/736.smartweb-webcomponents-compiled.js.LICENSE.txt +3 -3
- imio/smartweb/core/webcomponents/build/js/884.smartweb-webcomponents-compiled.js +1 -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/src/components/Annuaire/Annuaire.jsx +101 -74
- imio/smartweb/core/webcomponents/src/components/Annuaire/Annuaire.scss +4 -22
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactCard/ContactCard.jsx +22 -18
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactContent/ContactContent.jsx +4 -2
- imio/smartweb/core/webcomponents/src/components/Annuaire/ContactList/ContactList.jsx +7 -2
- imio/smartweb/core/webcomponents/src/components/Annuaire/Filters/Filter.jsx +211 -98
- imio/smartweb/core/webcomponents/src/components/Events/EventContent/EventContent.jsx +506 -378
- imio/smartweb/core/webcomponents/src/components/Events/EventList/EventList.jsx +13 -4
- imio/smartweb/core/webcomponents/src/components/Events/Events.jsx +117 -82
- imio/smartweb/core/webcomponents/src/components/Events/Events.scss +52 -28
- imio/smartweb/core/webcomponents/src/components/Events/Filters/Filter.jsx +257 -90
- imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.jsx +62 -54
- imio/smartweb/core/webcomponents/src/components/Filters/DateFilter.scss +60 -12
- imio/smartweb/core/webcomponents/src/components/Filters/IamData.jsx +42 -0
- imio/smartweb/core/webcomponents/src/components/Filters/MainFilter.scss +217 -0
- imio/smartweb/core/webcomponents/src/components/Filters/PublicTargetData.jsx +94 -0
- imio/smartweb/core/webcomponents/src/components/Filters/SelectStyles.js +58 -0
- imio/smartweb/core/webcomponents/src/components/Filters/TaxonomyFilter.jsx +149 -0
- imio/smartweb/core/webcomponents/src/components/Filters/TaxonomyFilter.scss +70 -0
- imio/smartweb/core/webcomponents/src/components/News/Filters/Filter.jsx +127 -82
- imio/smartweb/core/webcomponents/src/components/News/News.jsx +86 -53
- imio/smartweb/core/webcomponents/src/components/News/News.scss +29 -9
- imio/smartweb/core/webcomponents/src/components/News/NewsCard/NewsCard.jsx +34 -31
- imio/smartweb/core/webcomponents/src/components/News/NewsContent/NewsContent.jsx +264 -244
- imio/smartweb/core/webcomponents/src/components/News/NewsList/NewsList.jsx +13 -8
- imio/smartweb/core/webcomponents/src/components/Search/ContactResult/ContactResult.jsx +23 -12
- imio/smartweb/core/webcomponents/src/components/Search/EventsResult/EventsResult.jsx +23 -12
- imio/smartweb/core/webcomponents/src/components/Search/Filters/Filter.jsx +5 -5
- imio/smartweb/core/webcomponents/src/components/Search/NewsResult/NewsResult.jsx +23 -12
- imio/smartweb/core/webcomponents/src/components/Search/Search.jsx +4 -4
- imio/smartweb/core/webcomponents/src/components/Search/WebResult/WebResult.jsx +13 -4
- imio/smartweb/core/webcomponents/src/index.jsx +3 -3
- imio/smartweb/core/webcomponents/src/index.scss +11 -65
- imio/smartweb/core/webcomponents/src/utils/Map.jsx +18 -9
- imio/smartweb/core/webcomponents/src/utils/translation.js +18 -0
- imio.smartweb.core-1.2.48-py3.10-nspkg.pth +3 -0
- {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/METADATA +22 -3
- {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/RECORD +69 -63
- {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/WHEEL +1 -1
- imio/smartweb/core/webcomponents/build/css/686.smartweb-webcomponents-compiled.css +0 -1
- imio/smartweb/core/webcomponents/build/js/686.smartweb-webcomponents-compiled.js +0 -1
- imio.smartweb.core-1.2.47-py3.8-nspkg.pth +0 -2
- {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/LICENSE.GPL +0 -0
- {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/LICENSE.rst +0 -0
- {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/namespace_packages.txt +0 -0
- {imio.smartweb.core-1.2.47.dist-info → imio.smartweb.core-1.2.48.dist-info}/top_level.txt +0 -0
@@ -1,15 +1,15 @@
|
|
1
1
|
import React, { useEffect, useState, useContext } from "react";
|
2
2
|
import moment from "moment";
|
3
|
-
import ReactMarkdown from
|
3
|
+
import ReactMarkdown from "react-markdown";
|
4
4
|
import { Translate } from "react-translated";
|
5
|
-
import { LanguageContext } from
|
6
|
-
const NewsCard = ({ item,showCategoriesOrTopics }) => {
|
5
|
+
import { LanguageContext } from "../News.jsx";
|
6
|
+
const NewsCard = ({ item, showCategoriesOrTopics }) => {
|
7
7
|
const [limitDescription, setLimitDescription] = useState();
|
8
8
|
const [itemTopic, setItemTopic] = useState(null);
|
9
9
|
|
10
10
|
const numberLimit = 150;
|
11
11
|
const title = item.title && item.title;
|
12
|
-
const description = item.description
|
12
|
+
const description = item.description || "";
|
13
13
|
|
14
14
|
useEffect(() => {
|
15
15
|
if (description.length >= numberLimit) {
|
@@ -20,16 +20,18 @@ const NewsCard = ({ item,showCategoriesOrTopics }) => {
|
|
20
20
|
if (item.topics && item.topics.length > 0) {
|
21
21
|
setItemTopic(item.topics[0].title);
|
22
22
|
} else {
|
23
|
-
setItemTopic(null)
|
23
|
+
setItemTopic(null);
|
24
24
|
}
|
25
25
|
}, [item]);
|
26
|
-
moment.locale(useContext(LanguageContext))
|
27
|
-
const created = moment(item.created).startOf(
|
28
|
-
const lastModified = moment(item.modified).startOf(
|
26
|
+
moment.locale(useContext(LanguageContext));
|
27
|
+
const created = moment(item.created).startOf("minute").fromNow();
|
28
|
+
const lastModified = moment(item.modified).startOf("minute").fromNow();
|
29
29
|
return (
|
30
30
|
<div className="r-list-item">
|
31
31
|
<div
|
32
|
-
className={
|
32
|
+
className={
|
33
|
+
item.image_vignette_scale ? "r-item-img" : "r-item-img r-item-img-placeholder"
|
34
|
+
}
|
33
35
|
style={{
|
34
36
|
backgroundImage: item.image_vignette_scale
|
35
37
|
? "url(" + item.image_vignette_scale + ")"
|
@@ -39,9 +41,7 @@ const NewsCard = ({ item,showCategoriesOrTopics }) => {
|
|
39
41
|
<div className="r-item-text">
|
40
42
|
<span className="r-item-title">{title}</span>
|
41
43
|
{showCategoriesOrTopics === "topic" ? (
|
42
|
-
itemTopic &&
|
43
|
-
<span className="r-item-categorie">{item.topics[0].title}</span>
|
44
|
-
)
|
44
|
+
itemTopic && <span className="r-item-categorie">{item.topics[0].title}</span>
|
45
45
|
) : showCategoriesOrTopics === "category" ? (
|
46
46
|
item.local_category ? (
|
47
47
|
<span className="r-item-categorie">{item.local_category.title}</span>
|
@@ -50,27 +50,30 @@ const NewsCard = ({ item,showCategoriesOrTopics }) => {
|
|
50
50
|
<span className="r-item-categorie">{item.category.title}</span>
|
51
51
|
)
|
52
52
|
)
|
53
|
-
) :
|
54
|
-
|
53
|
+
) : (
|
54
|
+
""
|
55
|
+
)}
|
56
|
+
{description ? (
|
55
57
|
<ReactMarkdown className="r-item-description">{limitDescription}</ReactMarkdown>
|
56
|
-
|
57
|
-
|
58
|
+
) : (
|
59
|
+
""
|
60
|
+
)}
|
58
61
|
<div className="r-item-read-more" style={{ textDecoration: "none" }}>
|
59
|
-
{
|
60
|
-
|
61
|
-
|
62
|
-
<
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
}
|
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
|
+
) : (
|
70
|
+
<div className="r-card-date-last">
|
71
|
+
<span>
|
72
|
+
<Translate text="Actualisé" />{" "}
|
73
|
+
</span>
|
74
|
+
<span>{lastModified}</span>
|
75
|
+
</div>
|
76
|
+
)}
|
74
77
|
</div>
|
75
78
|
</div>
|
76
79
|
<div className="r-item-arrow-more"></div>
|