{% load combo gnm l10n assets %}
{% with pmr=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 pmr {% if is_place_page %}is-place{% endif %}" data-place-type="pmr" 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:pmr" size=size crop="center" %})"></div>
  {% else %}
  <div class="tile-picture" style="background-image: url({% asset_url place_page.picture "picture:pmr" size=size crop="center" %})"></div>
  {% endif %}
      <div class="tile-head">
        <div class="tile-title">
          <h2>{{pmr.properties.nom}}</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=pmr url=cell|place_page_url %}
        {% placeholder "infos-pratiques" %}
      </div>

      <div class="place-data">
      <div class="adresse">
        <h3>Adresse</h3>
        <div>
        {% if pmr.properties.adresse_complement %}{{pmr.properties.adresse_complement}}<br>{% endif %}
        {{pmr.properties.adresse}}<br>
        {{pmr.properties.code_postal}} {{pmr.properties.ville}}
        </div>
        {% localize off %}
        <a class="action-goto" data-lat="{{pmr.geometry.coordinates.1}}" data-lng="{{pmr.geometry.coordinates.0}}" href="/m-y-rendre/?to={{cell.id}}">M’y rendre</a>
        {% endlocalize %}
      </div> <!-- adresse -->

      <div class="horaires">

      </div> <!-- adresse -->
      </div> <!-- place-data -->

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

      </div> <!-- tile-content -->
      {% else %}
      <div class="tile-content">
        <p>
          {% if pmr.properties.numero_voie != '' %}Situé au numéro : {{pmr.properties.numero_voie}}<br />{% endif %}
          {% if pmr.properties.nb_places != '' %}<b>{{pmr.properties.nb_places}} place{{pmr.properties.nb_places|pluralize}}</b><br />{% endif %}
          {% if pmr.properties.configuration != '' %}<img src="/static/toodego/img/parking-type.png" class="parking-type {{pmr.properties.configuration|lower}}" /><span class="parking-type {{pmr.properties.configuration|lower}}">en {{pmr.properties.configuration|lower}}</span><br />{% endif %}
        </p>
      </div>
      <div class="tile-actions">
        {% localize off %}
        <a class="action-goto" data-lat="{{pmr.geometry.coordinates.1}}" data-lng="{{pmr.geometry.coordinates.0}}" href="/m-y-rendre/?to={{cell.id}}">M’y rendre</a>
        {% endlocalize %}
      </div>
      {% endif %}
    </div>
{% endwith %}
