{{> common_header}}

<div class="layout-body">

    {{> org_title org=Layout.org}}
    {{> org_menu selected_tab="tasks"}}

    <form class="filter" data-compact="true">
        <fieldset>
            <legend>{{i18n "tasks.prop.state"}}</legend>
            <div class="option-list">
                {{#each Layout.org.tasks.STATES}}
                <label><input type="checkbox" name="{{this.key}}" value="1"{{#is this.value 1}} checked{{/is}}> <span class="constant">{{this.key}}</span></label><br>
                {{/each}}
            </div>
        </fieldset>
        <button type="submit" class="highlighted">{{i18n "common.action.apply"}}</button>
    </form>

    {{#if Layout.params.task_id}}
    <h2>
        <a href="/organizations/{{Layout.org.id}}/tasks" class="root">.&thinsp;.</a>&nbsp;/
        {{{i18n "tasks.dependencies" task=Layout.params.task_id}}}
    </h2>
    {{/if}}

    {{#if Layout.org.tasks.page}}
    {{> task_list list=Layout.org.tasks.result org=Layout.org}}
    {{else}}
    <div class="blank-list">{{i18n "common.no_data"}}</div>
    {{/if}}

    {{> page_navigation data=Layout.org.tasks}}

</div>
