<%inherit file="/template.html" />
<%namespace name="tiles_html" file="/milestone/tiles.html"/>
<%namespace name="components" file="/components.html"/>
<%namespace name="forms" file="/forms.html"/>
<%def name="title()">${_("New milestone")}</%def>

<%def name="breadcrumbs()">
    ${h.milestone.breadcrumbs(None)|n} &raquo; ${_("New")}
</%def>

<%block name="main_content">

    <h3>${_("New milestone")}</h3>
<div class="form_wrapper">

  <form name="create_milestone" class="inplace" method="POST" action="${h.base_url('/milestone')}">
    ${h.field_token()|n}
        <div>
            <label for="title">${_("Milestone title")}</label>
            <input name="title" autofocus />
        </div>

        <label for="text">${_("Milestone description")}</label>
        <div class="infobox">
            ${_("Give a brief description of the milestone.")|n}
        </div>
        <textarea class="description" name="text"></textarea>
        ${components.formatting()}
        <br/>
        <label for="time">${_("Date of the milestone")}</label>
        <input name="time" id="time" />
        <span class="hint">${_("Please use the DD.MM.YYYY format.")}</span>
        <br />
        <br />
        %if c.categories:
        <label for="category" class="">
            ${_('Category')}
        </label>
        <select id="category" name="category">
            <option value="">
                ${_('No Category')}
            </option>
            %for category in c.categories:
            <option class="ttip" title="${category.description}" value="${category.id}">
                ${category.title}
            </option>
            %endfor
        </select>
        %endif
        %if h.config.get_bool('adhocracy.milestone.allow_show_all_proposals'):
        ${forms.checkbox(_(u"Show all proposals"), 'show_all_proposals', help=_(u"Show all open proposals if milestone is in the future."))}
        %endif

    <div class="input_wrapper">
        ${components.form_watch(None, checked=True)}
    </div>
    <div class="input_wrapper submit ">
        ${components.savebox(h.base_url("/milestone"))}
    </div>
</form>
</div>
</%block>
