<section class="panel">
    {{#if isCharacter }}
    <div class="currency-encumbrance">

        <label class="currency">
            {{localize "SW5E.Currency"}}
            {{#each data.currency as |v k|}}
            <input type="text" name="data.currency.{{k}}" value="{{v}}" data-dtype="Number" />
            {{/each}}
        </label>
        {{#with data.attributes.encumbrance}}
        <div class="encumbrance-wrapper" title="Encumbrance">
            <div class="encumbrance {{#if encumbered}}encumbered{{/if}}">
                <span class="encumbrance-bar" style="width:{{pct}}%"></span>

                <i class="encumbrance-breakpoint encumbrance-33 arrow-up"></i>
                <i class="encumbrance-breakpoint encumbrance-33 arrow-down"></i>
                <i class="encumbrance-breakpoint encumbrance-66 arrow-up"></i>
                <i class="encumbrance-breakpoint encumbrance-66 arrow-down"></i>
            </div>
            <span class="encumbrance-label">{{value}} / {{max}}</span>
        </div>
        {{/with}}
    </div>
    {{/if}}

    <ul class="filter-list" data-filter="inventory">
        <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>
        <li class="filter-item" data-filter="equipped">{{localize "SW5E.Equipped"}}</li>
    </ul>

    <div class="group-list-header group-grid-inventory">
        <div>&nbsp;</div>
        {{#if isCharacter}}
        <div class="item-detail item-weight">{{localize "SW5E.Weight"}}</div>
        {{/if}}

        <div class="item-detail item-uses">{{localize "SW5E.Charges"}}</div>
        <div class="item-detail item-action">{{localize "SW5E.Usage"}}</div>
        <div class="item-detail"></div>
    </div>
    <ol class="group-list">
        {{#each sections as |section sid|}}
        <li>
            <div class="group-list-title">
                <h3 class="item-name">{{localize section.label}}</h3>

                {{#if ../owner}}
                    <a class="item-control item-create" title='{{localize "SW5E.ItemCreate"}}'
                        {{#each section.dataset as |v k|}}data-{{k}}="{{v}}" {{/each}}>
                        <i class="fas fa-plus"></i> {{localize "SW5E.Add"}}
                    </a>
                {{/if}}
            </div>
            <ol class="group-items item-list">
                {{#each section.items as |item iid|}}
                <li class="item group-grid-inventory" data-item-id="{{item._id}}">
                    <div class="item-name rollable">
                        <div class="item-image" style="background-image: url({{item.img}})"></div>
                        <h4>
                            {{item.name~}}
                            {{~#if item.isStack}} ({{item.data.quantity}}){{/if}}
                            {{~#if item.data.attuned}} <i class="fas fa-sun attuned"
                                title={{localize "SW5E.Attuned"}}></i>{{/if}}
                        </h4>
                    </div>

                    {{#if ../../isCharacter}}
                    <div class="item-detail item-weight">
                        {{#if item.totalWeight}}
                            {{ item.totalWeight }} {{localize "SW5E.AbbreviationLbs"}}
                        {{/if}}
                    </div>
                    {{/if}}

                    <div class="item-detail item-uses">
                        {{#if item.hasUses }}
                        <input type="text" value="{{item.data.uses.value}}" placeholder="0" />
                        /<span style="padding-left: 8px;">{{item.data.uses.max}}</span>
                        {{/if}}
                    </div>

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

                    {{#if ../../owner}}
                    <div class="item-detail item-controls">
                        <a class="item-control item-toggle {{item.toggleClass}}" title='{{item.toggleTitle}}'>
                            <i class="fas fa-shield-alt"></i>
                        </a>
                        <a class="item-control item-edit" title='{{localize "SW5E.ItemEdit"}}'><i
                                class="fas fa-edit"></i></a>
                        <a class="item-control item-delete" title='{{localize "SW5E.ItemDelete"}}'><i
                                class="fas fa-trash"></i></a>
                    </div>
                    {{/if}}
                </li>
                {{/each}}
            </ol>
        </li>
        {{/each}}
    </ol>



</section>