diff options
author | Christian Hofmaier | 2020-09-08 20:56:19 +0200 |
---|---|---|
committer | Christian Hofmaier | 2020-09-08 20:56:19 +0200 |
commit | c535ce5e2f78f5223662c97543f718334abf2a35 (patch) | |
tree | 728fe2fcfe16e33757daeb086ba905c2f834118e /modules-available/locations/templates/ajax-opening-location.html | |
parent | [locationinfo] Fix overriding "show hostnames" not being saved (diff) | |
download | slx-admin-c535ce5e2f78f5223662c97543f718334abf2a35.tar.gz slx-admin-c535ce5e2f78f5223662c97543f718334abf2a35.tar.xz slx-admin-c535ce5e2f78f5223662c97543f718334abf2a35.zip |
[locations] Migrate openingtimes from infoscreen to locations module
- move openingtimes from infoscreen db to locations db
- read-only openingtimes in infoscreen
Diffstat (limited to 'modules-available/locations/templates/ajax-opening-location.html')
-rw-r--r-- | modules-available/locations/templates/ajax-opening-location.html | 173 |
1 files changed, 173 insertions, 0 deletions
diff --git a/modules-available/locations/templates/ajax-opening-location.html b/modules-available/locations/templates/ajax-opening-location.html new file mode 100644 index 00000000..09fe7869 --- /dev/null +++ b/modules-available/locations/templates/ajax-opening-location.html @@ -0,0 +1,173 @@ +<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> + +<script type="application/javascript"><!-- + (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> |