saumur: added city selector cell (#71821)
This commit is contained in:
parent
1a2d97e426
commit
f8b4ed979b
|
@ -216,6 +216,15 @@ div.link-cell {
|
|||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
// communes selector
|
||||
|
||||
div#services-communes {
|
||||
select {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
// forms
|
||||
.form-content {
|
||||
@extend %cell;
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
{% block cell-content %}
|
||||
<h2>{{ title }}</h2>
|
||||
<div class="cell--body">
|
||||
<form>
|
||||
<select id="commune--select-{{ cell.id }}">
|
||||
<option value="">Sélectionnez</option>
|
||||
{% for link in links %}
|
||||
<option value="{{ link.url }}">{{ link.title }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<p>Sélectionnez une commune pour découvrir ses services en ligne.</p>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
<script>
|
||||
$(function() {
|
||||
$('#commune--select-{{ cell.id }}').change(function(e){
|
||||
const link = this.options[this.selectedIndex].value;
|
||||
if (link) {
|
||||
window.location.href = link;
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
Loading…
Reference in New Issue