<div class="tab competences {{tab.cssClass}}" data-group="sheet" data-tab="competences">
  <div class="stats-grid">
    {{#each stats as |stat statId|}}
    <div class="stat-block">
      <div class="stat-header">
        <span class="stat-name">{{localize stat.label}}</span>
        <div class="stat-res">
          <label>{{localize "CELESTOPOL.Stat.res"}}</label>
          {{#if ../isEditMode}}
            <input type="number" name="system.stats.{{statId}}.res"
                   value="{{lookup ../system.stats statId 'res'}}" min="0" max="8">
          {{else}}
            <span class="stat-res-value">
              {{lookup ../system.stats statId 'actuel'}} / {{lookup ../system.stats statId 'res'}}
            </span>
          {{/if}}
        </div>
      </div>
      <div class="skills-list">
        {{#each (lookup ../skills statId) as |skill skillId|}}
        <div class="skill-row {{#unless ../isEditMode}}rollable{{/unless}}"
             data-stat-id="{{statId}}" data-skill-id="{{skillId}}">
          <span class="skill-name">{{localize skill.label}}</span>
          {{#if ../isEditMode}}
            <input type="number" name="system.stats.{{statId}}.{{skillId}}.value"
                   value="{{lookup (lookup ../system.stats statId) skillId 'value'}}"
                   min="0" max="8" class="skill-value-input">
          {{else}}
            <span class="skill-value">{{lookup (lookup ../system.stats statId) skillId 'value'}}</span>
          {{/if}}
        </div>
        {{/each}}
      </div>
    </div>
    {{/each}}
  </div>
</div>
