From 4adecf0fa7ee7b96a3dda7379244e9a920a5b528 Mon Sep 17 00:00:00 2001 From: Florian Date: Tue, 18 Sep 2012 20:30:44 +0200 Subject: show status image in website header --- public/img/status-closed.png | Bin 0 -> 6893 bytes public/img/status-open.png | Bin 0 -> 6267 bytes public/img/status-unknown.png | Bin 0 -> 6081 bytes scripts/status_script.py | 17 +++++++++++++---- template/template/template.html | 3 +-- 5 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 public/img/status-closed.png create mode 100644 public/img/status-open.png create mode 100644 public/img/status-unknown.png diff --git a/public/img/status-closed.png b/public/img/status-closed.png new file mode 100644 index 0000000..80021c3 Binary files /dev/null and b/public/img/status-closed.png differ diff --git a/public/img/status-open.png b/public/img/status-open.png new file mode 100644 index 0000000..712b36c Binary files /dev/null and b/public/img/status-open.png differ diff --git a/public/img/status-unknown.png b/public/img/status-unknown.png new file mode 100644 index 0000000..26f04d0 Binary files /dev/null and b/public/img/status-unknown.png differ diff --git a/scripts/status_script.py b/scripts/status_script.py index 1c229e0..8881735 100755 --- a/scripts/status_script.py +++ b/scripts/status_script.py @@ -31,21 +31,30 @@ class SublabStatus(object): if __name__ == '__main__': s = SublabStatus() if s.door_status() == 'open': - colors = ('#0f0', '#222') + colors = ('#0f0', '#222', 'status-open.png') elif s.door_status() == 'closed': - colors = ('#222', '#f00') + colors = ('#222', '#f00', 'status-closed.png') else: - colors = ('#222', '#222') + colors = ('#222', '#222', 'status-unknown.png') css = ''' span.sublabopen { color: %s; } - span.sublabclosed { color: %s; } + +#statusimage { + background: url(../img/%s) ; + height: 100px; + width: 100px; + position: absolute; + right: 20px; +} + + ''' % colors path = os.path.realpath(os.path.dirname(__file__)) diff --git a/template/template/template.html b/template/template/template.html index 8f502f8..a2f8b78 100644 --- a/template/template/template.html +++ b/template/template/template.html @@ -20,7 +20,6 @@ - @@ -36,7 +35,7 @@

[ mate und technik ]

- +

Das sublab - ein Hackerspace in Leipzig

-- cgit v1.2.1