<%inherit file="/template.html" />
<%def name="title()">${_("Delegation: %s") % c.scope.label}</%def>

<%def name="breadcrumbs()">
    ${h.delegateable.breadcrumbs(c.scope)|n} &raquo; ${_("Delegation")}
</%def>

<%block name="headline">
<div class="top_actions title">
%if can.delegation.delete(c.delegation):
    <a class="button delete ttip" title="${_('Cancel this delegation.')}" href="${h.base_url('/delegation/%d?_method=DELETE&amp;%s' % (c.delegation.id, h.url_token()))}">${_("revoke")}</a>
%endif
</div>
<h1>${_("Delegation: %s") % h.delegateable.link(c.scope)|n}</h1>
</%block>

<%block name="sidebar">
    <div class="tile sidebar_box">
        <h3>${_("Delegation")}</h3>
        <ul class="nobullet">
            <li>
                ${_("from %s") % h.user.link(c.delegation.principal)|n}</li>
            <li>
                ${_("to %s") % h.user.link(c.delegation.agent)|n}</li>
        </ul>
        <div class="meta">
            ${_("established %s") % h.datetime_tag(c.delegation.create_time)|n}
            %if c.delegation.is_revoked():
                 · ${_("revoked %s") % h.datetime_tag(c.delegation.revoke_time)|n}
            %endif
        </div>
        <br/>
        <p>${_("The delegation can be overridden or revoked at any time.")}</p>
    </div>
</%block>

<%block name="main_content">
    %if c.decisions_pager.items:
        <div class="table">
            ${c.decisions_pager.here()}
        </div>
    %else:
        <div class="infobox">
            ${_("No decisions have been based on this delegation yet. As soon as this delegation leads to any decisions, they will be listed here.")}
        </div>
    %endif
</%block>
