{% load combo gnm %}
<h2>Gérer mes données</h2>
{% get_gnm_portal_url as gnm_portal_url %}
<div class="profile-data">
  <h3>Mes données GrandLyon Connect
    {% if request.GET.from == "glc" %}
      <span class="refresh">(rafraîchissement des données en cours)</span>
      <script>window.history.replaceState("reload", "", window.location.pathname);</script>
    {% endif %}
  </h3>
  <ul>
  <li><span class="name">{% if json.title %}{{ json.title }} {% endif %}{{ request.user.first_name }} {{request.user.last_name }}</span></li>
  {% if request.user.email %}
  <li><span class="email">{{ request.user.email }}</span></li>
  {% endif %}
  {% if json.address_street %}
  <li><span class="home">{% if json.address_number %}{{ json.address_number }}, {% endif %}
            {{ json.address_street }}
            {{ json.address_complement }}
            {{ json.address_zipcode }}
            {{ json.address_city }}
            {{ json.address_country }}</span></li>
  {% endif %}
  {% if json.birthdate %}<li><span class="birthdate">{{ json.birthdate|parse_date }}{% if json.birthplace or json.birthcountry %}, {{ json.birthplace}} {{json.birthcountry}}{% endif %}
          {% now "m-d" as today %}
          {% if json.birthdate|parse_date|date:"m-d" == today %} <span class="birthday">(bon anniversaire 🎂)</span>{% endif %}</span>{% endif %}
  {% if json.phone %}<li><span class="private-phone">{{ json.phone }}</span></li>{% endif %}
  {% if json.mobile %}<li><span class="private-mobile">{{ json.mobile }}</span></li>{% endif %}
  {% if json.professional_phone %}<li><span class="professional-phone">{{ json.professional_phone }} (pro)</span></li>{% endif %}
  {% if json.professional_mobile_phone %}<li><span class="professional-mobile">{{ json.professional_mobile_phone }} (pro)</span></li>{% endif %}
    <li><a class="pk-button" href="{{ cut_url }}?next={{ gnm_portal_url|iriencode }}mon-compte/mes-donnees/%3Ffrom%3Dglc" class="account">Accéder à mon compte GRANDLYON CONNECT</a></li>
  </ul>
</div>
