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

<%def name="breadcrumbs()">
    ${h.instance.breadcrumbs()|n} ${h.url.link(_("Instances"), h.base_url('/instance'))|n}
</%def>


<%block name="sidebar">
    ${c.instance_pager.render_facets(cls='sidebar_box')}
</%block>

<%block name="main_content">
<div class="morelink_header">
    <h1 class="page_title">${_("Instances")}</h1>

    %if can.instance.create():
    <a class="more_link"
       href="${h.base_url('/instance/new')}">${_("Create new instance")}</a>
    %endif
</div>

<p>${_("Instances are little democracies that are ran by their community.")}</p>

<div class="table" id="instance_table">

    ${c.instance_pager.render_pager()}

    %if can.badge.edit_instance():
    <div class="overlay" id="edit_badges_container">
        <form id="edit_badges">
            ${h.field_token()|n}
            <h5 data-bind="text: selected.title">Title</h5>
            <ul data-bind="foreach: selected.badges">
                <li class="nobullet">
                <input class="badgetsform_input" type="checkbox"
                name="badge"
                data-bind="value: id, checked: checked">
                <span data-bind="attr: {class: css_class()}">
                    <a data-bind="text: title">Abgelehnt</a>
                </span>
                </input>
                </li>
            </ul>
            <a href="#" class="button" data-bind="click: save">Save</a>
            or
            <a href="" data-bind="click: cancel">Cancel</a>
        </form>
    </div>
    %endif

</div>

<div class="list_button">
    %if can.instance.create():
    <a class="button title add" href="/instance/new">${_("new instance")}</a>
    %endif
</div>
</%block>


