<commit_before>{% load bb_ember %}
{% load i18n %}
{% load static %}

{% include "projects/manage.hbs" %}

{% tplhandlebars "components/bb-progressbar" %}

    <div {{bindAttr class=class}}><strong style="width: 0%;" class="slider-progress is-in-progress"><em class="slider-percentage">0%</em></strong></div>

{% endtplhandlebars %}


{% tplhandlebars "project_preview" %}

    <li class="project-item">

        {{#linkTo 'project' getProject }}
            <span class="project-header">

                <figure class="project-image">
                    <img {{bindAttr src="image" }} />
                </figure>

                <span class="project-title">
                    <h3>{{title}}</h3>
                    <span class="project-location"><span class="flaticon solid location-pin-1"></span> {{country.name}}</span>
                </span>
            </span>

            <span {{bindAttr class=":project-status phase"}}>
                {{#if isPhasePlan}}
                    <span class="project-phase"><span class="flaticon solid lightbulb-3"></span> <strong>{% trans "New" %}</strong> <em>{% trans "Smart Idea" %}</em></span>
                {{/if}}

                {{#if isPhaseCampaign}}
                    {{#if campaign.money_asked}}
                        <div class="project-fund-amount-slider"><strong style="width: 0%;" class="slider-progress is-in-progress"><em class="slider-percentage">0%</em></strong></div>
                        <span class="project-fund-amount"><strong>&euro;{{localize campaign.money_needed}}</strong> <em>{% trans "To go" %}</em></span>
                    {{/if}}
                    {{#if campaign.deadline }}
                        <span class="project-days-left"><span class="flaticon solid clock-1"></span> <strong>{{campaign.daysToGo}}</strong> <em>{% trans "days" %}</em></span>
                    {{/if}}
                {{/if}}

                {{#if isPhaseAct}}
                    <span class="project-phase"><span class="flaticon solid lightbulb-3"></span> <strong>{% trans "Project funded" %}</strong> <em>{% trans "Being realized" %}</em></span>
                {{/if}}

                {{#if isPhaseResults}}
                    <span class="project-phase"><span class="flaticon solid lightbulb-3"></span> <strong>{% trans "Project funded" %}</strong> <em>{% trans "Being realized" %}</em></span>
                {{/if}}

                {{#if isPhaseRealized}}
                    <span class="project-phase"><span class="flaticon solid lightbulb-3"></span> <strong>{% trans "Project realized" %}</strong> <em>{% trans "See results" %}</em></span>
                {{/if}}
            </span>

            <span class="project-description">
                {{{pitch}}}

                <span class="project-view">{% trans "View project" %}</span>
            </span>

        {{/linkTo}}

        {{#if taskCount}}
            <a class="project-tasks"><span class="flaticon solid wrench-1"></span> <strong>{{taskCount}}</strong> <em>{% trans "task(s) available" %}</em></a>
        {{/if}}
    </li>

{% endtplhandlebars %}


{% tplhandlebars "project_list" %}

    {{render "projectSearchForm" }}
    <div class="l-section">
        <section class="l-wrapper">
            {{#if model.isLoaded}}
                <ul id="search-results">
                    {{#each project in model}}
                        {{render "projectPreview" project}}
                    {{else}}
                        <li class="no-results">{% trans "No projects found." %}</li>
                    {{/each}}
                </ul>
            {{else}}
                <div class="is-loading-big"><img src="{% get_static_prefix %}images/loading.gif" /> <strong>{% trans "Loading projects" %}</strong></div>
            {{/if}}
        </section>
    </div>
    
{% endtplhandlebars %}


{% tplhandlebars "project_search_form" %}

    <div class="l-section" id="search">
        <section class="l-wrapper">
            <form id="search-form">
                <div class="control">
                    {{view Em.TextField valueBinding="text" placeholder="Search"}}
                    <span class="flaticon stroke zoom-2"></span>
                </div>
                <div class="control">
                    {{view App.ProjectCountrySelectView valueBinding="country" }}
                    <span class="flaticon solid earth-1"></span>
                </div>
                <div class="control">
                    {{view App.ThemeSelectView valueBinding="theme" }}
                    <span class="flaticon stroke tag-2"></span>
                </div>
                <div class="control">
                    {{view App.ProjectPhaseSelectView valueBinding="phase" }}
                    <span class="flaticon stroke flag-1"></span>
                </div>
            </form>
        </section>
    </div>

    <div class="l-section">
        <section class="l-wrapper">
            <article id="search-navigation">
                
                <header>
                    <h2>{% trans "Results" %} <em>{{controllers.projectList.model.meta.total}}</em></h2>
                    <a {{action 'clearForm'}} class="search-reset">
                        <span class="flaticon solid x-2"></span> {% trans "Reset Search Filter" %}
                    </a>
                </header>
                
                <div class="search-sort">
                    {% trans "Sort:" %}
                    <a {{action 'sortOrder' 'popularity'}} {{bindAttr class="orderedByPopularity:active"}}>{% trans "Most popular" %}</a>
                    {% comment %}
                        Disabled because the currently approved design does not include sorting by title.
                        Current design: https://www.dropbox.com/s/n34ndim6cdbm7vz/Project-Search-V2.png
                        <a {{action 'sortOrder' 'title'}} {{bindAttr class="orderedByTitle:active"}}>{% trans "Title" %}</a>
                    {% endcomment %}
                    <a {{action 'sortOrder' 'newest'}} {{bindAttr class="orderedByNewest:active"}}>{% trans "Newest" %}</a>
                    <a {{action 'sortOrder' 'money_needed'}} {{bindAttr class="orderedByNeeded:active"}}>{% trans "Almost funded" %}</a>
                    <a {{action 'sortOrder' 'deadline'}} {{bindAttr class="orderedByDeadline:active"}}>{% trans "Near deadline" %}</a>
                </div>
                
                <div class="search-pagination">
                    <span class="search-showing">{% trans "Showing" %} {{rangeStart}}-{{rangeEnd}}</span>
                    <span class="search-pages-control">
                        {{#if hasPreviousPage}}
                            <a {{action 'previousPage'}} class="previous-page">
                                <span class="flaticon solid left-circle-2"></span>
                            </a>
                        {{else}}
                            <span class="previous-page"><span class="flaticon solid left-circle-2"></span></span>
                        {{/if}}
                        
                        {{#if hasNextPage}}
                            <a {{action 'nextPage'}} class="next-page">
                                <span class="flaticon solid right-circle-2"></span>
                            </a>
                        {{else}}
                            <span class="next-page"><span class="flaticon solid right-circle-2"></span></span>
                        {{/if}}
                    </span>
                </div>
                
            </article>
        </section>
    </div>

{% endtplhandlebars %}

{% tplhandlebars "project" %}

    <div class="l-section detail" id="project-detail">
        <section class="l-wrapper">

            <figure class="project-image l-half">
                <img {{bindAttr src="image.large"}} width="100%" alt="Photo" />
            </figure>

            <div class="l-half">

                <article class="project-info">
                    <div class="project-meta">
                        {{#if country.name}}<span class="project-location"><span class="flaticon solid location-pin-1"></span> {{country.name}}</span>{{/if}}
                        {{#if theme.title}}<span class="project-theme"><span class="flaticon solid tag-2"></span> {{theme.title}}</span>{{/if}}
                    </div>
                    {{view App.SocialShareView}}
                    <h1 class="project-title">{{title}}</h1>
                    <p class="project-description">{{pitch}}</p>
                </article>

            </div>
        </section>


        {{#if isFundable}}
            <section class="l-wrapper">
                <div class="project-status">

                    {{#if campaign.deadline}}
                        {{#if isCampaign}}
                        <div class="project-days-left">
                            <strong><span class="flaticon solid stopwatch-1"></span> {{campaign.daysToGo}} <em>{% trans "days to go" %}!</em></strong>
                        </div>
                        {{else}}
                        <div class="project-days-left">
                            <strong><span class="flaticon solid clock-1"></span> {{campaign.daysToGo}} <em>{% trans "days to go" %}</em></strong>
                        </div>
                        {{/if}}
                    {{/if}}

                    <div class="project-fund">
                        <p class="project-fund-amount">
                            <strong class="amount-donated">&euro;{{localize campaign.money_donated}}</strong>
                            {% trans "of" %}
                            <strong class="amount-asked">&euro;{{localize campaign.money_asked}}</strong>
                            {% trans "raised" %}
                        </p>

                        <div class="project-fund-amount-slider"><strong style="width: 0%;" class="slider-progress is-in-progress"><em class="slider-percentage">0%</em></strong></div>
                    </div>

                    <div class="project-action">
                        <a href='#' {{ action 'addDonation' this }} class="btn btn-primary btn-iconed"><span class="flaticon solid wallet-1"></span> {% trans "Support project" %}</a>
                    </div>
                </div>
            </section>
        {{else}}
            <section class="l-wrapper">
                <div class="project-status">

                    <div class="project-days-left l-one-third">
                    {% comment %}
                        <strong><span class="flaticon solid clock-1"></span>[DATE COMPLETED]</strong>
                        <em>{% trans "completed" %}</em>
                    {% endcomment %}
                    </div>

                    {{#if campaign}}
                        <div class="project-fund l-one-third">
                            <p class="project-fund-amount">
                                <strong class="amount-donated">&euro;{{localize campaign.money_donated}}</strong>
                                {% trans "raised" %}
                            </p>

                            <div class="project-fund-amount-slider"><strong style="width: 0%;" class="slider-progress is-in-progress"><em class="slider-percentage">0%</em></strong></div>
                        </div>
                    {{/if}}
                </div>
            </section>
        {{/if}}
    </div>

    <div class="l-section" id="project-members">
        <section class="l-wrapper">
            {{view App.ProjectMembersView}}
        </section>
    </div>

    <nav class="l-section" id="project-actions">
        <div class="l-wrapper">
        
            <ul class="tabs four">
                {% if 'wallposts' in bb_apps %}
                {% verbatim %}
                    <li class="tab-updates">
                        {{#linkTo 'project.index'}}
                            <span class="tab-icon amount">{{controllers.projectIndex.meta.total}}</span>
                            <strong class="tab-title">
                                {% trans "Updates" %}

                                {{#if controllers.projectIndex.meta.total}}
                                    {{#if controllers.projectIndex.firstObject.isLoaded}}
                                        <em class="tab-subtitle">{{localize controllers.projectIndex.firstObject.created formatting="X"}}</em>
                                    {{else}}
                                        <em class="tab-subtitle">{% trans "Loading&#8230;" %}</em>
                                    {{/if}}
                                {{else}}
                                    <em class="tab-subtitle">{% trans "No updates" %}</em>
                                {{/if}}
                            </strong>
                        {{/linkTo}}
                    </li>
                {% endverbatim %}
                {% endif %}
                {% if 'tasks' in bb_apps %}
                {% verbatim %}
                    <li class="tab-tasks">
                        {{#if taskCount}}
                            {{#linkTo 'projectTasks'}}
                                <span class="tab-icon">{{taskCount}}</span>
                                <strong class="tab-title">Tasks <em class="tab-subtitle">{% trans "Skills needed" %}</em></strong>
                            {{/linkTo}}
                        {{else}}
                            {{#linkTo 'projectTasks'}}
                                <span class="tab-icon">0</span>
                                <strong class="tab-title">Tasks <em class="tab-subtitle">{% trans "No skills needed" %}</em></strong>
                            {{/linkTo}}
                        {{/if}}<commit_msg>Fix wallposts tab in project detail<commit_after>{% load bb_ember %}
{% load i18n %}
{% load static %}

{% include "projects/manage.hbs" %}

{% tplhandlebars "components/bb-progressbar" %}

    <div {{bindAttr class=class}}><strong style="width: 0%;" class="slider-progress is-in-progress"><em class="slider-percentage">0%</em></strong></div>

{% endtplhandlebars %}


{% tplhandlebars "project_preview" %}

    <li class="project-item">

        {{#linkTo 'project' getProject }}
            <span class="project-header">

                <figure class="project-image">
                    <img {{bindAttr src="image" }} />
                </figure>

                <span class="project-title">
                    <h3>{{title}}</h3>
                    <span class="project-location"><span class="flaticon solid location-pin-1"></span> {{country.name}}</span>
                </span>
            </span>

            <span {{bindAttr class=":project-status phase"}}>
                {{#if isPhasePlan}}
                    <span class="project-phase"><span class="flaticon solid lightbulb-3"></span> <strong>{% trans "New" %}</strong> <em>{% trans "Smart Idea" %}</em></span>
                {{/if}}

                {{#if isPhaseCampaign}}
                    {{#if campaign.money_asked}}
                        <div class="project-fund-amount-slider"><strong style="width: 0%;" class="slider-progress is-in-progress"><em class="slider-percentage">0%</em></strong></div>
                        <span class="project-fund-amount"><strong>&euro;{{localize campaign.money_needed}}</strong> <em>{% trans "To go" %}</em></span>
                    {{/if}}
                    {{#if campaign.deadline }}
                        <span class="project-days-left"><span class="flaticon solid clock-1"></span> <strong>{{campaign.daysToGo}}</strong> <em>{% trans "days" %}</em></span>
                    {{/if}}
                {{/if}}

                {{#if isPhaseAct}}
                    <span class="project-phase"><span class="flaticon solid lightbulb-3"></span> <strong>{% trans "Project funded" %}</strong> <em>{% trans "Being realized" %}</em></span>
                {{/if}}

                {{#if isPhaseResults}}
                    <span class="project-phase"><span class="flaticon solid lightbulb-3"></span> <strong>{% trans "Project funded" %}</strong> <em>{% trans "Being realized" %}</em></span>
                {{/if}}

                {{#if isPhaseRealized}}
                    <span class="project-phase"><span class="flaticon solid lightbulb-3"></span> <strong>{% trans "Project realized" %}</strong> <em>{% trans "See results" %}</em></span>
                {{/if}}
            </span>

            <span class="project-description">
                {{{pitch}}}

                <span class="project-view">{% trans "View project" %}</span>
            </span>

        {{/linkTo}}

        {{#if taskCount}}
            <a class="project-tasks"><span class="flaticon solid wrench-1"></span> <strong>{{taskCount}}</strong> <em>{% trans "task(s) available" %}</em></a>
        {{/if}}
    </li>

{% endtplhandlebars %}


{% tplhandlebars "project_list" %}

    {{render "projectSearchForm" }}
    <div class="l-section">
        <section class="l-wrapper">
            {{#if model.isLoaded}}
                <ul id="search-results">
                    {{#each project in model}}
                        {{render "projectPreview" project}}
                    {{else}}
                        <li class="no-results">{% trans "No projects found." %}</li>
                    {{/each}}
                </ul>
            {{else}}
                <div class="is-loading-big"><img src="{% get_static_prefix %}images/loading.gif" /> <strong>{% trans "Loading projects" %}</strong></div>
            {{/if}}
        </section>
    </div>
    
{% endtplhandlebars %}


{% tplhandlebars "project_search_form" %}

    <div class="l-section" id="search">
        <section class="l-wrapper">
            <form id="search-form">
                <div class="control">
                    {{view Em.TextField valueBinding="text" placeholder="Search"}}
                    <span class="flaticon stroke zoom-2"></span>
                </div>
                <div class="control">
                    {{view App.ProjectCountrySelectView valueBinding="country" }}
                    <span class="flaticon solid earth-1"></span>
                </div>
                <div class="control">
                    {{view App.ThemeSelectView valueBinding="theme" }}
                    <span class="flaticon stroke tag-2"></span>
                </div>
                <div class="control">
                    {{view App.ProjectPhaseSelectView valueBinding="phase" }}
                    <span class="flaticon stroke flag-1"></span>
                </div>
            </form>
        </section>
    </div>

    <div class="l-section">
        <section class="l-wrapper">
            <article id="search-navigation">
                
                <header>
                    <h2>{% trans "Results" %} <em>{{controllers.projectList.model.meta.total}}</em></h2>
                    <a {{action 'clearForm'}} class="search-reset">
                        <span class="flaticon solid x-2"></span> {% trans "Reset Search Filter" %}
                    </a>
                </header>
                
                <div class="search-sort">
                    {% trans "Sort:" %}
                    <a {{action 'sortOrder' 'popularity'}} {{bindAttr class="orderedByPopularity:active"}}>{% trans "Most popular" %}</a>
                    {% comment %}
                        Disabled because the currently approved design does not include sorting by title.
                        Current design: https://www.dropbox.com/s/n34ndim6cdbm7vz/Project-Search-V2.png
                        <a {{action 'sortOrder' 'title'}} {{bindAttr class="orderedByTitle:active"}}>{% trans "Title" %}</a>
                    {% endcomment %}
                    <a {{action 'sortOrder' 'newest'}} {{bindAttr class="orderedByNewest:active"}}>{% trans "Newest" %}</a>
                    <a {{action 'sortOrder' 'money_needed'}} {{bindAttr class="orderedByNeeded:active"}}>{% trans "Almost funded" %}</a>
                    <a {{action 'sortOrder' 'deadline'}} {{bindAttr class="orderedByDeadline:active"}}>{% trans "Near deadline" %}</a>
                </div>
                
                <div class="search-pagination">
                    <span class="search-showing">{% trans "Showing" %} {{rangeStart}}-{{rangeEnd}}</span>
                    <span class="search-pages-control">
                        {{#if hasPreviousPage}}
                            <a {{action 'previousPage'}} class="previous-page">
                                <span class="flaticon solid left-circle-2"></span>
                            </a>
                        {{else}}
                            <span class="previous-page"><span class="flaticon solid left-circle-2"></span></span>
                        {{/if}}
                        
                        {{#if hasNextPage}}
                            <a {{action 'nextPage'}} class="next-page">
                                <span class="flaticon solid right-circle-2"></span>
                            </a>
                        {{else}}
                            <span class="next-page"><span class="flaticon solid right-circle-2"></span></span>
                        {{/if}}
                    </span>
                </div>
                
            </article>
        </section>
    </div>

{% endtplhandlebars %}

{% tplhandlebars "project" %}

    <div class="l-section detail" id="project-detail">
        <section class="l-wrapper">

            <figure class="project-image l-half">
                <img {{bindAttr src="image.large"}} width="100%" alt="Photo" />
            </figure>

            <div class="l-half">

                <article class="project-info">
                    <div class="project-meta">
                        {{#if country.name}}<span class="project-location"><span class="flaticon solid location-pin-1"></span> {{country.name}}</span>{{/if}}
                        {{#if theme.title}}<span class="project-theme"><span class="flaticon solid tag-2"></span> {{theme.title}}</span>{{/if}}
                    </div>
                    {{view App.SocialShareView}}
                    <h1 class="project-title">{{title}}</h1>
                    <p class="project-description">{{pitch}}</p>
                </article>

            </div>
        </section>


        {{#if isFundable}}
            <section class="l-wrapper">
                <div class="project-status">

                    {{#if campaign.deadline}}
                        {{#if isCampaign}}
                        <div class="project-days-left">
                            <strong><span class="flaticon solid stopwatch-1"></span> {{campaign.daysToGo}} <em>{% trans "days to go" %}!</em></strong>
                        </div>
                        {{else}}
                        <div class="project-days-left">
                            <strong><span class="flaticon solid clock-1"></span> {{campaign.daysToGo}} <em>{% trans "days to go" %}</em></strong>
                        </div>
                        {{/if}}
                    {{/if}}

                    <div class="project-fund">
                        <p class="project-fund-amount">
                            <strong class="amount-donated">&euro;{{localize campaign.money_donated}}</strong>
                            {% trans "of" %}
                            <strong class="amount-asked">&euro;{{localize campaign.money_asked}}</strong>
                            {% trans "raised" %}
                        </p>

                        <div class="project-fund-amount-slider"><strong style="width: 0%;" class="slider-progress is-in-progress"><em class="slider-percentage">0%</em></strong></div>
                    </div>

                    <div class="project-action">
                        <a href='#' {{ action 'addDonation' this }} class="btn btn-primary btn-iconed"><span class="flaticon solid wallet-1"></span> {% trans "Support project" %}</a>
                    </div>
                </div>
            </section>
        {{else}}
            <section class="l-wrapper">
                <div class="project-status">

                    <div class="project-days-left l-one-third">
                    {% comment %}
                        <strong><span class="flaticon solid clock-1"></span>[DATE COMPLETED]</strong>
                        <em>{% trans "completed" %}</em>
                    {% endcomment %}
                    </div>

                    {{#if campaign}}
                        <div class="project-fund l-one-third">
                            <p class="project-fund-amount">
                                <strong class="amount-donated">&euro;{{localize campaign.money_donated}}</strong>
                                {% trans "raised" %}
                            </p>

                            <div class="project-fund-amount-slider"><strong style="width: 0%;" class="slider-progress is-in-progress"><em class="slider-percentage">0%</em></strong></div>
                        </div>
                    {{/if}}
                </div>
            </section>
        {{/if}}
    </div>

    <div class="l-section" id="project-members">
        <section class="l-wrapper">
            {{view App.ProjectMembersView}}
        </section>
    </div>

    <nav class="l-section" id="project-actions">
        <div class="l-wrapper">
        
            <ul class="tabs four">
                {% if 'wallposts' in bb_apps %}
                {% block_verbatim 'project_wallpost_tab' %}
                    <li class="tab-updates">
                        {{#linkTo 'project.index'}}
                            <span class="tab-icon amount">{{controllers.projectIndex.meta.total}}</span>
                            <strong class="tab-title">
                                {% trans "Updates" %}

                                {{#if controllers.projectIndex.meta.total}}
                                    {{#if controllers.projectIndex.firstObject.isLoaded}}
                                        <em class="tab-subtitle">{{localize controllers.projectIndex.firstObject.created formatting="X"}}</em>
                                    {{else}}
                                        <em class="tab-subtitle">{% trans "Loading&#8230;" %}</em>
                                    {{/if}}
                                {{else}}
                                    <em class="tab-subtitle">{% trans "No updates" %}</em>
                                {{/if}}
                            </strong>
                        {{/linkTo}}
                    </li>
                {% endblock_verbatim %}
                {% endif %}
                {% if 'tasks' in bb_apps %}
                {% verbatim %}
                    <li class="tab-tasks">
                        {{#if taskCount}}
                            {{#linkTo 'projectTasks'}}
                                <span class="tab-icon">{{taskCount}}</span>
                                <strong class="tab-title">Tasks <em class="tab-subtitle">{% trans "Skills needed" %}</em></strong>
                            {{/linkTo}}
                        {{else}}
                            {{#linkTo 'projectTasks'}}
                                <span class="tab-icon">0</span>
                                <strong class="tab-title">Tasks <em class="tab-subtitle">{% trans "No skills needed" %}</em></strong>
                            {{/linkTo}}
                        {{/if}}
{'fraction_non_alphanumeric': 0.16291788909413596, 'fraction_numerical': 0.003694447462783875, 'mean_word_length': 1.4014960424458554, 'pattern_counts': {'":': 2, '<': 589, '<?xml version=': 0, '>': 589, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7651763', 'n_tokens_mistral': 7521, 'n_tokens_neox': 6854, 'n_words': 1409}