Skip to content

Commit

Permalink
Merge branch 'fix/demos' into 'main'
Browse files Browse the repository at this point in the history
Fix/demos

See merge request decidim/decidim-module-geo!160
  • Loading branch information
Hadrien Froger committed Oct 26, 2024
2 parents 0a804ed + ecb1421 commit 5f79b12
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/packs/src/decidim/geo/ui/DrawerListItem/proposals.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import _ from "lodash";

const proposals = (node) => {
const { i18n, images, locale, defaultLocale } = configStore.getState();
const hasImage = !_.isEmpty(node.imageUrl);
const states = i18n["decidim.geo.proposals.states"]
const listCard = L.DomUtil.create("li", "decidimGeo__drawer__listCard");
const listCard = L.DomUtil.create("li", "decidimGeo__drawer__listCard decidimGeo__drawer__listCard--proposals");
const info = L.DomUtil.create(
"div",
"decidimGeo__drawer__listCardInfo decidimGeo__drawer__listCardInfo--large",
"decidimGeo__drawer__listCardInfo",
listCard
);
const metadatas = L.DomUtil.create("div", "decidimGeo__drawer__metas", info);
Expand Down Expand Up @@ -38,12 +39,15 @@ const proposals = (node) => {
if (node.shortDescription) {
const infoDescription = L.DomUtil.create(
"div",
"decidimGeo__drawer__listCardDescription",
info
);
infoDescription.textContent =
node.shortDescription[locale] || node.shortDescription[defaultLocale];
}
if (hasImage) {
const image = L.DomUtil.create("img", "decidimGeo__drawer__listCardImg", listCard);
image.src = node.imageUrl;
}

return listCard;
};
Expand Down

0 comments on commit 5f79b12

Please sign in to comment.