{% extends "base.html" %}
{% load i18n wagtailsettings_tags %}
{% get_settings %}

{% block content %}
  <div class="heading">
    <h1 class="heading__profiles">
      {% trans "Hello " %} {{ user.profile.migrated_username|default:user.username }}
    </h1>
  </div>
  <div class="profiles">
    <div class="profiles__account"
    <fieldset>
      <label>{% trans "As you type your name comment will appear as:" %}</label>
      <p class="profiles__description profiles__alias">{{ user.profile.alias | default:" Anonymous " }}</p>
    </fieldset>

    {% trans "Not set." as defaultText %}
    <fieldset>
      <label>{% trans "Date of Birth: " %}</label>
      <p class="profiles__description profiles__dob">
        {% if user.profile.date_of_birth %}
          {{ user.profile.date_of_birth | date:"M d, Y" }}
        {% else %}{{defaultText}}{% endif %}
      </p>
    </fieldset>

    {% if settings.profiles.UserProfilesSettings.show_mobile_number_field and settings.profiles.UserProfilesSettings.country_code %}
        <fieldset>
       <label for="id_mobile_number">{% trans "Mobile number:" %}</label>
       <p class="profiles__description profiles__description--mobile-number">{{ user.profile.mobile_number | default:defaultText}}</p>
    </fieldset>
    {% endif %}

    {% if settings.profiles.UserProfilesSettings.activate_gender %}
    <fieldset>
      <label for="id_gender">{% trans "Gender:" %}</label>
      <p class="profiles__description profiles__gender">
        {{ user.profile.gender | default:defaultText }}
      </p>
    </fieldset>
    {% endif %}

    {% if settings.profiles.UserProfilesSettings.activate_location %}
    <fieldset>
      <label for="id_location">{% trans "Location:" %}</label>
      <p class="profiles__description profiles__location">{{ user.profile.location | default:defaultText }}</p>
    </fieldset>
    {% endif %}

    {% if settings.profiles.UserProfilesSettings.activate_education_level %}
    <fieldset>
      <label for="education_level">{% trans "Education Level:" %}</label>
      <p class="profiles__description profiles__education_level">{{ user.profile.education_level | default:defaultText }}</p>
    </fieldset>
    {% endif %}

  <fieldset>
    {% if settings.profiles.UserProfilesSettings.show_email_field %}
      <label>{% trans "Email Address:" %}</label>
      <p class="profiles__description profiles__description__email">
        {{ user.email | default:defaultText }}</p>
    {% endif %}
  </fieldset>
  <div class="call-to-action call-to-action--profiles">
    <a href="{% url "molo.profiles:auth_logout" %}" class="call-to-action__button call-to-action__button--primary">{% trans "log out" %}</a>
    <a href="{% url "molo.profiles:edit_my_profile" %}" class="call-to-action__button call-to-action__button--primary">{% trans "Edit My Profile" %}</a>
    <a href="{% url "molo.profiles:profile_password_change" %}" class="call-to-action__button call-to-action__button--primary">{% trans "Change my pin" %}</a>
  </div>
</div>
{% endblock %}
