-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hadrien Froger
committed
Oct 16, 2024
1 parent
eb17542
commit 0d05ffe
Showing
6 changed files
with
87 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { default as meetings } from "./meetings"; | ||
export { default as proposals } from "./proposals"; | ||
export { default as fallback } from "./fallback"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import configStore from "../../stores/configStore"; | ||
import createClasses from "../createClasses"; | ||
import _ from "lodash"; | ||
|
||
const proposals = (node) => { | ||
const { i18n, images, locale, defaultLocale } = configStore.getState(); | ||
const states = i18n["decidim.geo.proposals.states"] | ||
const listCard = L.DomUtil.create("li", "decidimGeo__drawer__listCard"); | ||
const info = L.DomUtil.create( | ||
"div", | ||
"decidimGeo__drawer__listCardInfo decidimGeo__drawer__listCardInfo--large", | ||
listCard | ||
); | ||
const metadatas = L.DomUtil.create("div", "decidimGeo__drawer__metas", info); | ||
|
||
const infoType = L.DomUtil.create("div", "decidimGeo__drawer__listCardType", metadatas); | ||
infoType.textContent = i18n[node.resourceType]; | ||
|
||
const notGeoEncodedIcon = L.DomUtil.create( | ||
"img", | ||
createClasses("decidimGeo__drawer__listCardIcon", [node.lonlat && "hidden"]), | ||
infoType | ||
); | ||
notGeoEncodedIcon.src = images?.not_geolocated; | ||
|
||
const infoTitle = L.DomUtil.create("div", "decidimGeo__drawer__listCardTitle", info); | ||
infoTitle.textContent = node.title[locale] || node.title[defaultLocale]; | ||
const status = node.resourceStatus || "published" | ||
if(status){ | ||
const infoStatus = L.DomUtil.create( | ||
"div", | ||
createClasses("decidimGeo__drawer__listCardStatus", [status]), | ||
metadatas | ||
); | ||
infoStatus.textContent = states[status] | ||
} | ||
|
||
if (node.shortDescription) { | ||
const infoDescription = L.DomUtil.create( | ||
"div", | ||
"decidimGeo__drawer__listCardDescription", | ||
info | ||
); | ||
infoDescription.textContent = | ||
node.shortDescription[locale] || node.shortDescription[defaultLocale]; | ||
} | ||
|
||
return listCard; | ||
}; | ||
|
||
export default proposals; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters