From 378d524fbd7687e577f5e9c4be5e0726435b2bad Mon Sep 17 00:00:00 2001 From: Jan-Philipp Litza Date: Fri, 28 Dec 2012 03:27:08 +0100 Subject: polished the table view by offloading "is this shift free" to SQL. Might put too much load on db server, need to evaluate. Also, replaced loads of & with & and simplified some expressions --- public/css/base.css | 14 ++++++++++++++ public/css/scrolltable.js | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'public') diff --git a/public/css/base.css b/public/css/base.css index 6bcb95d1..0f37c8f0 100644 --- a/public/css/base.css +++ b/public/css/base.css @@ -112,6 +112,18 @@ table { background-color: #fff; } +#shifts td.free { + background-color: #F6CECE; +} + +#shifts td.occupied { + background-color: #BCF5A9; +} + +#shifts td:not(.free):not(.occupied) { + border: 0; +} + table.scrollable { max-width: 100%; overflow-x: scroll; @@ -170,6 +182,8 @@ fieldset p label input { th { background: #f0f0f0; +} +thead th { vertical-align: bottom; } diff --git a/public/css/scrolltable.js b/public/css/scrolltable.js index 1184207f..1319495c 100644 --- a/public/css/scrolltable.js +++ b/public/css/scrolltable.js @@ -12,7 +12,7 @@ function scrolltable(elem) { elem.className = elem.className + ' scrollable'; var tbodywidth = widths.pop(); tbody.style.width = (tbodywidth + 16) + 'px'; - tbody.style.height = (window.innerHeight - 50) + 'px'; + tbody.style.height = (window.innerHeight - 100) + 'px'; for(var i = 0; i < ths.length; i++) { var paddingLeft = parseInt(window.getComputedStyle(ths[i], null).getPropertyValue('padding-left')); var paddingRight = parseInt(window.getComputedStyle(ths[i], null).getPropertyValue('padding-right')); -- cgit v1.2.3-54-g00ecf