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">
<h2>Liens :</h2>
<ul>
{{ if .Params.mail }}<li>Mail : {{ .Params.mail }}</li>{{ end }}
{{ if .Params.telephone }}<li>Téléphone : {{ .Params.telephone }}</li>{{ end }}
{{ if .Params.site }}<li>Site WEB : {{ .Params.site }}</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 : {{ printf "[%s](tel:%s)" (replace .Params.telephone " " "") (replace .Params.telephone " " "") | markdownify }}</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 }}
</ul>
</div>

View File

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