{{template "base/base.html" .}}
{{define "meta"}}
{{end}}
{{define "extrajs"}}
{{end}}
{{define "body"}}
  <br/>

  {{range $key, $val := .sensors}}
  <form method="POST" action="/sensors" class="form-inline">
    <input type="hidden" name="type" value="tempSensor" />
    <div class="panel panel-info">
      <div class="panel-heading">
        <h3 class="panel-title">{{$val.SensorMAC}}</h3>
        <input type="hidden" name="mac" value="{{$val.SensorMAC}}"/>
      </div>
      <div class="panel-body">
        <div class="form-group">
          <label>Interval de prise de mesure : </label>
          <input type="number" class="form-control" name="interval" value="{{$val.Interval}}"/>
        </div>
        <br/><br/>
        <div class="form-group">
          <label>Nom du capteur : </label>
          <input type="text" class="form-control" name="description" value="{{$val.Description}}"/>
        </div>
        <br/><br/>
        <input class="btn btn-default btn btn-success" name="save" type="submit" value="Enregistrer"/>
        <input class="btn btn-default btn btn-danger"  name="delete" type="submit" value="Supprimer"/>
      </div>
    </div>
  </form>
  {{end}}

  <br/>

  {{range $key, $val := .relays}}
  <form method="POST" action="/sensors" class="form-inline">
    <input type="hidden" name="type" value="relay" />
    <div class="panel panel-warning">
      <div class="panel-heading">
        <h3 class="panel-title">{{$val.Mac}}</h3>
        <input type="hidden" name="mac" value="{{$val.Mac}}"/>
      </div>
      <div class="panel-body">
        <div class="form-group">
          <label>Nom du relai : </label>
          <input type="text" class="form-control" name="description" value="{{$val.Description}}"/>
        </div>
        <br/><br/>
        <input class="btn btn-default btn btn-success" name="save" type="submit" value="Enregistrer"/>
        <input class="btn btn-default btn btn-danger"  name="delete" type="submit" value="Supprimer"/>
      </div>
    </div>
  </form>
  {{end}}
  <br/>
{{end}}
