shift page styling

This commit is contained in:
Felix Favre 2014-12-15 23:09:06 +01:00
parent c18c0983fc
commit f20e24f589
5 changed files with 158 additions and 114 deletions

View File

@ -467,7 +467,7 @@ function view_user_shifts() {
$shifts[$k]['own'] = in_array($shift['SID'], array_keys($ownshifts)); $shifts[$k]['own'] = in_array($shift['SID'], array_keys($ownshifts));
} }
$shifts_table = '<table id="shifts" class="table scrollable"><thead><tr><th>-</th>'; $shifts_table = '<div class="shifts-table"><table id="shifts" class="table scrollable"><thead><tr><th>-</th>';
foreach ($myrooms as $key => $room) { foreach ($myrooms as $key => $room) {
$rid = $room["id"]; $rid = $room["id"];
if (array_sum($block[$rid]) == 0) { if (array_sum($block[$rid]) == 0) {
@ -487,11 +487,16 @@ function view_user_shifts() {
$shifts_table .= "</tr></thead><tbody>"; $shifts_table .= "</tr></thead><tbody>";
for ($i = 0; $i < $maxshow; $i ++) { for ($i = 0; $i < $maxshow; $i ++) {
$thistime = $first + ($i * 15 * 60); $thistime = $first + ($i * 15 * 60);
$shifts_table .= "<tr><th>"; if ($thistime % (24 * 60 * 60) == 23 * 60 * 60 && $endtime - $starttime > 24 * 60 * 60) {
if ($thistime % (24 * 60 * 60) == 23 * 60 * 60 && $endtime - $starttime > 24 * 60 * 60) $shifts_table .= "<tr class=\"row-day\"><th class=\"row-header\">";
$shifts_table .= date('y-m-d<b\r>H:i', $thistime); $shifts_table .= date('y-m-d<b\r />H:i', $thistime);
elseif ($thistime % (60 * 60) == 0) }
elseif ($thistime % (60 * 60) == 0) {
$shifts_table .= "<tr class=\"row-hour\"><th>";
$shifts_table .= date("H:i", $thistime); $shifts_table .= date("H:i", $thistime);
} else {
$shifts_table .= "<tr><th>";
}
$shifts_table .= "</th>"; $shifts_table .= "</th>";
foreach ($myrooms as $room) { foreach ($myrooms as $room) {
$rid = $room["id"]; $rid = $room["id"];
@ -628,7 +633,7 @@ function view_user_shifts() {
} }
$shifts_table .= "</tr>\n"; $shifts_table .= "</tr>\n";
} }
$shifts_table .= '</tbody></table><script type="text/javascript">document.getElementById("shifts").style.maxHeight = (window.innerHeight - 100) + "px";</script>'; $shifts_table .= '</tbody></table></div>';
// qqq // qqq
} else { } else {
$shifts_table = array(); $shifts_table = array();

View File

@ -6328,6 +6328,15 @@ a#shifts td.collides:hover {
#shifts td.own { #shifts td.own {
border: 1px solid #777777; border: 1px solid #777777;
} }
.shifts-table {
overflow-x: scroll;
}
.row-day {
border-top: 2px solid #777777;
}
.row-header {
min-width: 90px;
}
.space-top { .space-top {
margin-top: 15px; margin-top: 15px;
} }

View File

@ -6351,6 +6351,15 @@ a#shifts td.collides:hover {
#shifts td.own { #shifts td.own {
border: 1px solid #888888; border: 1px solid #888888;
} }
.shifts-table {
overflow-x: scroll;
}
.row-day {
border-top: 2px solid #888888;
}
.row-header {
min-width: 90px;
}
.space-top { .space-top {
margin-top: 15px; margin-top: 15px;
} }

View File

@ -6328,6 +6328,15 @@ a#shifts td.collides:hover {
#shifts td.own { #shifts td.own {
border: 1px solid #777777; border: 1px solid #777777;
} }
.shifts-table {
overflow-x: scroll;
}
.row-day {
border-top: 2px solid #777777;
}
.row-header {
min-width: 90px;
}
.space-top { .space-top {
margin-top: 15px; margin-top: 15px;
} }

View File

@ -30,6 +30,18 @@ body {
} }
} }
.shifts-table {
overflow-x: scroll;
}
.row-day {
border-top: 2px solid @gray-light;
}
.row-header {
min-width: 90px;
}
.space-top { .space-top {
margin-top: 15px; margin-top: 15px;
} }