<html xmlns:py="http://genshi.edgewall.org/"
  xmlns:xi="http://www.w3.org/2001/XInclude">
  
  <py:def function="page_title">User Account - ${c.view_account.accountName}</py:def>

  <div py:match="content">
    <h2>User Account - ${c.view_account.accountName}</h2>
    <img src="${c.view_account.avatar}" height="60" width="60" />
    <dl>
      <py:if test="c.is_myself">
        <p>You are logged in. 
        <a href="${url(controller='account', action='logout')}">Log out</a></p>
          <py:if test="len(list(c.view_account.owners)) > 0">
            <dt>Mailbox</dt>
            <dd>${c.view_account.owners.pop().mbox}</dd>
          </py:if>
          <py:if test="len(list(c.view_account.owners.pop().openid)) > 0">
            <dt>Open id</dt>
            <dd>${c.view_account.owners.pop().openid}</dd>
          </py:if>
          <dt>Your API Key</dt>
          <dd>${c.view_account.apikey}</dd>
      </py:if>
      <dt>URI</dt>
      <dd>${c.view_account.identifier}</dd>
      <py:if test="len(list(c.view_account.collections)) > 0">
          <dt>Collections</dt>
          <dd>
            <ul>
              <li py:for="collection in c.view_account.collections" class="coll">
                <a href="${collection.identifier}">${collection.title}</a> - ${len(list(collection.entries))} works.
              </li>
            </ul>
          </dd>
      </py:if>
    </dl>
  </div>

  <xi:include href="../base.html" />
</html>
