<template name="alarm_settings">
    <div class="modal fade">
        <div class="modal-dialog">
            <div class="modal-content">

                <div class="modal-header">
                    <h4 class="modal-title">Podešavanje Alarma</h4>
                </div>

                <div class="modal-body">
                    <div class="form-group">
                        <h3>Alarmiraj:</h3>
                        <table class="table">


                            <tr>
                                <td>ako je temperatura niža od
                                </td>
                                <td>
                                    <input required name="min_temperature" id="min_temperature" type="number" min="-20" max="50"  step="0.1" value={{ config 'minTemperature'}} />°C</td>
                            </tr>
                            <tr>
                                <td>ako je temperatura viša od
                                </td>
                                <td>
                                    <input required name="max_temperature" id="max_temperature" type="number" min="-20" max="50" step="0.1" value={{ config 'maxTemperature'}} />°C</td>
                            </tr>
                            <tr>
                                <td>ako se Zoblak Alarm Kutija ne javi
                                </td>
                                <td>
                                    <input required name="timeout_box" id="timeout_box" type="number" min="1" max="90" value={{ config 'timeoutBox'}} /> minuta </td>
                            </tr>
                            <tr>
                                <td>ako se bar jedan mobitel ne javi
                                </td>
                                <td>
                                    <input required name="timeout_phone" id="timeout_phone" type="number" min="1" max="90" value={{ config 'timeoutPhone'}} /> minuta </td>
                            </tr>
                        </table>
                    </div>

                    <div class="form-group">
                        <h3>U slučaju kritične situacije - javi SMS-om na telefone: </h3>
                        <table class="table">
                            <td>1.
                            </td>
                            <td>
                                <input required name="sms1" type="tel" id="sms1" placeholder="+3876xxxxxxxx"  value={{ config 'sms1'}} />
                            </td>
                            <tr>
                                <td>2.
                                </td>
                                <td>
                                    <input required name="sms2" type="tel" id="sms2" placeholder="+3876xxxxxxxx" value={{ config 'sms2'}} />
                                </td>
                            </tr>
                            <tr>
                                <td>3.
                                </td>
                                <td>
                                    <input required name="sms3" type="tel" id="sms3" placeholder="+3876xxxxxxxx" value={{ config 'sms3'}} />
                                </td>
                            </tr>
                            <tr>
                                <td>4.
                                </td>
                                <td>
                                    <input required name="sms4" type="tel" id="sms4" placeholder="+3876xxxxxxxx" value={{ config 'sms4'}} />
                                </td>
                            </tr>
                        </table>
                    </div>


                <div class="form-group">
                    <h3>Senzori: </h3>
                    <table class="table">
                      {{#each sensor in sensors }}
                        <tr>
                          <td>
                            {{ pretty_temperature sensor.value }}
                          </td>
                          <td>
                            <label class="switch">
                              <input type="checkbox" checked={{sensor.on}} class="sensor_switch" />
                              <div class="slider round"></div>
                            </label>
                          </td>
                        </tr>
                      {{/each}}
                    </table>
                </div>
            </div>

                <div class="modal-footer">
                  <button id="cancel_settings" class="btn btn-danger" name="cancel_settings" data-dismiss="modal">Odgodi</button>
                  
                    <button id="save_settings" class="btn btn-default" name="save_settings" data-dismiss="modal">Zapamti</button>
                </div>

            </div>
        </div>
    </div>

</template>
