Download this file
| 1 | {{/* Settings' Housekeeping: two groups of the Settings pattern |
| 2 | (settings_nav.html). Status applies at once: the state in words and |
| 3 | Pause or Resume beside it. Quiet hours are editable fields saved from |
| 4 | the savebar; the hours are off while the switch is (settings.js). */}} |
| 5 | {{define "housekeeping-settings"}}<div equipo-hk-settings data-hk-settings> |
| 6 | {{template "hk-status" .}} |
| 7 | <form method="post" action="/settings/housekeeping/quiet" equipo-sp-group id="hk-quiet" aria-labelledby="hk-quiet-h" data-hk-quiet data-savebar-form><input type="hidden" name="revision" value="{{.Revision}}"> |
| 8 | <div equipo-sp-group-head><h2 id="hk-quiet-h">{{copy "housekeeping.settings.quiet"}}</h2><p>{{copy "housekeeping.settings.quiet_hint"}}</p></div> |
| 9 | <div equipo-sp-card> |
| 10 | <div equipo-sp-row><label equipo-sp-label for="hk-quiet-on"><span equipo-sp-title>{{copy "housekeeping.settings.quiet_on"}}</span></label><span equipo-sp-control><label rst-switch><input type="checkbox" id="hk-quiet-on" name="on" value="1"{{if .QuietOn}} checked{{end}} data-hk-quiet-on data-enables="hk-hours"><span rst-switch-track aria-hidden="true"></span><span equipo-visually-hidden>{{copy "housekeeping.settings.quiet_on"}}</span></label></span></div> |
| 11 | <fieldset equipo-sp-row id="hk-hours" aria-labelledby="hk-hours-h" data-hk-hours><span equipo-sp-label><span equipo-sp-title id="hk-hours-h">{{copy "housekeeping.settings.hours"}}</span></span> |
| 12 | <span equipo-sp-control equipo-hk-hours><label>{{copy "housekeeping.settings.from"}}<select rst-input name="from" data-hk-quiet-from>{{$f := .From}}{{range .Hours}}<option value="{{.Value}}"{{if eq .Value $f}} selected{{end}}>{{.Label}}</option>{{end}}</select></label> |
| 13 | <label>{{copy "housekeeping.settings.until"}}<select rst-input name="until" data-hk-quiet-until>{{$u := .Until}}{{range .Hours}}<option value="{{.Value}}"{{if eq .Value $u}} selected{{end}}>{{.Label}}</option>{{end}}</select></label></span></fieldset> |
| 14 | </div> |
| 15 | {{template "savebar"}} |
| 16 | </form> |
| 17 | </div>{{end}} |
| 18 | {{define "hk-status"}}<section equipo-sp-group id="hk-status" aria-labelledby="hk-status-h" data-hk-status{{if .Paused}} data-paused{{end}}> |
| 19 | <div equipo-sp-group-head><h2 id="hk-status-h">{{copy "housekeeping.settings.status"}}</h2><p>{{copy "housekeeping.settings.status_hint"}}</p></div> |
| 20 | <div equipo-sp-card><div equipo-sp-row> |
| 21 | <div equipo-sp-label><p equipo-sp-title><span equipo-sp-dot{{if not .Paused}} data-active{{end}} aria-hidden="true"></span>{{if .Paused}}{{copy "housekeeping.settings.off"}}{{else}}{{copy "housekeeping.settings.on"}}{{end}}</p><p equipo-sp-desc>{{if .Paused}}{{copy "housekeeping.settings.off_desc"}} {{end}}<a href="/housekeeping" data-hk-activity>{{copy "housekeeping.settings.activity"}}</a></p></div> |
| 22 | <form method="post" action="/settings/housekeeping/pause" equipo-sp-control><input type="hidden" name="revision" value="{{.Revision}}">{{if .Paused}}<input type="hidden" name="paused" value="0"><button rst-btn type="submit" data-hk-resume>{{copy "housekeeping.resume"}}</button>{{else}}<input type="hidden" name="paused" value="1"><button rst-btn type="submit" data-hk-pause>{{copy "housekeeping.pause"}}</button>{{end}}</form> |
| 23 | </div></div> |
| 24 | </section>{{end}} |
| 25 | |