<section class="inventory resizable" data-base-size="310">
  <div>
    <li class="item-titles flexrow">
      <div class="item-caret"><i class="fas fa-caret-down"></i></div>
      <div class="item-name">{{localize "ACKS.items.Weapons"}}</div>
      <div class="icon-row">{{localize "ACKS.items.Qualities"}}</div>
      <div class="field-short"><i class="fas fa-weight-hanging"></i></div>
      <div class="item-controls">
        <a class="item-control item-create" data-type="weapon" title="{{localize 'ACKS.Add'}}"><i
            class="fa fa-plus"></i></a>
      </div>
    </li>
    <ol class="item-list">
      {{#each owned.weapons as |item|}}
      <li class="item-entry">
        <div class="item flexrow" data-item-id="{{item._id}}">
          <div class="item-name item-rollable flexrow">
            <div class="item-image" style="background-image: url({{item.img}})"></div>
            <a>
              <h4 title="{{item.name}}">
                {{item.name~}}
              </h4>
            </a>
          </div>
          <div class="icon-row flexrow">
            {{#each item.data.tags as |tag|}}
              {{#if (getTagIcon tag.value)}}
                <img title="{{tag.title}}" src="{{getTagIcon tag.value}}" width="24" height="24"/>
              {{/if}}
            {{/each}}
            {{#each item.data.tags as |tag|}}
            {{#unless (getTagIcon tag.value)}}
              <span title="{{tag.title}}">{{tag.value}}{{#unless @last}},{{/unless}}</span>

              
            {{/unless}}
            {{/each}}
          </div>
          <div class="field-short">
            {{#if (eq @root.config.encumbrance "basic")}}_{{else}}{{item.data.weight}}{{/if}}
          </div>
          <div class="item-controls">
            {{#if ../owner}}
            <a class="item-control item-toggle {{#unless item.data.equipped}}item-unequipped{{/unless}}"
              title='{{localize "ACKS.items.Equip"}}'>
              <i class="fas fa-tshirt"></i>
            </a>
            <a class="item-control item-edit" title='{{localize "ACKS.Edit"}}'><i class="fas fa-edit"></i></a>
            <a class="item-control item-delete" title='{{localize "ACKS.Delete"}}'><i class="fas fa-trash"></i></a>
            {{/if}}
          </div>
        </div>
      </li>
      {{/each}}
    </ol>
  </div>
  <div>
    <li class="item-titles flexrow">
      <div class="item-caret"><i class="fas fa-caret-down"></i></div>
      <div class="item-name">{{localize "ACKS.items.Armors"}}</div>
      {{#if @root.config.ascendingAC}}
      <div class="field-short">{{localize "ACKS.items.ArmorAAC"}}</div>
      {{else}}
      <div class="field-short">{{localize "ACKS.items.ArmorAC"}}</div>
      {{/if}}
      <div class="field-short"><i class="fas fa-weight-hanging"></i></div>
      <div class="item-controls">
        <a class="item-control item-create" data-type="armor" title="{{localize 'ACKS.Add'}}"><i
            class="fa fa-plus"></i></a>
      </div>
    </li>
    <ol class="item-list">
      {{#each owned.armors as |item|}}
      <li class="item-entry">
        <div class="item flexrow" data-item-id="{{item._id}}">
          <div class="item-name flexrow">
            <div class="item-image" style="background-image: url({{item.img}})"></div>
            <a>
              <h4 title="{{item.name}}">
                {{item.name~}}
              </h4>
            </a>
          </div>
          <div class="field-short">
            {{#if @root.config.ascendingAC}}
            {{item.data.aac.value}}
            {{else}}
            {{item.data.ac.value}}
            {{/if}}
          </div>
          <div class="field-short">
            {{#if (eq @root.config.encumbrance "basic")}}_{{else}}{{item.data.weight}}{{/if}}
          </div>
          <div class="item-controls">
            {{#if ../owner}}
            <a class="item-control item-toggle {{#unless item.data.equipped}}item-unequipped{{/unless}}"
              title='{{localize "ACKS.items.Equip"}}'>
              <i class="fas fa-tshirt"></i>
            </a>
            <a class="item-control item-edit" title='{{localize "ACKS.Edit"}}'><i class="fas fa-edit"></i></a>
            <a class="item-control item-delete" title='{{localize "ACKS.Delete"}}'><i class="fas fa-trash"></i></a>
            {{/if}}
          </div>
        </div>
      </li>
      {{/each}}
    </ol>
  </div>
  <div class="">
    {{!-- Misc items --}}
    <li class="item-titles flexrow">
      <div class="item-caret"><i class="fas fa-caret-down"></i></div>
      <div class="item-name">{{localize "ACKS.items.Misc"}}</div>
      <div class="field-short"><i class="fas fa-hashtag"></i></div>
      <div class="field-short"><i class="fas fa-weight-hanging"></i></div>
      <div class="item-controls">
        <a class="item-control item-create" data-type="item" title="{{localize 'ACKS.Add'}}"><i
            class="fa fa-plus"></i></a>
      </div>
    </li>
    <ol class="item-list">
      {{#each owned.items as |item|}}
      {{#unless item.data.treasure}}
      <li class="item-entry">
        <div class="item flexrow" data-item-id="{{item._id}}">
          <div class="item-name flexrow">
            <div class="item-image" style="background-image: url({{item.img}})"></div>
            <a>
              <h4 title="{{item.name}}">
                {{item.name~}}
              </h4>
            </a>
          </div>
          <div class="field-short quantity">
            <input value="{{item.data.quantity.value}}" type="text"
              placeholder="0" />{{#if item.data.quantity.max}}<span>/{{item.data.quantity.max}}</span>{{/if}}
          </div>
          <div class="field-short">
            {{#if (eq @root.config.encumbrance "basic")}}_{{else if (eq @root.config.encumbrance "detailed")}}_{{else}}{{item.data.weight}}{{/if}}
          </div>
          <div class="item-controls">
            {{#if ../owner}}
            <a class="item-control item-edit" title='{{localize "ACKS.Edit"}}'><i class="fas fa-edit"></i></a>
            <a class="item-control item-delete" title='{{localize "ACKS.Delete"}}'><i class="fas fa-trash"></i></a>
            {{/if}}
          </div>
        </div>
      </li>
      {{/unless}}
      {{/each}}
    </ol>
  </div>
  <div class="">
    {{!-- Treasure items --}}
    <li class="item-titles flexrow">
      <div class="item-caret"><i class="fas fa-caret-down"></i></div>
      <div class="item-name">{{localize "ACKS.items.Treasure"}}</div>
      <div class="field-long">{{data.treasure}} <i class="fas fa-circle"></i></div>
      <div class="field-short"><i class="fas fa-hashtag"></i></div>
      <div class="field-short"><i class="fas fa-weight-hanging"></i></div>
      <div class="item-controls">
        <a class="item-control item-create" data-type="item" data-treasure="true" title="{{localize 'ACKS.Add'}}"><i
            class="fa fa-plus"></i></a>
      </div>
    </li>
    <ol class="item-list">
      {{#each owned.items as |item|}}
      {{#if item.data.treasure}}
      <li class="item-entry">
        <div class="item flexrow" data-item-id="{{item._id}}">
          <div class="item-name flexrow">
            <div class="item-image" style="background-image: url({{item.img}})"></div>
            <a>
              <h4 title="{{item.name}}">
                {{item.name~}}
              </h4>
            </a>
          </div>
          <div class="field-long">{{mult item.data.quantity.value item.data.cost}}</div>
          <div class="field-short quantity">
            <input value="{{item.data.quantity.value}}" type="text"
              placeholder="0" />{{#if item.data.quantity.max}}<span>/{{item.data.quantity.max}}</span>{{/if}}
          </div>
          <div class="field-short">
            {{mult item.data.quantity.value item.data.weight}}
          </div>
          <div class="item-controls">
            {{#if ../owner}}
            <a class="item-control item-edit" title='{{localize "ACKS.Edit"}}'><i class="fas fa-edit"></i></a>
            <a class="item-control item-delete" title='{{localize "ACKS.Delete"}}'><i class="fas fa-trash"></i></a>
            {{/if}}
          </div>
        </div>
      </li>
      {{/if}}
      {{/each}}
    </ol>
  </div>
</section>
<section>
  {{#with data.encumbrance}}
  <div class="encumbrance {{#if encumbered}}encumbered{{/if}}">
    <span class="encumbrance-bar" style="width:{{pct}}%"></span>
    <span class="encumbrance-label">{{value}} / {{max}}</span>
    <i class="encumbrance-breakpoint encumbrance-25 arrow-up"></i>
    <i class="encumbrance-breakpoint encumbrance-25 arrow-down"></i>
    <i class="encumbrance-breakpoint encumbrance-50 arrow-up"></i>
    <i class="encumbrance-breakpoint encumbrance-50 arrow-down"></i>
    <i class="encumbrance-breakpoint encumbrance-75 arrow-up"></i>
    <i class="encumbrance-breakpoint encumbrance-75 arrow-down"></i>
    {{/with}}
  </div>
</section>