<fieldset>
  <legend>Environnement</legend>
  <div class="form-group">
    <label>Description du milieu</label>
    <input name="system.milieu" type="text" value="{{system.milieu}}" data-dtype="String" />
  </div>
  <hr>
  <div class="form-group">
    <label>Ajouter un milieu</label>
    <span class="flexrow">
      <input name="saisie-nouveau-milieu" class="input-selection-milieu" placeholder="Milieu" type="text" data-dtype="String"/>
      <a class="milieu-add" data-tooltip="Ajouter"><i class="fas fa-plus-circle"></i></a>
    </span>
  </div>
  {{#each system.environnement as |env key|}}
  <div class="form-group" data-milieu="{{env.milieu}}">
    <label>
      {{env.milieu}}
      <a class="milieu-delete" data-tooltip="Supprimer {{env.milieu}}"><i class="fas fa-trash"></i></a>
    </label>
    <span class="flexrow">
      <select name="system.environnement.{{key}}.rarete" data-dtype="String">
        {{selectOptions (RDD_CONFIG 'raretes') selected=env.rarete labelAttr='label' valueAttr='value'}}
      </select>
      <input name="system.environnement.{{key}}.frequence" type="number" value="{{env.frequence}}" 
        min="{{rarete-getChamp env.rarete 'min'}}" max="{{rarete-getChamp env.rarete 'max'}}" step="1" data-dtype="Number" />
      <label>[{{rarete-getChamp env.rarete 'min'}}-{{rarete-getChamp env.rarete 'max'}}]</label>
    </span>
  </div>
  {{/each}}
</fieldset>
