<div class="panel">


    <ul class="filter-list" data-filter="features">
        <li class="filter-title">{{localize "SW5E.Filter"}}</li>
        <li class="filter-item" data-filter="action">{{localize "SW5E.Action"}}</li>
        <li class="filter-item" data-filter="bonus">{{localize "SW5E.BonusAction"}}</li>
        <li class="filter-item" data-filter="reaction">{{localize "SW5E.Reaction"}}</li>
    </ul>


    <ol class="group-list">
        {{#each sections as |section sid|}}
        <li>
            <div class="group-list-title group-grid-features">
                <div class="title">

                    <h3 class="item-name">{{localize section.label}}</h3>
                    {{#if ../owner}}
                    <a class="item-control item-create" title="{{localize 'SW5E.FeatureAdd'}}"
                        {{#each section.dataset as |v k|}}data-{{k}}="{{v}}" {{/each}}>
                        <i class="fas fa-plus"></i> {{localize "SW5E.Add"}}
                    </a>
                    {{/if}}
                </div>
                {{#if section.hasActions}}
                <div class="item-detail item-uses">{{localize "SW5E.Uses"}}</div>
                <div class="item-detail item-action">{{localize "SW5E.Usage"}}</div>
                {{/if}}


            </div>
            <ol class="item-list">
                {{#each section.items as |item iid|}}
                <li class="item group-grid-features {{#if isDepleted}}depleted{{/if}}" data-item-id="{{item._id}}">
                    <div class="item-name rollable">
                        <div class="item-image" style="background-image: url({{item.img}})"></div>
                        <h4>{{item.name}}</h4>
                    </div>

                    {{#if section.hasActions}}
                    <div class="item-detail item-uses">
                        {{#if item.isOnCooldown}}
                        <a class="item-recharge rollable">{{item.labels.recharge}}</a>
                        {{else if item.data.recharge.value}}
                        {{localize "SW5E.Charged"}}

                        {{else if item.hasUses}}
                        <input type="text" value="{{item.data.uses.value}}" placeholder="0" />/<span>{{item.data.uses.max}}</span>
                        {{/if}}
                    </div>

                    <div class="item-detail item-action">
                        {{#if item.data.activation.type }}
                        {{item.labels.activation}}
                        {{/if}}
                    </div>

                    {{else if section.isClass}}
                    <div class="item-detail player-class">
                        {{item.data.archetype}}
                    </div>
                    <div class="item-detail player-class-levels">
                        Level {{item.data.levels}}
                    </div>
                    {{/if}}

                    {{#if ../../owner}}
                    <div class="item-controls item-detail">
                        <a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
                        <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
                    </div>
                    {{/if}}
                </li>
                {{/each}}
            </ol>
        </li>
        {{/each}}
    </ol>
</div>