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

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

<%block name="headline">
</%block>


<%block name="main_content">
<div class="morelink_header">
    <h2>${_(u"Proposals")}</h2>

    <% auth = check.proposal.create() %>
    %if auth:
    <a class="more_link"
       title="${_('Introduce a new idea to debate.')}"
       href="${h.base_url('/proposal/new')}">${_(u"Create new proposal")}</a>
    %elif auth.propose_join():
    <a class="more_link"
       title="${_('Join instance to create a new proposal.')}"
       href="${h.base_url('/proposal/new')}"
       rel="#overlay-join-button">${_(u"Create new proposal")}</a>
    %elif auth.propose_login():
    <a class="more_link"
       title="${_('Login to create a new proposal.')}"
       href="${h.base_url('/proposal/new')}"
       rel="#overlay-login-button">${_(u"Create new proposal")}</a>
    %elif auth.propose_validate_email():
    <a class="more_link"
       title="${_('Validate email in order to create a new proposal.')}"
       rel="#overlay-validate-button">${_(u"Create new proposal")}</a>
    %endif
</div>

<hr />

<div class="list_filter" id="proposals-search">
    ${forms.search(name='proposals_q', placeholder=_(u'Find proposals'), value=request.params.get('proposals_q', ''))}
</div>

<div id="proposals_table" class="table">
    ${c.proposals_pager.render_pager()}
</div>

<div class="list_button" id="new-proposal">
    %if auth:
    <a class="button add ttip"
       title="${_('Introduce a new idea to debate.')}"
       href="${h.base_url('/proposal/new')}">${_(u"new proposal")}</a>
    %elif auth.propose_join():
    <a class="button add ttip"
       title="${_('Join instance to create a new proposal.')}"
       href="${h.base_url('/proposal/new')}"
       rel="#overlay-join-button">${_(u"new proposal")}</a>
    %elif auth.propose_login():
    <a class="button add ttip"
       title="${_('Login to create a new proposal.')}"
       href="${h.base_url('/proposal/new')}"
       rel="#overlay-login-button">${_(u"new proposal")}</a>
    %elif auth.propose_validate_email():
    <a class="button add ttip"
       title="${_('Validate email in order to create a new proposal.')}"
       rel="#overlay-validate-button">${_(u"new proposal")}</a>
    %endif
</div>


<%components:tutorial>
<ol id="joyRideTipContent">
    <li data-id="proposals_table"
        data-tip-location="top left" class="custom">
        ${_('tutorial_proposal_overview_table')}
    </li>

    <li data-id="proposals-search"
        data-tip-location="top right" class="custom">
        <p>${_('tutorial_proposal_overview_facets')}</p>
    </li>

    <li data-id="new-proposal" data-next="${_('Close')}"
        data-tip-location="top-left" class="custom">
        <p>${_('tutorial_proposal_overview_new')}</p>
    </li>
</ol>
</%components:tutorial>
</%block>


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