<section class="inventory spells resizable" data-base-size="320">
  <div class="item-titles flexrow" style="line-height:15px">
    <div class="item-name">{{localize "ACKS.category.spells"}}</div>
    <div class="item-controls">
      <a class="item-control item-reset" title='{{localize "ACKS.spells.ResetSlots"}}'><i class="fas fa-sync"></i></a>
      <a class="item-control item-create" data-type="spell" title="{{localize 'ACKS.Add'}}"><i
          class="fa fa-plus"></i></a>
    </div>
  </div>
  {{#each spells as |spellGroup id|}}
  <div>
    <li class="item-titles flexrow">
      <div class="item-caret"><i class="fas fa-caret-down"></i> </div>
      <div class="item-name">{{localize "ACKS.spells.Level"}} {{id}}</div>
      <div class="field-short">{{localize 'ACKS.spells.Slots'}}</div>
      <div class="field-long flexrow">
        <input type="text" value="{{lookup @root.slots.used @key}}" name="data.spells.{{id}}.value" data-dtype="Number"
          placeholder="0" disabled>/<input type="text" value="{{lookup (lookup ../actor.data.spells @key) 'max'}}"
          name="data.spells.{{id}}.max" data-dtype="Number" placeholder="0"></div>
      <div class="item-controls">
        <a class="item-control item-create" data-type="spell" data-lvl="{{id}}" title="{{localize 'ACKS.Add'}}"><i
            class="fa fa-plus"></i></a>
      </div>
    </li>
    <ol class="item-list">
      {{#each spellGroup 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="field-long memorize flexrow">
            <input type="text" value="{{item.data.cast}}" data-dtype="Number" placeholder="0" data-field="cast"
              title="{{localize 'ACKS.spells.Cast'}}">
            /
            <input type="text" value="{{item.data.memorized}}" data-field="memorize" data-dtype="Number" placeholder="0"
              title="{{localize 'ACKS.spells.Memorized'}}"></div>
          <div class="item-controls">
            {{#if ../../owner}}
            <a class="item-control item-show" title='{{localize "ACKS.Show"}}'><i class="fas fa-eye"></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>
  {{/each}}
</section>