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

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


<%block name="headline">

</%block>

<%block name="main_content">
<h2 id="proposal_list_header">${_("Proposals")}</h2>

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

<div class="hr"><hr /></div>
<div class="list_filter" id="proposals-search">
<form class="list_form" action="?" method="GET" autocomplete="off">
    <label class="floating" for="proposals_q">${_("Find proposals")}</label>
    <input class="q" 
           id="proposals_q" class="live_search" name="proposals_q" 
           type="text" value="${request.params.get('proposals_q', '')}" 
           tabindex="1" />
    <input type="submit" value="${_('Go')}" 
           class="go" />

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

%if can.badge.edit_instance():
    <div class="simple_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>
            <ul data-bind="foreach: selected.thumbnailbadges">
                <li class="nobullet">
                    <input class="badgetsform_input" type="radio" 
                           name="thumbnailbadge" 
                           data-bind="value: id, checked: checked">
                        <span data-bind="html: thumbnail" />
                        <span data-bind="attr: {class: css_class()}">
                            <a data-bind="text: title">Abgelehnt</a>
                        </span>
                    </input>
                    <br />
                </li>
            </ul>      
            <a href="#" class="btn" data-bind="click: save">Save</a> 
            or 
            <a href="" data-bind="click: cancel">Cancel</a>
        </form>
    </div>
%endif
</div>

%if can.badge.edit_instance():
    <% h.need.adhocracy_ko %>
    <script>
        var editModel = new adhocracy.ko.editBadges('proposal/');
        editModel.applyToPager('#proposals_table');
    </script>
%endif

    <br/>
    <div class="top_actions aside" id="new-proposal">
        %if auth:
            <a class="button add ttip" 
               title="${_('Introduce a new idea to debate.')}" 
               href="${h.base_url('/proposal/new')}">${_("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">${_("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">${_("new proposal")}</a>
        %elif auth.propose_validate_email():
            <a class="button add ttip" 
               title="${_('Validate email in order to create a new proposal.')}" 
               href="${h.base_url('/proposal/new')}" 
               rel="#overlay-validate-button">${_("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">
    <div id="proposals_facets">
        ${c.proposals_pager.render_facets()}    
    </div>
</%block>
<commit_msg>Fix: apply badges popup shows wrong default seletion<commit_after><%inherit file="/template.html" />
<%namespace name="components" file="/components.html"/>
<%def name="title()">${_("Proposals")}</%def>

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


<%block name="headline">

</%block>

<%block name="main_content">
<h2 id="proposal_list_header">${_("Proposals")}</h2>

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

<div class="hr"><hr /></div>
<div class="list_filter" id="proposals-search">
<form class="list_form" action="?" method="GET" autocomplete="off">
    <label class="floating" for="proposals_q">${_("Find proposals")}</label>
    <input class="q" 
           id="proposals_q" class="live_search" name="proposals_q" 
           type="text" value="${request.params.get('proposals_q', '')}" 
           tabindex="1" />
    <input type="submit" value="${_('Go')}" 
           class="go" />

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

%if can.badge.edit_instance():
    <div class="simple_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="attr: {value: id, checked: checked}">
                        <span data-bind="attr: {class: css_class()}">
                            <a data-bind="text: title">Abgelehnt</a>
                        </span>
                    </input>
                </li>
            </ul>
            <ul data-bind="foreach: selected.thumbnailbadges">
                <li class="nobullet">
                    <input class="badgetsform_input" type="radio" 
                           name="thumbnailbadge" 
                           data-bind="attr: {value: id, checked: checked}">
                        <span data-bind="html: thumbnail" />
                        <span data-bind="attr: {class: css_class()}">
                            <a data-bind="text: title">Abgelehnt</a>
                        </span>
                    </input>
                    <br />
                </li>
            </ul>      
            <a href="#" class="btn" data-bind="click: save">Save</a> 
            or 
            <a href="" data-bind="click: cancel">Cancel</a>
        </form>
    </div>
%endif
</div>

%if can.badge.edit_instance():
    <% h.need.adhocracy_ko %>
    <script>
        var editModel = new adhocracy.ko.editBadges('proposal/');
        editModel.applyToPager('#proposals_table');
    </script>
%endif

    <br/>
    <div class="top_actions aside" id="new-proposal">
        %if auth:
            <a class="button add ttip" 
               title="${_('Introduce a new idea to debate.')}" 
               href="${h.base_url('/proposal/new')}">${_("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">${_("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">${_("new proposal")}</a>
        %elif auth.propose_validate_email():
            <a class="button add ttip" 
               title="${_('Validate email in order to create a new proposal.')}" 
               href="${h.base_url('/proposal/new')}" 
               rel="#overlay-validate-button">${_("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">
    <div id="proposals_facets">
        ${c.proposals_pager.render_facets()}    
    </div>
</%block>

{'fraction_non_alphanumeric': 0.18747171177695302, 'fraction_numerical': 0.0009052231375033946, 'mean_word_length': 2.3177177177177177, 'pattern_counts': {'":': 0, '<': 201, '<?xml version=': 0, '>': 201, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5553250', 'n_tokens_mistral': 3575, 'n_tokens_neox': 3452, 'n_words': 623}