## -*- coding: utf-8 -*-
<%inherit file="/base/base.html"/>

<%block name="title">
    %if c.show_private:
        ${_('Private Gists for User %s') % c.authuser.username}
    %elif c.show_public:
        ${_('Public Gists for User %s') % c.authuser.username}
    %else:
        ${_('Public Gists')}
    %endif
</%block>

<%def name="breadcrumbs_links()">
    %if c.show_private:
        ${_('Private Gists for User %s') % c.authuser.username}
    %elif c.show_public:
        ${_('Public Gists for User %s') % c.authuser.username}
    %else:
        ${_('Public Gists')}
    %endif
    - ${c.gists_pager.item_count}
</%def>

<%block name="header_menu">
    ${self.menu('gists')}
</%block>

<%def name="main()">
<div class="box">
    <!-- box / title -->
    <div class="title">
        ${self.breadcrumbs()}
        %if c.authuser.username != 'default':
        <ul class="links">
          <li>
             <a href="${h.url('new_gist')}" class="btn btn-small btn-success"><i class="icon-plus"></i> ${_('Create New Gist')}</a>
          </li>
        </ul>
        %endif
    </div>
    %if c.gists_pager.item_count>0:
        % for gist in c.gists_pager:
          <div class="gist-item" style="padding:10px 20px 10px 15px">

            <div class="gravatar">
              ${h.gravatar(gist.owner.email, size=28)}
            </div>
            <div title="${gist.owner.full_contact}" class="user" style="font-size: 16px">
                <b>${h.person(gist.owner.full_contact)}</b> /
                <b><a href="${h.url('gist',gist_id=gist.gist_access_id)}">gist: ${gist.gist_access_id}</a></b>
            </div>
            <div style="padding: 4px 0px 0px 0px">
                ${_('Created')} ${h.age(gist.created_on)} /
                <span style="color: #AAA">
                  %if gist.gist_expires == -1:
                   ${_('Expires')}: ${_('Never')}
                  %else:
                   ${_('Expires')}: ${h.age(h.time_to_datetime(gist.gist_expires))}
                  %endif
                </span>
            </div>

            <div style="border:0px;padding:10px 0px 0px 40px;color:#AAA">${gist.gist_description}</div>
          </div>
        % endfor

        <div class="notification-paginator">
          <div class="pagination-wh pagination-left">
          ${c.gists_pager.pager('$link_previous ~2~ $link_next', **request.GET.mixed())}
          </div>
        </div>
    %else:
        <div class="table">${_('There are no gists yet')}</div>
    %endif
</div>
</%def>
