{# vim: set ts=2 et sts=2 sw=2: #}
{% extends "users/base.html" %}
{% set title = _('{user} | Profile')|f(user=profile.user.username) %}
{% set classes = 'profile' %}

{% block content %}
  <article id="profile" class="main">
    <section id="avatar-area">
      <img src="{{ profile_avatar(profile.user) }}" alt="">
    </section>
    <section id="main-area">
      <h1>{{ display_name(profile.user) }}
          {% if profile.name %}
            <em>({{ profile.user.username }})</em>
          {% endif %}
      </h1>
      <h2>
        {% if profile.city and profile.country %}
          {{ _('{city}, {country}')|f(city=profile.city,
                                      country=profile.country) }}
        {% elif profile.city %}
          {{ profile.city }}
        {% elif profile.country %}
          {{ profile.country }}
        {% endif %}
      </h2>
      {% if profile.public_email or profile.website or profile.twitter or
            profile.facebook or profile.irc_handle or
            (profile.livechat_id and
             profile.livechat_id|lower != profile.user.username|lower) %}
        <div id="contact-box">
          <ul>
            {% if profile.public_email %}
              <li>
                <label>{{ _('Email:') }}</label>
                {{ profile.user.email|public_email }}
              </li>
            {% endif %}
            {% if profile.website %}
              <li>
                <label>{{ _('Website:') }}</label>
                <a rel="nofollow" href="{{ profile.website }}">{{ profile.website }}</a>
              </li>
            {% endif %}
            {% if profile.twitter %}
              <li>
                <label>{{ _('Twitter:') }}</label>
                <a rel="nofollow" href="{{ profile.twitter }}">{{ profile.twitter }}</a>
              </li>
            {% endif %}
            {% if profile.facebook %}
              <li>
                <label>{{ _('Facebook:') }}</label>
                <a rel="nofollow" href="{{ profile.facebook }}">{{ profile.facebook }}</a>
              </li>
            {% endif %}
            {% if profile.irc_handle %}
              <li>
                <label>{{ _('IRC:') }}</label>
                {{ profile.irc_handle }}
              </li>
            {% endif %}
            {% if profile.livechat_id and
                  profile.livechat_id|lower != profile.user.username|lower %}
              <li>{{ _('Livechat ID: {livechat_id}')|f(livechat_id=profile.livechat_id) }}</li>
            {% endif %}
          </ul>
        </div>
      {% endif %}
      {% if profile.bio %}
        <div id="bio">
          <h2>{{ _('About {user}')|f(user=display_name(profile.user)) }}</h2>
          {{ profile.bio|wiki_to_html }}
        </div>
      {% endif %}
    </section>
  </article>
{% endblock %}
