<form class="skill-roll-dialog">
  <header class="roll-dialog-header">
    {{#if img}}
    <img class="actor-icon" src="{{img}}" data-edit="img" title="{{name}}" />
    {{/if}}
    <h1 class="dialog-roll-title roll-dialog-header">{{title}}</h1>
  </header>

  <div class="flexcol">

    {{#if (eq mode "rang")}}
    <div class="flexrow">
      <span class="roll-dialog-label">{{rang.label}}</span>
      <span class="roll-dialog-label">{{rang.value}}</span>
    </div>
    {{/if}}
    
    {{#if (eq mode "carac")}}
      <div class="flexrow">
        <span class="roll-dialog-label">Caracteristique</span>
        <span class="roll-dialog-label">{{carac.label}} ({{carac.value}})</span>
      </div>
    {{else}}
      <div class="flexrow">
        <span class="roll-dialog-label">Caracteristique</span>
        <select class="status-small-label color-class-common" id="caracKey" type="text" name="caracKey" value="caracKey" data-dtype="string" >
          {{selectOptions caracList selected=caracKey valueAttr="abbrev" nameAttr="abbrev" labelAttr="label"}}                        
        </select>      
      </div>
    {{/if}}

    {{#if competence}}
      <div class="flexrow">
        <span class="roll-dialog-label">{{competence.name}}</span>
        <span class="small-label roll-dialog-label">{{competence.system.niveau}}</span>
      </div>
      {{#if competence.nbSpec}}
        <div class="flexrow">
          <span class="roll-dialog-label">Spécialités : {{competence.specList}}</span>
        </div>
        <div class="flexrow">
          <span class="roll-dialog-label">Bonus de spécialité ?</span>
          <input type="checkbox" class="item-field-label-short" id="useSpecialite" {{checked useSpecialite}}/>
        </div>
      {{/if}}
    {{/if}}

    {{#if pouvoir}}
    <div class="flexrow">
      <span class="roll-dialog-label">Pouvoir : </span>
      <span class="small-label roll-dialog-label">{{pouvoir.name}}</span>
    </div>
    <div class="flexrow">
      <span class="roll-dialog-label">Activation : </span>
      <span class="small-label roll-dialog-label">{{pouvoir.system.activation}}</span>
    </div>
      {{#if pouvoirBase}}
      <div class="flexrow">
        <span class="roll-dialog-label">{{pouvoirBase.label}} : </span>
        <span class="small-label roll-dialog-label">{{pouvoirBase.value}}</span>
      </div>  
      {{/if}}
      <div class="flexrow">
        <span class="roll-dialog-label">Points d'usage consommés : </span>
        <select class="status-small-label color-class-common" id="pouvoirPointsUsage" type="Number" name="pouvoirPointsUsage" value="pouvoirPointsUsage" data-dtype="Number" >
          {{selectOptions config.pointsUsageList selected=pouvoirPointsUsage}}                        
        </select>      
      </div>
      {{/if}}

    {{#each rulesMalus as |malus key|}}
    <div class="flexrow">
      <span class="roll-dialog-label">{{malus.name}}</span>
      <span class="small-label roll-dialog-label">{{malus.value}}</span>
    </div>
    {{/each}}

    {{#if (and arme arme.system.isMelee)}}
    <div class="flexrow">
      <span class="roll-dialog-label">Attaque à plusieurs </span>
      <select class="roll-dialog-label" id="bonus-attaque-plusieurs" type="text" value="{{bonusAttaquePlusieurs}}"
        data-dtype="Number">
        {{selectOptions config.attaquePlusieursList selected=pouvoirPointsUsage}}                        
      </select>
    </div>
    <div class="flexrow">
      <span class="roll-dialog-label">Attaque dans le dos ?</span>
      <input type="checkbox" class="item-field-label-short" id="attaqueDos" {{checked attaqueDos}}/>
    </div>
      <div class="flexrow">
        <span class="roll-dialog-label">Attaque à deux armes </span>
        <select class="roll-dialog-label" id="bonus-attaque-deux-armes" type="text" value="{{attaqueDeuxArmes}}"
          data-dtype="Number">
          {{selectOptions config.attaque2ArmesListe selected=attaqueDeuxArmes valueAttr="value" nameAttr="value" labelAttr="label"}}                        
        </select>
      </div>    
      <div class="flexrow">
        <span class="roll-dialog-label">Seconde arme</span>
        <select class="roll-dialog-label" id="bonus-attaque-seconde-arme" type="text" value="{{secondeArme}}"
          data-dtype="String">
          {{selectOptions armes selected=secondeArme valueAttr="id" nameAttr="id" labelAttr="name"}}                        
        </select>
      </div>    
    {{/if}}
    
    {{#if arme}}
    <li class="flexrow item">
      <label class="roll-dialog-label">Ataque ciblée : </label>
      <select class="roll-dialog-label" type="text" id="attaque-cible" value="{{attaqueCible}}" data-dtype="String">
        {{selectOptions config.attaqueCible selected=attaqueCible}}                        
      </select>
    </li>


    {{/if}}

    <div class="flexrow">
      <span class="roll-dialog-label">Bonus/Malus </span>
      <select class="roll-dialog-label" id="bonus-malus-context" type="text" value="{{bonusMalusContext}}"
        data-dtype="Number">
        {{selectOptions config.bonusMalusContext selected=bonusMalusContext valueAttr="value" nameAttr="value" labelAttr="label"}}                        
      </select>
    </div>

    {{#if cacheDifficulte}}
    <div class="flexrow">
      <span class="roll-dialog-label">Difficulté Cachée/Inconnue</span>
    </div>
    {{else}}
    <div class="flexrow">
      <span class="roll-dialog-label">Difficulté</span>
      <select class="status-small-label color-class-common" id ="sdValue" type="text" name="sdValue" value="sdValue" data-dtype="string" >
        {{selectOptions sdList selected=sdValue}}
      </select>
    </div>
    {{/if}}

  </div>

</form>