blob: 3b2ea7ae8fd51f108fa098aec4952ea3f2c03adf (
plain) (
tree)
|
|
<input type="hidden" name="locationid" value="{{id}}">
<div id="settings-outer">
<h3>{{lang_openingTime}}</h3>
{{^expertMode}}
<div id="simple-mode">
<div align="right" style="margin-bottom: 10px;">
<a href="#" class="btn btn-default btn-sm" id="btn-show-expert">{{lang_expertMode}}</a>
</div>
<div class="clearfix"></div>
<table class="table table-condensed" style="margin-bottom:0">
<tr>
<th>{{lang_day}}</th>
<th>{{lang_openingTime}}</th>
<th>{{lang_closingTime}}</th>
</tr>
<tr class="tablerow">
<td>{{lang_monTilFr}}</td>
<td>
<div class="input-group bootstrap-timepicker">
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>
<input type="text" class="form-control timepicker2" id="week-open" pattern="[0-9]{1,2}:[0-9]{2}">
</div>
</td>
<td>
<div class="input-group bootstrap-timepicker">
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>
<input type="text" class="form-control timepicker2" id="week-close" pattern="[0-9]{1,2}:[0-9]{2}">
</div>
</td>
</tr>
<tr class="tablerow">
<td>{{lang_saturday}}</td>
<td>
<div class="input-group bootstrap-timepicker">
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>
<input type="text" class="form-control timepicker2" id="saturday-open" pattern="[0-9]{1,2}:[0-9]{2}">
</div>
</td>
<td>
<div class="input-group bootstrap-timepicker">
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>
<input type="text" class="form-control timepicker2" id="saturday-close" pattern="[0-9]{1,2}:[0-9]{2}">
</div>
</td>
</tr>
<tr class="tablerow">
<td>{{lang_sunday}}</td>
<td>
<div class="input-group bootstrap-timepicker">
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>
<input type="text" class="form-control timepicker2" id="sunday-open" pattern="[0-9]{1,2}:[0-9]{2}">
</div>
</td>
<td>
<div class="input-group bootstrap-timepicker">
<span class="input-group-addon">
<span class="glyphicon glyphicon-time"></span>
</span>
<input type="text" class="form-control timepicker2" id="sunday-close" pattern="[0-9]{1,2}:[0-9]{2}">
</div>
</td>
</tr>
</table>
</div>
{{/expertMode}}
<div id="expert-mode" style="{{^expertMode}}display:none{{/expertMode}}">
<div class="clearfix"></div>
<div id="expert-table">
<div class="row">
<div class="col-sm-6">{{lang_openingTime}}</div>
<div class="col-sm-4">{{lang_closingTime}}</div>
<div class="col-sm-2 text-right">{{lang_delete}}</div>
</div>
</div>
<hr>
<div style="text-align: center;">
<a class="btn btn-success btn-sm" id="new-openingtime">
<span class="glyphicon glyphicon-plus-sign"></span>
{{lang_openingTime}}
</a>
</div>
<br>
</div>
</div>
<div class="hidden" id="expert-template">
<div class="row expert-row">
<hr>
<div class="col-xs-12 days-box">
<div class="pull-right checkbox checkbox-inline"><input type="checkbox" class="i-delete"><label><span class="glyphicon glyphicon-trash"></span></label></div>
<div class="checkbox checkbox-inline"><input type="checkbox" class="i-Monday"><label>{{lang_shortMonday}}</label></div>
<div class="checkbox checkbox-inline"><input type="checkbox" class="i-Tuesday"><label>{{lang_shortTuesday}}</label></div>
<div class="checkbox checkbox-inline"><input type="checkbox" class="i-Wednesday"><label>{{lang_shortWednesday}}</label></div>
<div class="checkbox checkbox-inline"><input type="checkbox" class="i-Thursday"><label>{{lang_shortThursday}}</label></div>
<div class="checkbox checkbox-inline"><input type="checkbox" class="i-Friday"><label>{{lang_shortFriday}}</label></div>
<div class="checkbox checkbox-inline"><input type="checkbox" class="i-Saturday"><label>{{lang_shortSaturday}}</label></div>
<div class="checkbox checkbox-inline"><input type="checkbox" class="i-Sunday"><label>{{lang_shortSunday}}</label></div>
</div>
<div class="col-sm-6">
<div class="input-group bootstrap-timepicker">
<span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span>
<input type="text" class="form-control timepicker2 i-openingtime" pattern="[0-9]{1,2}:[0-9]{2}">
</div>
</div>
<div class="col-sm-6">
<div class="input-group bootstrap-timepicker">
<span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span>
<input type="text" class="form-control timepicker2 i-closingtime" pattern="[0-9]{1,2}:[0-9]{2}">
</div>
</div>
</div>
</div>
{{#rebootcontrol}}
<hr>
<div class="row">
<div class="col-sm-4">
<div class="checkbox checkbox-inline">
<input id="wol" name="wol" class="wol" type="checkbox">
<label for="wol">{{lang_wakeonlan}}</label>
</div>
</div>
<div class="col-sm-8">
<input disabled type="number" id="wol-offset" name="wol-offset" class="wol-offset" value="{{wol-options.wol-offset}}" placeholder="0" min="0" max="15">
<label for="wol-offset">{{lang_offsetEarly}}</label>
</div>
<div class="col-sm-4">
<div class="checkbox checkbox-inline">
<input id="sd" name="sd" class="sd" type="checkbox">
<label for="sd">{{lang_shutdown}}</label>
</div>
</div>
<div class="col-sm-8">
<input disabled type="number" id="sd-offset" name="sd-offset" class="sd-offset" value="{{sd-options.sd-offset}}" placeholder="0" min="0" max="15">
<label for="sd-offset">{{lang_offsetLate}}</label>
</div>
</div>
{{/rebootcontrol}}
<script type="application/javascript"><!--
let wol = $('#wol');
let sd = $('#sd');
wol.attr('checked',{{wol}});
sd.attr('checked',{{sd}});
$('#wol-offset').attr('disabled', !$('#wol').is(':checked'));
$('#sd-offset').attr('disabled', !$('#sd').is(':checked'));
wol.on('click', function(){
$('#wol-offset').attr('disabled', !$(this).is(':checked'));
});
sd.on('click', function(){
$('#sd-offset').attr('disabled', !$(this).is(':checked'));
});
(function() {
var scheduleData = {{{schedule_data}}};
{{#expertMode}}
for (var i = 0; i < scheduleData.length; ++i) {
newOpeningTime(scheduleData[i]);
}
{{/expertMode}}
{{^expertMode}}
for (var i = 0; i < scheduleData.length; ++i) {
if (scheduleData[i].days.length === 5) {
$('#week-open').val(scheduleData[i]['openingtime']);
$('#week-close').val(scheduleData[i]['closingtime']);
} else if (scheduleData[i].days.length === 1 && scheduleData[i].days[0] === 'Saturday') {
$('#saturday-open').val(scheduleData[i]['openingtime']);
$('#saturday-close').val(scheduleData[i]['closingtime']);
} else if (scheduleData[i].days.length === 1 && scheduleData[i].days[0] === 'Sunday') {
$('#sunday-open').val(scheduleData[i]['openingtime']);
$('#sunday-close').val(scheduleData[i]['closingtime']);
}
}
{{/expertMode}}
setTimepicker($('#settings-outer').find('.timepicker2'));
$('p.helptext').tooltip();
$('#new-openingtime').click(function (e) {
e.preventDefault();
setTimepicker(newOpeningTime({}).find('.timepicker2'));
});
$('#btn-show-expert').click(function (e) {
e.preventDefault();
scheduleData = simpleToExpert();
for (var i = 0; i < scheduleData.length; ++i) {
setTimepicker(newOpeningTime(scheduleData[i]).find('.timepicker2'));
}
$('#simple-mode').remove();
$('#expert-mode').show();
});
})();
//--></script>
|