<%inherit file="/template.html" />
<%namespace name="components" file="/components.html"/>
<%namespace name="badge_tiles" file="/badge/tiles.html"/>
<%def name="title()">${_("Edit badges for %s") % c.proposal.title}</%def>

<%def name="breadcrumbs()">
${h.proposal.breadcrumbs(c.proposal)|n} &raquo; ${_("Edit Badges")}
</%def>


<%block name="main_content">
<form name="settings" class="inplace" method="POST"
      action="${h.entity_url(c.proposal, member='update_badges')}">

    ${h.field_token()|n}
    <h3>${_(u"Badges")}</h3>

    <fieldset>
        <legend>${_("Badges")}</legend>

        %if c.badges:
        <ul class="nobullet">
            %for badge in c.badges:
            <li>
                <label>
                    <input type="checkbox" value="${badge.id}"
                           name="badge" />
                    ${badge_tiles.badge(badge)}
                </label>
            </li>
            %endfor
        </ul>
        %else:
        <p>${_(u"No Badges")}</p>
        %endif
    </fieldset>

    <fieldset>
        <legend>${_("Status Badge")}</legend>

        %if c.thumbnailbadges:
        <ul class="nobullet">
            <li>
                <label>
                    <input type="radio" value=""
                           name="thumbnailbadge" />
                    ${_('No Status Badge')}
                </label>
            </li>
            %for badge in c.thumbnailbadges:
            <li>
                <label>
                    <input type="radio" value="${badge.id}"
                           name="thumbnailbadge" />
                    ${badge_tiles.badge(badge)}
                </label>
            </li>
            %endfor
        </ul>
        %else:
        <p>${_(u"No Status Badges")}</p>
        %endif
    </fieldset>

    ${components.savebox(h.base_url("/proposal/%s" % c.proposal.id))}
</form>
</%block>
