From a06710fc33672ea224e5118198c7162109c528fb Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 1 Mar 2014 18:29:12 +0000 Subject: Fix workstation icon on the rooms --- src/leaflet-soton.css | 6 ++++++ src/leaflet-soton.js | 24 +++++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/leaflet-soton.css b/src/leaflet-soton.css index 2bf18c2..a464a5f 100644 --- a/src/leaflet-soton.css +++ b/src/leaflet-soton.css @@ -32,6 +32,12 @@ font-size: 23px; } +.ls-workstationicon-small { + width: 32px; + height: 32px; + text-align: center; +} + #ls-dynamicContentWrapper { background: white; min-height: 100%; diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js index f90256d..08f29b2 100644 --- a/src/leaflet-soton.js +++ b/src/leaflet-soton.js @@ -484,11 +484,29 @@ SELECT * WHERE {\ if (partWorkstation) { if (partWorkstation.feature in workstationData) { - var workstationIcon = '
'; + var state = workstationData[partWorkstation.feature]; - var freeSeats = workstationData[partWorkstation.feature].free_seats; + var closed = (state.status.indexOf("closed") !== -1) - workstationIcon += freeSeats + "
"; + var image; + var workstationIcon; + + if (!closed) { + image = 'workstation-group.png'; + workstationIcon = '
'; + } else { + image = 'workstation-closed.png'; + workstationIcon = '
'; + } + + if (!closed) { + workstationIcon += '
'; + + var freeSeats = state.free_seats; + workstationIcon += freeSeats + "
"; + } + + workstationIcon += '
'; content = workstationIcon + content; } else { -- cgit v1.2.3