dordogne-cd24: add commune contact extra cell (#43427)

This commit is contained in:
Serghei Mihai 2020-06-03 12:05:58 +02:00
parent b7c75eaf24
commit 790dc63c50
5 changed files with 68 additions and 6 deletions

View File

@ -590,10 +590,18 @@ div.linkcell.homepage-link {
/* customize json contact service cell */
div.cell.contact-service {
background: #f3f7fa;
.title {
font-weight: bold;
}
/* customize json contact commune cell */
div.cell.contact-commune {
> div > div {
margin-top: 10px;
background:#f4f7fa;
}
h3 {
}
div.cell.contact-service, div.cell.contact-commune {
h3.service-title {
margin-left: 1em;
margin-right: 1em;
padding: 2em 0 2em 260px;
@ -604,7 +612,10 @@ div.cell.contact-service {
background-position: top center;
}
}
> div > div {
.title {
font-weight: bold;
}
div.service-details, div.commune-details {
display: flex;
flex-wrap: wrap;
> div {

View File

@ -24,6 +24,18 @@
"required": true
}
]
},
"contact-commune": {
"cache_duration": 60,
"name": "Cellule coordonnées communes RGPD",
"url": "{{ webservice_url }}",
"form": [
{
"label": "URL du webservice",
"varname": "webservice_url",
"required": true
}
]
}
},
"COMBO_PUBLIC_TEMPLATES.update": {

View File

@ -0,0 +1,8 @@
$(function() {
$('div.contact-commune select').on('change', function() {
var $parent = $(this).parent();
$parent.find('> div').hide();
$parent.find('div#commune-' + this.value).show();
});
$('div.contact-commune select').trigger('change');
});

View File

@ -0,0 +1,31 @@
<h3>Contacter l'organisme</h3>
<p>Veuillez choisir votre commune</p>
<select id="listeCommune">
<option value="---">---</option>
{% for contact in json.data %}
<option value="{{contact.id}}">{{contact.organisme}}</option>
{% endfor %}
</select>
{% for contact in json.data %}
<div id="commune-{{contact.id}}"style="display:none;">
<h3 class="service-title" style="background-image: url('{{ contact.logo }}')">CONTACT</h3>
<div class="commune-details">
<div>
<p class="title">Coordonnées :</p>
<p>{{contact.lieu}}<br>
{{contact.service}}<br>
{{contact.adressePhysiqueLigne}}<br>
{% if contact.adressePhysiqueComplementaire %}
{{contact.adressePhysiqueComplementaire}}
{% endif %}
{{contact.adressePhysiqueVille}}</p>
</div>
<div>
<p class="title">Contact téléphonique et courriel</p>
<p>Tél : {{contact.telephone}}</p>
<p>Adresse mail : <a href="mailto:{{contact.mail}}">{{contact.mail}}</a></p>
</div>
</div>
</div>
{% endfor %}

View File

@ -1,8 +1,8 @@
{% load assets %}
{% for contact in json.data %}
<h3 style="background-image: url('{{ contact.logo }}')">{{contact.service}}</h3>
<div>
<h3 class="service-title" style="background-image: url('{{ contact.logo }}')">{{contact.service}}</h3>
<div class="service-details">
<div>
<p class="title">Adresse postale:</p>
<p>{{contact.organisme}}<br />