<section class="tab character-{{tab.id}} {{tab.cssClass}}" data-tab="{{tab.id}}" data-group="{{tab.group}}">

  <fieldset class="encumbrance">
    {{#if isEncumbered}}
      {{formField systemFields.enc.fields.value value=system.enc.value rootId=partId disabled=true classes="encumbered"}}
    {{else }}
      {{formField systemFields.enc.fields.value value=system.enc.value rootId=partId disabled=true}}  
    {{/if}}
    {{formField systemFields.enc.fields.max value=system.enc.max rootId=partId disabled=isPlayMode}}
    {{formField systemFields.credits value=system.credits rootId=partId }}
  </fieldset>

  <fieldset>
    <legend>{{localize "FTLNOMAD.Label.weapons"}}{{#if isEditMode}}
      <a class="action" data-tooltip="{{localize " FTLNOMAD.Tooltip.addWeapon"}}" data-tooltip-direction="UP"><i
          class="fas fa-plus" data-action="createWeapon"></i></a>{{/if}}
    </legend>
    <div class="weapons">
      {{#each weapons as |item|}}
      <div class="weapon item" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}" data-drag="true">

        <img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
        <i class="fa-regular fa-dice"></i>
        <div class="name rollable" data-roll-type="weapon" data-tooltip="{{{item.system.description}}}">
          {{item.name}}
        </div>

        <i class="fa-regular fa-dice"></i>
        <a class="damage rollable" data-item-id="{{item.id}}" data-action="roll" data-roll-type="damage"
          data-roll-value="{{item.system.damage}}">
          {{localize "FTLNOMAD.Label.damageShort"}} :
          {{item.system.damage}}</a>
        <div class="controls">
          <a data-tooltip="{{localize 'FTLNOMAD.Edit'}}" data-action="edit" data-item-id="{{item.id}}"
            data-item-uuid="{{item.uuid}}"><i class="fas fa-edit"></i></a>
          <a data-tooltip="{{localize 'FTLNOMAD.Delete'}}" data-action="delete" data-item-id="{{item.id}}"
            data-item-uuid="{{item.uuid}}"><i class="fas fa-trash"></i></a>
        </div>
      </div>
      {{/each}}
    </div>
  </fieldset>

  <fieldset>
    <legend>{{localize "FTLNOMAD.Label.armors"}}{{#if isEditMode}}
      <a class="action" data-tooltip="{{localize " FTLNOMAD.Tooltip.addArmor"}}" data-tooltip-direction="UP"><i
          class="fas fa-plus" data-action="createArmor"></i></a>{{/if}}
    </legend>
    <div class="armors">
      {{#each armors as |item|}}
      <div class="armor item" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}">
        <img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
        <div class="name" data-tooltip="{{{item.system.description}}}">
          {{item.name}}
        </div>
        <span class="protection">{{localize "FTLNOMAD.Label.armor"}} : {{item.system.protection}}</span>
        <div class="controls">
          <a data-tooltip="{{localize 'FTLNOMAD.Edit'}}" data-action="edit" data-item-id="{{item.id}}"
            data-item-uuid="{{item.uuid}}"><i class="fas fa-edit"></i></a>
          <a data-tooltip="{{localize 'FTLNOMAD.Delete'}}" data-action="delete" data-item-id="{{item.id}}"
            data-item-uuid="{{item.uuid}}"><i class="fas fa-trash"></i></a>
        </div>
      </div>
      {{/each}}
    </div>
  </fieldset>

  <fieldset>
    <legend>{{localize "FTLNOMAD.Label.implants"}}{{#if isEditMode}}
      <a class="action" data-tooltip="{{localize " FTLNOMAD.Tooltip.addTalent"}}" data-tooltip-direction="UP"><i
          class="fas fa-plus" data-action="createImplant"></i></a>{{/if}}
    </legend>
    <div class="implants">
      {{#each implants as |item|}}
      {{!log 'weapon' this}}
      <div class="implant item" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}" data-drag="true">

        <img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
        <img src="systems/fvtt-cthulhu-eternal/assets/ui/d100.svg" class="d100" />
        <div class="name" data-roll-type="weapon" data-tooltip="{{{item.system.description}}}">
          {{item.name}}
        </div>

        <img src="systems/fvtt-cthulhu-eternal/assets/ui/d100.svg" class="d100" />
        <a class="damage rollable" data-item-id="{{item.id}}" data-action="roll" data-roll-type="damage"
          data-roll-value="{{item.system.damage}}">
          {{#if item.system.isAdvantage}}
          <i data-tooltip="Provides advantage" class="fas fa-circle-chevron-up"></i>
          {{else}}
          {{/if}}
        <div class="controls">
          <a data-tooltip="{{localize 'FTLNOMAD.Edit'}}" data-action="edit" data-item-id="{{item.id}}"
            data-item-uuid="{{item.uuid}}"><i class="fas fa-edit"></i></a>
          <a data-tooltip="{{localize 'FTLNOMAD.Delete'}}" data-action="delete" data-item-id="{{item.id}}"
            data-item-uuid="{{item.uuid}}"><i class="fas fa-trash"></i></a>
        </div>
      </div>
      {{/each}}
    </div>
  </fieldset>

  <fieldset>
    <legend>{{localize "FTLNOMAD.Label.equipments"}}{{#if isEditMode}}
      <a class="action" data-tooltip="{{localize " FTLNOMAD.Tooltip.addGear"}}" data-tooltip-direction="UP"><i
          class="fas fa-plus" data-action="createGear"></i></a>{{/if}}
    </legend>
    <div class="equipments">
      {{#each equipments as |item|}}
      {{!log 'armor' this}}
      <div class="equipment" data-item-id="{{item.id}}" data-item-uuid="{{item.uuid}}">
        <img class="item-img" src="{{item.img}}" data-tooltip="{{item.name}}" />
        <div class="name" data-tooltip="{{{item.system.description}}}">
          {{item.name}}
        </div>
        <div class="controls">
          <a data-tooltip="{{localize 'FTLNOMAD.Edit'}}" data-action="edit" data-item-id="{{item.id}}"
            data-item-uuid="{{item.uuid}}"><i class="fas fa-edit"></i></a>
          <a data-tooltip="{{localize 'FTLNOMAD.Delete'}}" data-action="delete" data-item-id="{{item.id}}"
            data-item-uuid="{{item.uuid}}"><i class="fas fa-trash"></i></a>
        </div>
      </div>
      {{/each}}
    </div>
  </fieldset>

</section>