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>
{/if}
{@html article.BLOC_TEXTUEL?.CONTENU}
{@html article.BLOC_TEXTUEL?.CONTENU.replaceAll("<<", "«").replaceAll(
">>",
"»",
)}
{#if ciblesCreation.length > 0}
<ul>

View file

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