
{{!log 'equipment' this}}
<div class="equipment">
    <div class="items-list">
        {{#if editable}}
            <div class="title">
                {{#if isEncumbranceEnabled}}
                    Encombrement actuel : <input type="text" name="system.encumbrance.value" value="{{system.encumbrance.value}}" disabled/>
                    Encombrement max : <input type="text" name="system.encumbrance.max" value="{{system.encumbrance.max}}"/>
                {{/if}}
                <i class="fas fa-plus item-create" data-tooltip="{{localize "CTHACK.AddEquipment"}}" data-tooltip-direction="LEFT" data-type="weapon" data-alt-type="item"></i>
            </div>
        {{else}}
              <div class="title">
                {{#if isEncumbranceEnabled}}
                    Encombrement actuel : <input type="text" name="system.encumbrance.value" value="{{system.encumbrance.value}}" disabled/>
                    Encombrement max : <input type="text" name="system.encumbrance.max" value="{{system.encumbrance.max}}" disabled/>
                {{/if}}
            </div>
        {{/if}}
        {{#each weapons as |item id|}}
            {{!log 'weapon' item id}}
            <div class="item character-contextmenu" data-item-id="{{_id}}">
                <details>
                    <summary class="item-line weapon">
                        <div class="item-name-img {{#if system.hasDescription}}has-description{{/if}}">{{#if hasImage}}<img src="{{img}}" data-tooltip="{{name}}"/>{{/if}}{{name}}</div>
                        <div class="item-dice">
                            {{#if (isDiceRollable system.dice)}} <img class="dice-d20 weapon rollable" data-tooltip="{{localize 'CTHACK.MaterialRollPromptTitle'}}" src="systems/cthack/ui/dice/d20.webp"> {{/if}}
                            {{#if item.system.isDice}}
                                <img {{{getDiceImg item.system.dice}}} class="item-dice-select" data-tooltip="{{item.system.dice}}"/>
                            {{/if}}
                        </div>
                        <div class="item-range">{{#if (and (eq type "weapon")(eq system.hasRange true))}}{{localize "CTHACK.ItemRangeName"}} : {{localize (rangeDesc system.range)}}{{/if}}</div>                      
                    </summary>
                    <div class="item-description">{{{enrichedDescription}}}</div>
                </details>  
            </div>
        {{/each}}
        {{#each otheritems as |item id|}}
            <div class="item character-contextmenu" data-item-id="{{_id}}">
                <details>
                    <summary class="item-line other">
                        <div class="item-name-img {{#if system.hasDescription}}has-description{{/if}}">{{#if hasImage}}<img src="{{img}}" data-tooltip="{{name}}"/>{{/if}}{{name}}</div>
                        <div class="item-dice">
                            {{#if (isDiceRollable system.dice)}} <img class="dice-d20 otherItem rollable" data-tooltip="{{localize 'CTHACK.MaterialRollPromptTitle'}}" src="systems/cthack/ui/dice/d20.webp"> {{/if}}
                            {{#if item.system.isDice}}
                                <img {{{getDiceImg item.system.dice}}} class="item-dice-select" data-tooltip="{{item.system.dice}}"/>
                            {{/if}}
                        </div>
                    </summary>
                    <div class="item-description">{{{enrichedDescription}}}</div>
                </details>  
            </div>
        {{/each}}            
    </div>
    <div class="misc">
        {{editor enrichedEquipment target="system.equipment"  engine="prosemirror" button=true owner=owner}}
    </div>    
</div>



