<div class="sortilege-dialog">

  <div class="sortilege-header flexrow">
    <img src="{{img}}" class="sortilege-actor-img" />
    <div class="sortilege-actor-info">
      <span class="sortilege-actor-name">{{name}}</span>
      <span class="sortilege-ame-info">Âme disponible : <strong>{{ameDisponible}}</strong></span>
    </div>
  </div>

  <div class="flexrow sortilege-mode-row">
    <label class="roll-dialog-label">Mode :</label>
    <select name="runemode" id="sortilege-runemode" class="roll-dialog-label">
      {{selectOptions config.lancementRuneOptions selected=runemode}}
    </select>
  </div>

  <table class="sortilege-runes-table">
    <thead>
      <tr>
        <th></th>
        <th>Rune</th>
        <th class="text-center">Seuil</th>
        <th class="text-center">Points d'âme</th>
      </tr>
    </thead>
    <tbody>
      {{#each runes as |rune|}}
      <tr class="sortilege-rune-row" data-rune-id="{{rune._id}}" data-seuil="{{rune.system.seuil}}">
        <td class="text-center">
          <input type="checkbox" name="rune-selected-{{rune._id}}" class="sortilege-rune-checkbox" value="{{rune._id}}" />
        </td>
        <td>
          <img src="{{rune.img}}" class="rune-mini-img" />
          {{rune.name}}
        </td>
        <td class="text-center">{{rune.system.seuil}}</td>
        <td class="text-center">
          <select name="rune-points-{{rune._id}}" class="sortilege-rune-points" disabled>
            {{#each ../ameOptions as |n|}}
            <option value="{{n}}" {{#if (eq n 1)}}selected{{/if}}>{{n}}</option>
            {{/each}}
          </select>
        </td>
      </tr>
      {{/each}}
    </tbody>
  </table>

  <div class="sortilege-summary">
    <div class="flexrow summary-row">
      <span class="summary-label">Difficulté :</span>
      <span class="summary-value" id="sortilege-difficulte">—</span>
    </div>
    <div class="flexrow summary-row">
      <span class="summary-label">Points d'âme totaux :</span>
      <span class="summary-value" id="sortilege-total-ame">0</span>
    </div>
    <div class="flexrow summary-row">
      <span class="summary-label">Actions complexes :</span>
      <span class="summary-value" id="sortilege-actions">0</span>
    </div>
  </div>

  <div class="flexrow">
    <label class="roll-dialog-label" for="sortilege-autocible">Uniquement sur soi-même (réussite héroïque) ?</label>
    <input type="checkbox" id="sortilege-autocible" name="runeautocible" />
  </div>

  <div class="flexrow">
    <label class="roll-dialog-label">Modificateur :</label>
    <select name="modificateur" class="sortilege-modificateur-select">
      {{#each modOptions as |n|}}
      <option value="{{n}}" {{#if (eq n 0)}}selected{{/if}}>{{#if (gt n 0)}}+{{/if}}{{n}}</option>
      {{/each}}
    </select>
  </div>

</div>
