Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes schedules.html tables mobile-friendly. #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions gui/static/css/kelvin.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
body {
padding-top: 50px;
}

@media (max-width: 767px) {
.deleteschedule {
padding-top: 20px;
}
}
110 changes: 58 additions & 52 deletions gui/template/schedules.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,68 +70,74 @@ <h1>Kelvin schedules</h1>
<input type="checkbox" class="appearBehavior form-check-input" {{if .EnableWhenLightsAppear}}checked{{end}} autocomplete="off">
</div>
</form>
<div class="subschedule">
<div class="subschedule row">
<h1>Morning <small>(00:00 - sunrise)</small></h1>
<table class="beforeSunrise table">
<tr><th class="col-md-2">Time</th><th class="col-md-4">Color Temperature</th><th class="col-md-4">Brightness</th><th class="col-md-2">Control</th></tr>
{{range .BeforeSunrise}}
<tr class="entry">
<td><input type="time" name="time" class="time form-control" value="{{.Time}}" autocomplete="off"></td>
<td><input type="number" name="colorTemperature" class="colorTemperature form-control" value="{{.ColorTemperature}}" min="0" max="6500" autocomplete="off"></td>
<td><input type="range" name="brightness" class="brightness form-control" value="{{.Brightness}}" min="0" max="100" autocomplete="off"></td>
<td>
<div class="btn-group">
<button type="button" class="deleteEntryButton btn btn-primary">Delete</button>
<button type="button" class="testEntryButton btn btn-primary">Test</button>
</div>
</td>
</tr>
{{end}}
</table>
<div class="text-center">
<div class="table-responsive">
<table class="beforeSunrise table">
<tr><th class="col-md-2">Time</th><th class="col-md-4">Color Temperature</th><th class="col-md-4">Brightness</th><th class="col-md-2">Control</th></tr>
{{range .BeforeSunrise}}
<tr class="entry">
<td><input type="time" name="time" class="time form-control" value="{{.Time}}" autocomplete="off"></td>
<td><input type="number" name="colorTemperature" class="colorTemperature form-control" value="{{.ColorTemperature}}" min="0" max="6500" autocomplete="off"></td>
<td><input type="range" name="brightness" class="brightness form-control" value="{{.Brightness}}" min="0" max="100" autocomplete="off"></td>
<td>
<div class="btn-group">
<button type="button" class="deleteEntryButton btn btn-primary">Delete</button>
<button type="button" class="testEntryButton btn btn-primary">Test</button>
</div>
</td>
</tr>
{{end}}
</table>
</div>
<div class="row text-center">
<button type="button" class="addEntryButton btn btn-primary">Add entry</button>
</div>
</div>
<div class="subschedule">
<div class="subschedule row">
<h1>Daylight <small>(sunrise - sunset)</small></h1>
<table class="default table">
<tr><th class="col-md-2">Time</th><th class="col-md-4">Color Temperature</th><th class="col-md-4">Brightness</th><th class="col-md-2">Control</th></tr>
<tr class="entry">
<td><input type="text" name="time" class="text form-control" value="sunrise - sunset" disabled></td>
<td><input type="number" name="colorTemperature" class="colorTemperature form-control" value="{{.DefaultColorTemperature}}" min="0" max="6500" autocomplete="off"></td>
<td><input type="range" name="brightness" class="brightness form-control" value="{{.DefaultBrightness}}" min="0" max="100" autocomplete="off"></td>
<td>
<div class="btn-group">
<button type="button" class="deleteEntryButton btn btn-primary" disabled>Delete</button>
<button type="button" class="testEntryButton btn btn-primary">Test</button>
</div>
</td>
</tr>
</table>
<div class="table-responsive">
<table class="default table">
<tr><th class="col-md-2">Time</th><th class="col-md-4">Color Temperature</th><th class="col-md-4">Brightness</th><th class="col-md-2">Control</th></tr>
<tr class="entry">
<td><input type="text" name="time" class="text form-control" value="sunrise - sunset" disabled></td>
<td><input type="number" name="colorTemperature" class="colorTemperature form-control" value="{{.DefaultColorTemperature}}" min="0" max="6500" autocomplete="off"></td>
<td><input type="range" name="brightness" class="brightness form-control" value="{{.DefaultBrightness}}" min="0" max="100" autocomplete="off"></td>
<td>
<div class="btn-group">
<button type="button" class="deleteEntryButton btn btn-primary" disabled>Delete</button>
<button type="button" class="testEntryButton btn btn-primary">Test</button>
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="subschedule">
<div class="subschedule row">
<h1>Evening <small>(sunset - 23:59)</small></h1>
<table class="afterSunset table">
<tr><th class="col-md-2">Time</th><th class="col-md-4">Color Temperature</th><th class="col-md-4">Brightness</th><th class="col-md-2">Control</th></tr>
{{range .AfterSunset}}
<tr class="entry">
<td><input type="time" name="time" class="time form-control" value="{{.Time}}" autocomplete="off"></td>
<td><input type="number" name="colorTemperature" class="colorTemperature form-control" value="{{.ColorTemperature}}" min="0" max="6500" autocomplete="off"></td>
<td><input type="range" name="brightness" class="brightness form-control" value="{{.Brightness}}" min="0" max="100" autocomplete="off"></td>
<td>
<div class="btn-group">
<button type="button" class="deleteEntryButton btn btn-primary">Delete</button>
<button type="button" class="testEntryButton btn btn-primary">Test</button>
</div>
</td>
</tr>
{{end}}
</table>
<div class="text-center">
<div class="table-responsive">
<table class="afterSunset table">
<tr><th class="col-md-2">Time</th><th class="col-md-4">Color Temperature</th><th class="col-md-4">Brightness</th><th class="col-md-2">Control</th></tr>
{{range .AfterSunset}}
<tr class="entry">
<td><input type="time" name="time" class="time form-control" value="{{.Time}}" autocomplete="off"></td>
<td><input type="number" name="colorTemperature" class="colorTemperature form-control" value="{{.ColorTemperature}}" min="0" max="6500" autocomplete="off"></td>
<td><input type="range" name="brightness" class="brightness form-control" value="{{.Brightness}}" min="0" max="100" autocomplete="off"></td>
<td>
<div class="btn-group">
<button type="button" class="deleteEntryButton btn btn-primary">Delete</button>
<button type="button" class="testEntryButton btn btn-primary">Test</button>
</div>
</td>
</tr>
{{end}}
</table>
</div>
<div class="row text-center">
<button type="button" class="addEntryButton btn btn-primary">Add entry</button>
</div>
</div>
<div class="text-right">
<div class="deleteschedule row text-right">
<button type="button" class="deleteScheduleButton btn btn-danger">Delete schedule</button>
</div>
</div>
Expand Down