<form class="{{cssClass}}" autocomplete="off">
    <header class="sheet-header">
        <img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
        <div class="header-fields">
            <h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
        </div>
    </header>

    {{> systems/fvtt-pegasus-rpg/templates/partial-item-nav.html}}
  
    {{!-- Sheet Body --}}
    <section class="sheet-body">

      {{> systems/fvtt-pegasus-rpg/templates/partial-item-description.html}}

      <div class="tab details" data-group="primary" data-tab="details">
        <ul>
        <li class="flexrow"><label class="generic-label">Affected stat</label>
          <select class="competence-base flexrow" type="text" name="data.affectedstat" value="{{data.affectedstat}}" data-dtype="String">
            {{#select data.affectedstat}}
            {{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html notapplicable=true mr=false}}
            {{/select}}
          </select> 
        </li>
        <li class="flexrow"><label class="generic-label">Stat modifier</label>
          <input type="text" class="padd-right" name="data.statmodifier" value="{{data.statmodifier}}" data-dtype="Number"/>
        </li>

        <li class="flexrow"><label class="generic-label">Affected status</label>
          <select class="competence-base flexrow" type="text" name="data.statusaffected" value="{{data.statusaffected}}" data-dtype="String">
            {{#select data.statusaffected}}
            {{{optionsStatusList}}}
            {{/select}}
          </select> 
        </li>
        <li class="flexrow"><label class="generic-label">Status modifier</label>
          <input type="text" class="padd-right" name="data.statusmodifier" value="{{data.statusmodifier}}" data-dtype="Number"/>
        </li>

        <li class="flexrow"><label class="generic-label">Effects Gained</label>
        </li>
        <li>
          <ul class="ul-level1">
            <li class="flexrow"><div class="drop-ability-effect"><label>Drop Effects here !</label></div>
            </li>
            {{#each data.effectsgained as |effect idx|}}
            <li class="flexrow">
              <label name="data.effectsgained[{{idx}}].name"><a class="view-subitem" data-type="effectsgained" data-index="{{idx}}">{{effect.name}}</a></label>
              <div class="item-controls padd-left">
                <a class="item-control delete-subitem padd-left" data-type="effectsgained" data-index="{{idx}}" title="Delete Effect"><i class="fas fa-trash"></i></a>
              </div>   
            </li>
            {{/each}}
          </ul>              
        </li>

        <li class="flexrow"><label class="generic-label">Power Gained</label>
        </li>
        <li>
          <ul class="ul-level1">
            <li class="flexrow"><div class="drop-ability-power"><label>Drop Powers here !</label></div>
            </li>
            {{#each data.powersgained as |power idx|}}
            <li class="flexrow">
              <label name="data.powersgained[{{idx}}].name"><a class="view-subitem" data-type="powersgained" data-index="{{idx}}">{{power.name}}</a></label>
              <div class="item-controls padd-left">
                <a class="item-control delete-subitem padd-left" data-type="powersgained" data-index="{{idx}}" title="Delete Power"><i class="fas fa-trash"></i></a>
              </div>   
            </li>
            {{/each}}
          </ul>              
        </li>

        <li class="flexrow"><label class="generic-label">Specialisation Gained</label>
        <li>
            <ul class="ul-level1">
              <li class="flexrow"><div class="drop-ability-spec"><label>Drop Specialisations here !</label></div>
              </li>
              {{#each data.specialisations as |spec idx|}}
              <li class="flexrow">
                <label name="data.specialisations[{{idx}}].name"><a class="view-subitem" data-type="specialisations" data-index="{{idx}}">{{spec.name}}</a></label>
                <div class="item-controls padd-left">
                  <a class="item-control delete-subitem padd-left" data-type="specialisations" data-index="{{idx}}" title="Delete Specialisation"><i class="fas fa-trash"></i></a>
                </div>   
              </li>
              {{/each}}
            </ul>              
          </li>
        </li>

        <li class="flexrow"><label class="generic-label">Threat Level Value</label>
          <input type="text" class="input-numeric-short padd-right" name="data.threatlevel" value="{{data.threatlevel}}" data-dtype="Number"/>
        </li>

        <li class="flexrow"><label class="generic-label">Attacks Gained</label>
        <li>
          <ul class="ul-level1">
            <li class="flexrow"><div class="drop-ability-weapon"><label>Drop Weapons here !</label></div>
            </li>
            {{#each data.attackgained as |weapon idx|}}              
              <li class="flexrow">
                <label name="data.specialisations[{{idx}}].name"><a class="view-subitem" data-type="attackgained" data-index="{{idx}}">{{weapon.name}}</a></label>
                <div class="item-controls padd-left">
                  <a class="item-control delete-subitem padd-left" data-type="attackgained" data-index="{{idx}}" title="Delete Weapon"><i class="fas fa-trash"></i></a>
                </div>   
              </li>
              {{/each}}
            </ul>              
          </li>
        </li>

        <li class="flexrow"><label class="generic-label">Armors Gained</label>
          <li>
            <ul class="ul-level1">
              <li class="flexrow"><div class="drop-ability-armor"><label>Drop Armors here !</label></div>
              </li>
              {{#each data.armorgained as |armor idx|}}              
                <li class="flexrow">
                  <label name="data.specialisations[{{idx}}].name"><a class="view-subitem" data-type="armorgained" data-index="{{idx}}">{{armor.name}}</a></label>
                  <div class="item-controls padd-left">
                    <a class="item-control delete-subitem padd-left" data-type="armorgained" data-index="{{idx}}" title="Delete Armor"><i class="fas fa-trash"></i></a>
                  </div>   
                </li>
                {{/each}}
              </ul>              
            </li>
          </li>
  
      </ul>
    </div>
      
    </section>
</form>
