dordogne-cd24: add "coordonnées générales" json cell (#49635)

This commit is contained in:
Serghei Mihai 2020-12-24 11:49:08 +01:00
parent cb3a8f8762
commit ff05dfcf76
4 changed files with 48 additions and 4 deletions

View File

@ -593,7 +593,8 @@ div.cell.contact-service {
}
/* customize json contact commune cell */
div.cell.contact-commune, div.cell.contact-commune-rgpd {
div.cell.contact-commune, div.cell.contact-commune-rgpd,
div.coordonnees-generales {
> div > div {
padding-top: 0.4em;
margin-top: 10px;
@ -606,7 +607,7 @@ div.cell.contact-commune, div.cell.contact-commune-rgpd {
}
div.cell.contact-service, div.cell.contact-commune,
div.cell.contact-commune-rgpd {
div.cell.contact-commune-rgpd, div.coordonnees-generales {
h3.service-title {
margin-left: 1em;
margin-right: 1em;

View File

@ -48,6 +48,18 @@
"required": true
}
]
},
"coordonnees-generales": {
"cache_duration": 60,
"name": "Cellule coordonnées générales",
"url": "{{ webservice_url }}",
"form": [
{
"label": "URL du webservice",
"varname": "webservice_url",
"required": true
}
]
}
},
"COMBO_PUBLIC_TEMPLATES.update": {

View File

@ -1,5 +1,5 @@
function handle_details_display() {
$('div.contact-commune select, div.contact-commune-rgpd select').on('change', function() {
$('div.contact-commune select, div.contact-commune-rgpd select, div.coordonnees-generales select').on('change', function() {
var $parent = $(this).parent();
$parent.find('> div').hide();
$parent.find('div#commune-' + this.value).show();
@ -10,6 +10,6 @@ $(function() {
handle_details_display();
$(document).on('combo:cell-loaded load', function() {
handle_details_display();
$('div.contact-commune select').trigger('change');
$('div.contact-commune select, div.coordonnees-generales select').trigger('change');
});
});

View File

@ -0,0 +1,31 @@
<h3>Contacter la collectivité</h3>
<p>Veuillez choisir votre commune</p>
<select>
<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.adressePhysiqueLigne}}<br />
{% if contact.adressePhysiqueComplementaire %}
{{contact.adressePhysiqueComplementaire}}
{% endif %}
{{contact.adressePhysiqueVille}}</p>
<p>Tél : {{contact.telephone}}</p>
<p>Adresse mail : <a href="mailto:{{contact.mail}}">{{contact.mail}}</a></p>
</div>
<div>
<p class="title">Horaires d'accueil du public</p>
<p>{{contact.horaires}}</p>
</div>
</div>
</div>
{% endfor %}