<%namespace name="components" file="/components.html"/>

<%def name="row(tile, instance)">
    <li class="content_box">
        %if tile.show_icon():
        <img class="logo" src="${h.logo_url(instance, 32, x=32)}" />
        %endif
        <div>
            <h3>
                <a class="link" href="${h.entity_url(instance)}">${instance.label}</a>
                <span id="badges_${instance.id}" class="badges" data-id="${instance.id}">
                    <!--TODO: update tile cache after changing badges [joka]-->
                    ${tiles.badge.badges(instance.badges)}
                </span>
                %if can.badge.edit_instance():
                ## NOTE: Don't use entity_url in href due to same-origin-policy issue (#621)
                <a class="button_small edit"
                   href="${'/instance/%s/badges' % instance.key}"
                   rel="#overlay-form">${_(u"Edit Badges")}</a>
                %endif
            </h3>
            <div class="meta">
                ##${h.user.link(instance.creator)|n} ·
                ${_("created %s") % h.datetime_tag(instance.create_time)|n} ·
                ${ungettext("%s proposal", "%s proposals", tile.num_proposals) % tile.num_proposals}

                %if instance.use_norms:
                    ·
                    ${ungettext("%s norm", "%s norms", tile.num_norms) % tile.num_norms}
                %endif
            </div>
        </div>
    </li>
</%def>

<%def name="header(tile, instance, active, no_panel)">
</%def>
