diff options
author | Simon Rettberg | 2021-03-19 13:54:22 +0100 |
---|---|---|
committer | Simon Rettberg | 2021-03-19 13:54:22 +0100 |
commit | 4c0862efe57fbdaa51a69c8dc39f6fc4ae45fa20 (patch) | |
tree | cf5d472d2bea7a4ba43339bf892db6dad710e51c /modules-available/locations/templates/ajax-opening-location.html | |
parent | [locations] Add permission for openingtimes (diff) | |
download | slx-admin-4c0862efe57fbdaa51a69c8dc39f6fc4ae45fa20.tar.gz slx-admin-4c0862efe57fbdaa51a69c8dc39f6fc4ae45fa20.tar.xz slx-admin-4c0862efe57fbdaa51a69c8dc39f6fc4ae45fa20.zip |
[locations/rebootcontrol] Inherit openingtimes for WOL/shutdown
The opening times schedule is now inherited to child locations, so it's
easy to toggle WOL or shutdown for individual rooms in a building, where
you only have to set the opening times once for the entire building.
As of now, WOL and shutdown settings are *not* inherited to child
locations, as I'm not sure if you always want to inherit those by
default.
Closes #3710
Diffstat (limited to 'modules-available/locations/templates/ajax-opening-location.html')
-rw-r--r-- | modules-available/locations/templates/ajax-opening-location.html | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/modules-available/locations/templates/ajax-opening-location.html b/modules-available/locations/templates/ajax-opening-location.html index b1aea2e2..5c741857 100644 --- a/modules-available/locations/templates/ajax-opening-location.html +++ b/modules-available/locations/templates/ajax-opening-location.html @@ -1,5 +1,10 @@ <div> <h3>{{lang_openingTime}}</h3> + <div class="checkbox"> + <input id="oi{{id}}" class="openingtimes-inherited" + type="checkbox" name="openingtimes-inherited" value="1" {{openingtimes_inherited}}> + <label for="oi{{id}}">{{lang_inheritOpeningTimes}}</label> + </div> {{^expertMode}} <div class="simple-mode"> @@ -135,7 +140,7 @@ <div class="col-sm-8"> <div class="input-group"> <input disabled type="number" id="wol-offset-{{id}}" name="wol-offset" class="form-control" - value="{{scheduler-options.wol-offset}}" placeholder="0" min="0" max="15"> + value="{{scheduler-options.wol-offset}}" placeholder="0" min="0" max="60"> <span class="input-group-addon slx-ga2"> <label for="wol-offset-{{id}}">{{lang_offsetEarly}}</label> </span> @@ -152,7 +157,7 @@ <div class="col-sm-8"> <div class="input-group"> <input disabled type="number" id="sd-offset-{{id}}" name="sd-offset" class="form-control" - value="{{scheduler-options.sd-offset}}" placeholder="0" min="0" max="15"> + value="{{scheduler-options.sd-offset}}" placeholder="0" min="0" max="60"> <span class="input-group-addon slx-ga2"> <label for="sd-offset-{{id}}">{{lang_offsetLate}}</label> </span> @@ -204,6 +209,7 @@ $loc.find('.new-openingtime').click(function (e) { e.preventDefault(); setTimepicker(newOpeningTime($loc, {}).find('.timepicker2')); + setInputEnabled(); }); $loc.find('.btn-show-expert').click(function (e) { @@ -214,9 +220,16 @@ } $loc.find('.simple-mode').remove(); $loc.find('.expert-mode').show(); + setInputEnabled(); }); $loc.find('form').submit(validateOpeningTimes); + var setInputEnabled = function () { + $loc.find('.expert-mode input, .simple-mode input').prop('disabled', $inheritCb.is(':checked') ? 'disabled' : false); + }; + var $inheritCb = $loc.find('.openingtimes-inherited'); + setInputEnabled(); + $inheritCb.change(setInputEnabled); })(); </script> |