{% with portail_slug=portail_name|lower|slugify %}
  {% block cell-content %}
    <h2 class="cell--title">
      {{ title }}
    </h2>
    <div class="cell--body">
      <form class="choix-collectivite--form">
        <label for="choix-collectivite--select">
          Pour changer de collectivité
        </label>
        <select id="choix-collectivite--select-{{ cell.id }}" class="choix-collectivite--select">
          <option value="">Sélectionnez</option>
          {% for link in links %}
            <option value="{{ link.url }}">{{ link.title }}</option>
          {% endfor %}
        </select>
      </form>
    </div>
  {% endblock %}
  <script>
    $(function() {
      $('#choix-collectivite--select-{{ cell.id }}').change(function(e){
        const link = this.options[this.selectedIndex].value;
        if (link) {
          window.location.href = link;
        }
      })
    });
  </script>
{% endwith %}

