{% load combo gnm l10n assets %}
{% with parc_velo=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 parc-velo {% if is_place_page %}is-place{% endif %}" data-place-type="parc-velo" 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:parc-velo" size=size crop="center" %})"></div>
  {% else %}
  <div class="tile-picture" style="background-image: url({% asset_url place_page.picture "picture:parc-velo" size=size crop="center" %})"></div>
  {% endif %}
      <div class="tile-head">
        <div class="tile-title">
          <h2>Stationnement vélo {% if parc_velo.properties.adresse != '' %}{{parc_velo.properties.adresse}}{% else %}{{parc_velo.properties.nom}}{%endif%}</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=parc_velo url=cell|place_page_url %}
        {% placeholder "infos-pratiques" %}
      </div>
      <div class="place-data">
      <div class="adresse">
        <h3>Adresse</h3>
        <div>
        {% if parc_velo.properties.adresse_complement %}{{parc_velo.properties.adresse_complement}}<br>{% endif %}
        {{parc_velo.properties.adresse}}<br>
        {{parc_velo.properties.code_postal}} {{parc_velo.properties.ville}}
        </div>
        {% localize off %}
        <a class="action-goto" data-lat="{{parc_velo.geometry.coordinates.1}}" data-lng="{{parc_velo.geometry.coordinates.0}}" href="/m-y-rendre/?to={{cell.id}}">M’y rendre</a>
        {% endlocalize %}
      </div> <!-- adresse -->
      </div> <!-- place-data -->
      {% gnm_place_map parc_velo.geometry.coordinates.1 parc_velo.geometry.coordinates.0 %}
      </div> <!-- tile-content -->
      {% else %}
      <div class="tile-content">
        {% if parc_velo.properties.commune != '' %}{{parc_velo.properties.commune}}<br />{% endif %}
        <p>
        {% if parc_velo.properties.capacite != '' %}<b>{{parc_velo.properties.capacite}} place{{parc_velo.properties.capacite|pluralize}}</b>{% endif %}
        {% if parc_velo.properties.localisation != '' %}<br />{{parc_velo.properties.localisation|lower}}{% endif %}{% if parc_velo.properties.abrite != '' and parc_velo.properties.localisation != '' %}, {% endif %}{% if parc_velo.properties.abrite == 'Non' %}non abrité{% elif parc_velo.properties.abrite == 'Oui' %}abrité{% endif %}
        {% if parc_velo.properties.duree != '' and parc_velo.properties.duree == "Longue durée" %}<br />Parking sécurisé{% endif %}
        </p>
      </div>
      <div class="tile-actions">
        {% localize off %}
        <a class="action-goto" data-lat="{{parc_velo.geometry.coordinates.1}}" data-lng="{{parc_velo.geometry.coordinates.0}}" href="/m-y-rendre/?to={{cell.id}}">M’y rendre</a>
        {% endlocalize %}
      </div>
      {% endif %}
    </div>
{% endwith %}
