<%inherit file="/template.html" />
<%namespace name="components" file="/components.html"/>
<%def name="title()">${_(u"Categories")}</%def>

<%def name="breadcrumbs()">
${h.category.breadcrumbs(None)|n}
</%def>


<%block name="headline">

<h2>${_(u"Categories")}
%if can.instance.any_admin():
<a class="button_small edit"
    href="${h.base_url('/badge/category')}"
    rel="#overlay-form">${_(u"Edit")}</a>
%endif
</h2>

<hr />

<div class="tile-table">
    <% counter = 0 %>

    %for category in c.categories:

    %if counter % 3 == 0:
    <div class="tile-row">
    %endif

        <a class="tile" href="${h.base_url(member='category/%s' % category.id)|n}">
            <img class="tile-image" src="${h.logo_url(category, 128, 256)}" alt="" />
            <h3>${category.title}</h3>
            <p>${category.description}</p>
            <span class="button tile-button">${_('View and discuss')}</span>
        </a>

    <% counter += 1 %>
    %if counter % 3 == 0:
    </div>
    %endif

    %endfor

    %if counter % 3 != 0:

    %for i in range(counter % 3, 3):
        <span class="tile"></span>
    %endfor

    </div>
    %endif
</div>

</%block>
