<!-- Action skills -->
<div class="section" style="width: 400px;">
  <h2 class="section-title">{{ localize 'shadowrun6.section.skills.action' }}</h2>

  <ol class="item-list">
    {{#each skills as |skill id|}}
        {{#if
          (or
            (and
              (eq id "tasking")
              (ne ../actor.system.mortype "technomancer")
            )
          )
        }}
        {{else}}
       <li class="skill-item flexrow" data-skill-id="{{id}}">
        <button type="button" name="collapseSkillAction{{id}}" class="collapsible-skill {{lookup ../actor.flags.shadowrun-de (concat 'collapse-state-' id)}} empty" data-item-id="{{this.id}}" style="flex: 0 0 28px">+</button>
         <label class="skill-value skill-key rollable skill-name skill-roll" data-skill="{{id}}">{{localize (concat "skill." id ) }}</label>
         <div class="skill-attrib">
           <span>{{localize (concat "attrib." (skillAttr id) "_short")}}</span>
         </div>
         <div class="skill-points centered" style="width: 2em;">
           <input name="skillActionPoints{{id}}" class="skill-value" type="number" data-field="system.skills.{{id}}.points" value="{{lookup (lookup @root.actor._source.system.skills id) 'points'}}"  style="width: 2em" />
         </div>
         <div class="skill-pool skill" style="flex-grow:2;">
           <span>{{skill.pool}}</span>
         </div>
         <div class="item-controls" style="flex-grow:1;">
           <!--a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a-->
            {{#if skill.pool }}
            <a class="item-control skill-roll" data-skill="{{id}}" title="Roll"><i class="fas fa-dice-six"></i></a>
            {{else}}
            <span class="item-control skill-roll" style="color: lightgray;" title="No skill pool"><i class="fas fa-dice-six"></i></span>
            {{/if}}
         </div>
         <div>
         <div style="display:block; margin-left: 2em">

         	<div class="{{#if (and (not skill.specialization)(not skill.expertise))}}skill-no-specializations{{/if}}" style="padding:0px">
         	  <table style="margin: 4px 0px;">
              {{#if skill.expertise }}
         	    <tr>
         	    	<td style="width: 7.5em; font-size: smaller; vertical-align:middle">
                  {{#if skill.exotic }}
                    {{ localize 'shadowrun6.label.specialization' }}
                  {{else}}
                    {{ localize 'shadowrun6.label.expertise' }}
                  {{/if}}              
                </td>
         	    	<td style="width: 10em;">
         	    		<select name="skillExpertise{{id}}" data-field="system.skills.{{id}}.expertise" style="width: -webkit-fill-available;">
                   {{selectOptions (lookup ../config.skill_special id) selected=skill.expertise blank=(localize "shadowrun6.label.none") localize=true}}
               		</select>
               	</td>
               	<td class="skill-pool">
                  <span>{{skill.poolE}}</span>
                </td>
               	<td class="item-controls">
                  {{#if skill.poolE }}
                  <a class="item-control skill-roll" data-skill="{{id}}" data-skillspec="{{skill.expertise}}" title="Roll"><i class="fas fa-dice-six"></i></a>
                  {{else}}
                  <span class="item-control skill-roll" style="color: lightgray;" title="No skill pool"><i class="fas fa-dice-six"></i></span>
                  {{/if}}
                </td>
         	    </tr>
              {{/if}}
              {{#if skill.specialization }}
         	    <tr>
         	    	<td style="width: 7.5em; font-size: smaller; vertical-align:middle">{{ localize 'shadowrun6.label.specialization' }}</td>
         	    	<td style="width: 10em;">
         	    		<select name="skillSpecialization{{id}}" data-field="system.skills.{{id}}.specialization" style="width: -webkit-fill-available;">
                   {{selectOptions (lookup ../config.skill_special id) selected=skill.specialization blank=(localize "shadowrun6.label.none") localize=true}}
               		</select>
               	</td>
               	<td class="skill-pool">
                  <span>{{skill.poolS}}</span>
                </td>
               	<td class="item-controls">
                  {{#if skill.poolS }}
                  <a class="item-control skill-roll" data-skill="{{id}}" data-skillspec="{{skill.specialization}}" title="Roll"><i class="fas fa-dice-six"></i></a>
                  {{else}}
                  <span class="item-control skill-roll" style="color: lightgray;" title="No skill pool"><i class="fas fa-dice-six"></i></span>
                  {{/if}}
                </td>
         	    </tr>
              {{/if}}

              {{#if (and skill.specialization (or @root.settings.expandedSpecializations skill.exotic))}}
              {{!-- Expanded Specializations --}}
              {{#each skill.expandedSpecializations as |specialization|}}
         	    <tr>
         	    	<td style="width: 7.5em; font-size: smaller; vertical-align:middle">{{ localize 'shadowrun6.label.specialization' }}</td>
         	    	<td style="width: 10em;">
         	    		<select class="expandedSpecializations" data-skill="{{id}}" data-idx="{{@index}}" style="width: -webkit-fill-available;">
                   {{selectOptions (lookup @root.config.skill_special id) selected=specialization blank=(localize "shadowrun6.label.none") localize=true}}
               		</select>
               	</td>
               	<td class="skill-pool">
                  <span>{{skill.poolS}}</span>
                </td>
               	<td class="item-controls">
                  {{#if skill.poolS }}
                  <a class="item-control skill-roll" data-skill="{{id}}" data-skillspec="{{specialization}}" title="Roll"><i class="fas fa-dice-six"></i></a>
                  {{else}}
                  <span class="item-control skill-roll" style="color: lightgray;" title="No skill pool"><i class="fas fa-dice-six"></i></span>
                  {{/if}}
                </td>
         	    </tr>
              {{/each}}
              {{/if}}
         	  </table>
          </div>
         	<div class="collapsible-content {{lookup ../actor.flags.shadowrun-de (concat 'collapse-state-' id)}}" style="padding:0px">
         	  <table style="margin: 4px 0px;">
              {{#if (not skill.expertise) }}
         	    <tr>
         	    	<td style="width: 7.5em; font-size: smaller; vertical-align:middle">
                  {{#if skill.exotic }}
                    {{ localize 'shadowrun6.label.specialization' }}
                  {{else}}
                    {{ localize 'shadowrun6.label.expertise' }}
                  {{/if}}              
                </td>
         	    	<td style="width: 10em;">
         	    		<select name="skillExpertise{{id}}" data-field="system.skills.{{id}}.expertise" style="width: -webkit-fill-available;">
                   {{selectOptions (lookup ../config.skill_special id) selected=skill.expertise blank=(localize "shadowrun6.label.none") localize=true}}
               		</select>
               	</td>
               	<td class="skill-pool">
                  <span>{{skill.poolE}}</span>
                </td>
               	<td class="item-controls">
                  {{#if skill.poolE }}
                  <a class="item-control skill-roll" data-skill="{{id}}" data-skillspec="{{skill.expertise}}" title="Roll"><i class="fas fa-dice-six"></i></a>
                  {{else}}
                  <span class="item-control skill-roll" style="color: lightgray;" title="No skill pool"><i class="fas fa-dice-six"></i></span>
                  {{/if}}
                </td>
         	    </tr>
              {{/if}}
              {{#if (not skill.specialization) }}
         	    <tr>
         	    	<td style="width: 7.5em; font-size: smaller; vertical-align:middle">{{ localize 'shadowrun6.label.specialization' }}</td>
         	    	<td style="width: 10em;">
         	    		<select name="skillSpecialization{{id}}" data-field="system.skills.{{id}}.specialization" style="width: -webkit-fill-available;">
                   {{selectOptions (lookup ../config.skill_special id) selected=skill.specialization blank=(localize "shadowrun6.label.none") localize=true}}
               		</select>
               	</td>
               	<td class="skill-pool">
                  <span>{{skill.poolS}}</span>
                </td>
               	<td class="item-controls">
                  {{#if skill.poolS }}
                  <a class="item-control skill-roll" data-skill="{{id}}" data-skillspec="{{skill.specialization}}" title="Roll"><i class="fas fa-dice-six"></i></a>
                  {{else}}
                  <span class="item-control skill-roll" style="color: lightgray;" title="No skill pool"><i class="fas fa-dice-six"></i></span>
                  {{/if}}
                </td>
         	    </tr>
              {{/if}}

              {{#if (and skill.specialization (or @root.settings.expandedSpecializations skill.exotic))}}
              {{!-- New Expanded Specializations --}}
         	    <tr>
         	    	<td style="width: 7.5em; font-size: smaller; vertical-align:middle">{{ localize 'shadowrun6.label.specialization' }}</td>
         	    	<td style="width: 10em;">
         	    		<select class="expandedSpecializations" data-skill="{{id}}" data-idx="{{skill.expandedSpecializations.length}}" style="width: -webkit-fill-available;">
                   {{selectOptions (lookup @root.config.skill_special id) blank=(localize "shadowrun6.label.none") localize=true}}
               		</select>
               	</td>
               	<td class="skill-pool"></td>
               	<td class="item-controls">
                  <span class="item-control skill-roll" style="color: lightgray;" title="No skill pool"><i class="fas fa-dice-six"></i></span>
                </td>
         	    </tr>
              {{/if}}
         	  </table>

         	</div>
         </div>
         </div>
       </li>
       {{/if}}
    {{/each}}
  </ol>
</div>