{% load combo gnm l10n assets %}
{% with toilette=json.features.0 is_place_page=page|is_place_page place_page=cell|place_page %}
  {% get_tile_picture_size page as size %}
  <div class="tile toilette {% if is_place_page %}is-place{% endif %}" data-place-type="toilette" data-tile-cache="300">
  {% if is_place_page %}
  {% placeholder "infos-pratiques" name="Infos pratiques" render=False %}
  <div class="tile-picture" style="background-image: url({% asset_url place_page.picture "picture:banner:toilette" size=size crop="center" %})"></div>
  {% else %}
  <div class="tile-picture" style="background-image: url({% asset_url place_page.picture "picture:toilette" size=size crop="center" %})"></div>
  {% endif %}
      <div class="tile-head">
        <div class="tile-title">
          <h2 data-id="{{toilette.properties.gid}}">Toilette publique</h2>
          <span class="producer" style="background-image: url({% asset_url "logo:grandlyon" %})">Grand Lyon</span>
        </div>
      </div>
      {% include "combo/dashboard_cell_icons.html" %}
      {% if is_place_page %}
      <div class="tile-content">

      <div class="place-info">
        {% include "combo/json/includes/share.html" with place=toilette url=cell|place_page_url %}
      </div>

      <div class="place-data">
        <div>
        {% if toilette.properties.adresse %}{{toilette.properties.adresse}}<br>{% endif %}
        {% if toilette.properties.infoloc %}{{toilette.properties.infoloc}}<br>{% endif %}
        {% if toilette.properties.commune %}{{toilette.properties.commune}}<br>{% endif %}

        {% if toilette.properties.acceshandi and toilette.properties.acceshandi == 'true' %}Accessible handicapés<br>{% endif %}
                {% if toilette.properties.payant and toilette.properties.payant == 'true' %}Payant<br>{% endif %}
                {% if toilette.properties.hommes and toilette.properties.hommes == 'true' %}Hommes<br>{% endif %}
                {% if toilette.properties.femmes and toilette.properties.femmes == 'true' %}Femmes<br>{% endif %}
                {% if toilette.properties.unisexe and toilette.properties.unisexe == 'true' %}Unisexe<br>{% endif %}
                {% if toilette.properties.enfants and toilette.properties.enfants == 'true' %}Enfants{% endif %}
        {% localize off %}
        <a class="action-goto" data-lat="{{toilette.geometry.coordinates.1}}" data-lng="{{toilette.geometry.coordinates.0}}" href="/m-y-rendre/?to={{cell.id}}">M’y rendre</a>
        {% endlocalize %}

                {% include "combo/json/includes/horaires.html" with place=toilette %}
                </div>
      </div> <!-- place-data -->

      {% gnm_place_map toilette.geometry.coordinates.1 toilette.geometry.coordinates.0 %}

      </div> <!-- tile-content -->
      {% else %}
        {% if toilette.properties.adresse %}{{toilette.properties.adresse}}<br>{% endif %}
        {% if toilette.properties.infoloc %}{{toilette.properties.infoloc}}<br>{% endif %}
        {% if toilette.properties.commune %}{{toilette.properties.commune}}<br>{% endif %}
        <p>
        {% if toilette.properties.acceshandi and toilette.properties.acceshandi == 'true' %}<span class="handi-toilette"> Accessible handicapés</span><br>{% endif %}
        {% if toilette.properties.payant and toilette.properties.payant == 'true' %}<span class="payant-toilette"> Payant</span><br>{% endif %}
        {% if toilette.properties.femmes and toilette.properties.femmes == 'true' %}<span class="femmes-toilette"> Femmes</span><br>{% endif %}
        {% if toilette.properties.hommes and toilette.properties.hommes == 'true' %}<span class="hommes-toilette"> Hommes</span><br>{% endif %}
        {% if toilette.properties.unisexe and toilette.properties.unisexe == 'true' %}<span class="unisexe-toilette"> Unisexe</span><br>{% endif %}
        {% if toilette.properties.enfants and toilette.properties.enfants == 'true' %}<span class="unisexe-toilette"> Enfants</span><br>{% endif %}
        </p>
      <div class="tile-actions">
        {% localize off %}
        <a class="action-goto" data-lat="{{toilette.geometry.coordinates.1}}" data-lng="{{toilette.geometry.coordinates.0}}" href="/m-y-rendre/?to={{cell.id}}">M’y rendre</a>
        {% endlocalize %}
                {% if toilette.properties.web and toilette.properties.web != 't' %}
                        <a class="action-more-info" href="{{toilette.properties.web}}" target="_blank" rel="noopener">d’infos</a>
                {% endif %}
      </div>
      {% endif %}
    </div>
{% endwith %}
