<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">

  <xi:include href="master.html" />
  <xi:include href="lib.html" />

  <?python from pyforge.lib.security import has_project_access
           from pyforge.model import Project ?>

  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
    <title>${user.display_name}'s Profile</title>
    <link rel="stylesheet" type="text/css"
          href="${g.app_static('css/user_profile.css')}"/>
  </head>

  <body>
    <h1><py:if test="user.preferences.email_address">${gravatar(user.preferences.email_address)} </py:if>${user.display_name} (${user.username})</h1>
    ${Markup(c.project.description_html)}
    <div class="project-list">
      <span class="title">Projects</span>
      <ul>
        <li py:for="project in h.make_projects(user.projects)" py:if="not project.shortname.startswith('u/')">
            <a class="project-name" href="${project.url()}">${project.name}</a>
        </li>
      </ul>
    </div>
    <py:if test="c.user.username == user.username">
        <div class="address-list">
          <span class="title">Email Addresses</span>
          <ul>
            <li py:for="email in user.email_addresses">
                ${gravatar(email, size=24)}
                <span py:if="email == user.preferences.email_address" class="prime email-address">${email}</span>
                <span py:if="email != user.preferences.email_address" class="email-address">${email}</span>
            </li>
          </ul>
        </div>
        <div class="openid-list">
          <span class="title">OpenIDs</span>
          <ul>
            <li py:for="openid in user.open_ids">
                <span class="openid">${openid}</span>
            </li>
          </ul>
        </div>
    </py:if>
  </body>
</html>
