<div class="combat-panel">
  <div class="weapon-list melee">
    <div class="section-header">
      <span>{{localize 'CoC7.MeleeWeapons'}}</span>
      {{#unless data.system.flags.locked}}
        <div class="add-item" title="{{localize 'CoC7.AddWeapon'}}" data-type="weapon" data-melee="true">
          <i class="fas fa-plus"></i>
        </div>
      {{/unless}}
    </div>
    <ol>
      {{#each meleeWpn as |weapon id|}}
        <li class="weapon-row item weapon {{#unless weapon.skillSet}}error{{/unless}}" data-item-id="{{weapon._id}}" title="{{#unless weapon.skillSet}}{{localize 'CoC7.NoSkill'}}{{/unless}}">
          <div class="expand-arrow show-detail"></div>
          <div class="weapon-image" style="background-image: url('{{weapon.img}}')"></div>
          <div class="flexrow-coc7">
            <div class="weapon-name combat {{#if weapon.skillSet}}rollable{{else}}item-edit{{/if}}">{{weapon.name}}</div>
            {{#if weapon.system.properties.thrown}}
              <a class="weapon-name combat alternativ-skill {{#if weapon.skillSet}}rollable{{else}}item-edit{{/if}}" title="Throw"><i class="game-icon game-icon-thrown-knife"></i></a>
            {{/if}}
          </div>
          <div class="weapon-range">
            {{#each weapon.system.range as |range key|}}
              {{#if range.damage}}
                <div class="weapon-damage" data-range="{{key}}">
                  <a class="roll" data-mode="roll" title="{{range.value}}" data-formula="{{range.damage}}">{{range.damage}}</a>
                </div>
              {{/if}}
            {{/each}}
          </div>
          <div class="weapon-control">
            {{#if weapon.system.properties.addb}}<span class="tag" title="Add DB">{{localize 'CoC7.WeaponAddb'}}</span>{{/if}}
            {{#if weapon.system.properties.ahdb}}<span class="tag" title="Add DB">{{localize 'CoC7.WeaponAhdb'}}</span>{{/if}}
          </div>
          <div class="item-controls">
            <a class="item-control item-edit" title="{{localize 'CoC7.EditWeapon'}}"><i class="fas fa-edit"></i></a>
            {{#unless ../data.system.flags.locked}}
              <a class="item-control item-delete" title="{{localize 'CoC7.DeleteWeapon'}}"><i class="fas fa-trash"></i></a>
            {{/unless}}
          </div>
        </li>
      {{/each}}
    </ol>
  </div>

  <div class="weapon-list range">
    <div class="section-header">
      <span>{{localize 'CoC7.RangeWeapons'}}</span>
      {{#unless data.system.flags.locked}}
        <div class="add-item" title="{{localize 'CoC7.AddWeapon'}}" data-type="weapon" data-rngd="true">
          <i class="fas fa-plus"></i>
        </div>
      {{/unless}}
    </div>
    <ol>
      {{#each rangeWpn as |weapon id|}}
        <li class="weapon-row item weapon {{#unless weapon.skillSet}}error{{/unless}}" data-item-id="{{weapon._id}}" title="{{#unless weapon.skillSet}}{{localize 'CoC7.NoSkill'}}{{/unless}}">
          <div class="expand-arrow show-detail"></div>
          <div class="weapon-image" style="background-image: url('{{weapon.img}}')"></div>
          <div class="flexrow-coc7">
            <div class="weapon-name combat {{#if weapon.skillSet}}rollable{{else}}item-edit{{/if}}">{{weapon.name}}</div>
            {{#if weapon.usesAlternateSkill}}
              <a class="weapon-name combat alternativ-skill {{#if weapon.skillSet}}rollable{{else}}item-edit{{/if}}" title="{{localize 'CoC7.AutomaticFire'}}"><i class="game-icon game-icon-machine-gun-magazine"></i></a>
            {{/if}}
          </div>
          <div class="weapon-range">
            {{#each weapon.system.range as |range key|}}
              {{#if range.damage}}
                <div class="weapon-damage" data-range="{{key}}">
                  <a class="roll" data-mode="roll" title="{{range.value}}" data-formula="{{range.damage}}">{{range.damage}}</a>
                </div>
              {{/if}}
            {{/each}}
          </div>
          <div class="weapon-controls">
            <div class="ammo">
              <span class="tag">{{weapon.system.ammo}}</span>
            </div>
            <div class="control">
              <a class="reload-weapon" title="{{localize 'CoC7.Reload'}}"><i class="game-icon game-icon-chaingun"></i></a>
            </div>
          </div>
          <div class="item-controls">
            <a class="item-control item-edit" title="{{localize 'CoC7.EditWeapon'}}"><i class="fas fa-edit"></i></a>
            {{#unless ../data.system.flags.locked}}
              <a class="item-control item-delete" title="{{localize 'CoC7.DeleteWeapon'}}"><i class="fas fa-trash"></i></a>
            {{/unless}}
          </div>
        </li>
      {{/each}}
    </ol>
  </div>

  <div class="weapon-list maneuver">

  </div>

  <div class="skill-list melee">
    <div class="section-header skill">
      <span>{{localize 'CoC7.MeleeSkills'}}</span>
      {{#unless data.system.flags.locked}}
        <div class="add-item" title="{{localize 'CoC7.AddSkill'}}" data-type="skill">
          <i class="fas fa-plus"></i>
        </div>
      {{/unless}}
    </div>
    <ol class="item-list skill melee">
      {{#each meleeSkills as |skill|}}
        <li class="skill-tag item itemV2" data-skill-id="{{skill._id}}" data-item-id="{{skill._id}}">
          <div class="item-image" style="background-image: url('{{skill.img}}')"></div>
          {{#if ../data.system.flags.locked}}
            <div class="item-name skill-name combat rollable">{{skill.name}}</div>
            <div class="item-score">{{skill.system.value}}</div>
            <div class="item-controls">
              {{#unless skill.system.properties.noxpgain}}
                {{#if skill.system.flags.developement}}
                  <a class="item-control development-flag active" title="{{localize 'CoC7.SkillUnflagForDevelopement'}}"><i class="fas fa-certificate"></i></a>
                {{else}}
                  <a class="item-control development-flag" title="{{localize 'CoC7.SkillFlagForDevelopement'}}"><i class="fas fa-certificate"></i></a>
                {{/if}}
              {{/unless}}
              <a class="item-control item-popup" title="{{localize 'CoC7.SkillDetail'}}"><i class="fas fa-info-circle"></i></a>
            </div>
          {{else}}
            <div class="item-name">
              <input class="skill-name" type="text" value="{{skill.name}}" data-dtype="String">
            </div>
            <div class="item-score">
              <input class="npc-skill-score" type="text" value="{{skill.system.value}}" data-dtype="Number">
            </div>
            <div class="item-controls">
              <a class="item-control item-edit" title="{{localize 'CoC7.EditSkill'}}"><i class="fas fa-edit"></i></a>
              <a class="item-control item-delete" title="{{localize 'CoC7.DeleteSkill'}}"><i class="fas fa-trash"></i></a>
            </div>
          {{/if}}
        </li>
      {{/each}}
    </ol>
  </div>

  <div class="skill-list range">
    <div class="section-header skill">
      <span>{{localize 'CoC7.RangeSkills'}}</span>
      {{#unless data.system.flags.locked}}
        <div class="add-item" title="{{localize 'CoC7.AddSkill'}}" data-type="skill">
          <i class="fas fa-plus"></i>
        </div>
      {{/unless}}
    </div>
    <ol class="item-list skill range">
      {{#each rangeSkills as |skill|}}
        <li class="skill-tag item itemV2" data-skill-id="{{skill._id}}" data-item-id="{{skill._id}}">
          <div class="item-image" style="background-image: url('{{skill.img}}')"></div>
          {{#if ../data.system.flags.locked}}
            <div class="item-name skill-name combat rollable">{{skill.name}}</div>
            <div class="item-score">{{skill.system.value}}</div>
            <div class="item-controls">
              {{#unless skill.system.properties.noxpgain}}
                {{#if skill.system.flags.developement}}
                  <a class="item-control development-flag active" title="{{localize 'CoC7.SkillUnflagForDevelopement'}}"><i class="fas fa-certificate"></i></a>
                {{else}}
                  <a class="item-control development-flag" title="{{localize 'CoC7.SkillFlagForDevelopement'}}"><i class="fas fa-certificate"></i></a>
                {{/if}}
              {{/unless}}
              <a class="item-control item-popup" title="{{localize 'CoC7.SkillDetail'}}"><i class="fas fa-info-circle"></i></a>
            </div>
          {{else}}
            <div class="item-name">
              <input class="skill-name" type="text" value="{{skill.name}}" data-dtype="String">
            </div>
            <div class="item-score">
              <input class="npc-skill-score" type="text" value="{{skill.system.value}}" data-dtype="Number">
            </div>
            <div class="item-controls">
              <a class="item-control item-edit" title="{{localize 'CoC7.EditSkill'}}"><i class="fas fa-edit"></i></a>
              <a class="item-control item-delete" title="{{localize 'CoC7.DeleteSkill'}}"><i class="fas fa-trash"></i></a>
            </div>
          {{/if}}
        </li>
      {{/each}}
    </ol>
  </div>
</div>