Skip to content

Commit

Permalink
Merge pull request #50 from OpenWebconcept/feature/PC108-40/openPDC
Browse files Browse the repository at this point in the history
feature/PC108-40/openPDC
  • Loading branch information
remko48 authored Jun 4, 2024
2 parents 72c8517 + f5fd0a9 commit 271e687
Showing 1 changed file with 70 additions and 8 deletions.
78 changes: 70 additions & 8 deletions src/features/search/KennisartikelDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
:id="id"
>
<utrecht-heading :level="headingLevel + 1">{{ label }}</utrecht-heading>
<div v-html="html"></div>
<div class="section-content" v-html="html"></div>
</section>
</article>

Expand All @@ -47,14 +47,15 @@ import type { Kennisartikel } from "./types";
const knownSections = {
specifiekeTekst: "Inleiding",
procedureBeschrijving: "Aanvraag",
procedureBeschrijving: "Meenemen",
conditions: "Voorwaarden",
bewijs: "Bewijs",
kostenEnBetaalmethoden: "Kosten",
uitersteTermijn: "Termijn",
bezwaarEnBeroep: "Bezwaar",
vereisten: "Vereisten",
notice: "Bijzonderheden",
notice: "Meer informatie",
faq: "Meer informatie",
wtdBijGeenReactie: "Geen reactie",
contact: "Contact",
deskMemo: "KCC",
Expand Down Expand Up @@ -106,13 +107,48 @@ const processedSections = computed(() => {
const sectionsWithActualText = allSections.filter(({ text }) => !!text);
const sectionsWithProcessedHtml = sectionsWithActualText.map(
({ label, text, key }) => ({
key: key,
label,
html: processHtml(text),
})
({ label, text, key }) => {
if (key === "notice") {
if (sectionsWithActualText.find((item) => item.key === "faq")) {
return false;
}
return {
key: key,
label,
html: processHtml(text),
};
}
if (key === "faq") {
if (text.length === 0) {
return false;
}
const html = text.map((item) => {
return `<details><summary>${item.question}</summary><div class="content">${item.answer}</div></details>`;
});
return {
key: key,
label,
html: processHtml(`${html.join("")}`),
};
}
return {
key: key,
label,
html: processHtml(text),
};
}
);
const index = sectionsWithProcessedHtml.indexOf(false);
if (index > -1) {
sectionsWithProcessedHtml.splice(index, 1);
}
return sectionsWithProcessedHtml;
});
Expand Down Expand Up @@ -207,6 +243,32 @@ article {
}
}
.section-content::v-deep {
details {
padding: 10px;
border-radius: 5px;
}
summary {
background-color: #415a77;
color: white;
padding: 10px;
}
summary:hover {
cursor: pointer;
}
summary::after {
display: none;
}
.content {
padding: 1.8rem;
border: 1px solid #415a77;
}
}
nav ul {
display: flex;
flex-direction: column;
Expand Down

0 comments on commit 271e687

Please sign in to comment.