feat: Protection des données des associations

This commit is contained in:
Simon 2022-12-02 13:03:00 +01:00
parent 5535a90e8d
commit 7f2fab4263
2 changed files with 23 additions and 18 deletions

View File

@ -10,9 +10,9 @@
<div class="container md"> <div class="container md">
<h2>Liens :</h2> <h2>Liens :</h2>
<ul> <ul>
{{ if .Params.mail }}<li>Mail : {{ .Params.mail }}</li>{{ end }} {{ if .Params.mail }}<li>Mail : {{ printf "[%s](mailto:%s)" .Params.mail .Params.mail | markdownify }}</li>{{ end }}
{{ if .Params.telephone }}<li>Téléphone : {{ .Params.telephone }}</li>{{ end }} {{ if .Params.telephone }}<li>Téléphone : {{ printf "[%s](tel:%s)" (replace .Params.telephone " " "") (replace .Params.telephone " " "") | markdownify }}</li>{{ end }}
{{ if .Params.site }}<li>Site WEB : {{ .Params.site }}</li>{{ end }} {{ if .Params.site }}<li>Site WEB : <a href="{{ .Params.site }}">{{ .Params.site }}</a></li>{{ end }}
{{ if .Params.facebook }}<li>Facebook : {{ .Params.facebook }}</li>{{ end }} {{ if .Params.facebook }}<li>Facebook : {{ .Params.facebook }}</li>{{ end }}
</ul> </ul>
</div> </div>

View File

@ -34,23 +34,28 @@ const config = {
if (!association.title) { if (!association.title) {
association.title = association.denomination association.title = association.denomination
} }
const bureau = [] if (association.bureau && association.bureau.length > 0) {
for (const contact of association.bureau) { console.log(association.bureau.length)
const detail = contact.Contact_id const bureau = []
let c = { for (const contact of association.bureau) {
denomination: detail.denomination, const detail = contact.Contact_id
prenom: detail.prenom, let c = {
nom: detail.nom, denomination: detail.denomination,
prenom: detail.prenom,
nom: detail.nom,
}
if (detail.mail && detail.display_mail) {
c.mail = detail.mail
}
if (detail.telephone && detail.display_telephone) {
c.telephone = detail.telephone
}
bureau.push(c)
} }
if (detail.mail && detail.display_mail) { association.bureau = bureau
c.mail = detail.mail } else {
} delete association.bureau
if (detail.telephone && detail.display_telephone) {
c.telephone = detail.telephone
}
bureau.push(c)
} }
association.bureau = bureau
return `./content/associations/${urlslug(association.denomination)}`; return `./content/associations/${urlslug(association.denomination)}`;
}, },