Improve view of articles

This commit is contained in:
Emmanuel 2024-12-11 10:26:21 +01:00
parent 5ee146c2fc
commit 49269d8821
2 changed files with 31 additions and 22 deletions

View file

@ -24,7 +24,10 @@
</svelte:element> </svelte:element>
{/if} {/if}
{@html article.BLOC_TEXTUEL?.CONTENU} {@html article.BLOC_TEXTUEL?.CONTENU.replaceAll("<<", "«").replaceAll(
">>",
"»",
)}
{#if ciblesCreation.length > 0} {#if ciblesCreation.length > 0}
<ul> <ul>

View file

@ -406,27 +406,33 @@ export function summarizeLegalObject(
] ]
return { return {
items: [ items: [
`Article ${metaArticle.NUM} ${metaArticle.TYPE} ${metaArticle.ETAT}, en vigueur`, `Article${[metaArticle.NUM, metaArticle.TYPE, metaArticle.ETAT]
...(metaArticle.DATE_FIN === "2999-01-01" .filter((value) => value !== undefined)
? ([ .map((value) => ` ${value}`)
" depuis le ", .join("")}, en vigueur`,
{ ...(metaArticle.DATE_DEBUT === "2999-01-01" &&
value: metaArticle.DATE_DEBUT, metaArticle.DATE_FIN === "2999-01-01"
type: "date", ? []
}, : metaArticle.DATE_FIN === "2999-01-01"
] as Summary[]) ? ([
: ([ " depuis le ",
" du ", {
{ value: metaArticle.DATE_DEBUT,
value: metaArticle.DATE_DEBUT, type: "date",
type: "date", },
}, ] as Summary[])
" au ", : ([
{ " du ",
value: metaArticle.DATE_FIN, {
type: "date", value: metaArticle.DATE_DEBUT,
}, type: "date",
] as Summary[])), },
" au ",
{
value: metaArticle.DATE_FIN,
type: "date",
},
] as Summary[])),
...(titreTexte === undefined ? [] : [" (", titreTexte, ")"]), ...(titreTexte === undefined ? [] : [" (", titreTexte, ")"]),
], ],
type: "concatenation", type: "concatenation",