From ab825994f13821891559a749f0b9d4c46a4fb1f6 Mon Sep 17 00:00:00 2001 From: Nico von Geyso Date: Thu, 23 May 2013 15:06:32 +0200 Subject: Refactored: index page --- htdocs/static/css/custom.css | 29 ++++++++++-- .../archlinux-logo-dark-1200dpi.b42bd35d5916.png | Bin 0 -> 260724 bytes htdocs/static/img/archlinux.png | Bin 0 -> 97347 bytes htdocs/static/img/debian.png | Bin 0 -> 1444 bytes htdocs/static/img/gentoo.png | Bin 0 -> 8781 bytes htdocs/static/img/openbsd.png | Bin 0 -> 14227 bytes htdocs/static/img/unknown.png | Bin 0 -> 1058 bytes render.py | 6 +-- templates/index.html | 51 ++++++++++++++++----- utils.py | 14 ++++++ 10 files changed, 79 insertions(+), 21 deletions(-) create mode 100644 htdocs/static/img/archlinux-logo-dark-1200dpi.b42bd35d5916.png create mode 100644 htdocs/static/img/archlinux.png create mode 100644 htdocs/static/img/debian.png create mode 100644 htdocs/static/img/gentoo.png create mode 100644 htdocs/static/img/openbsd.png create mode 100644 htdocs/static/img/unknown.png create mode 100644 utils.py diff --git a/htdocs/static/css/custom.css b/htdocs/static/css/custom.css index 620c6db..1d990d7 100644 --- a/htdocs/static/css/custom.css +++ b/htdocs/static/css/custom.css @@ -13,15 +13,24 @@ h1 { } #hostlist .list li { + clear: both; list-style-type: none; - text-align: center; - margin-top: 20px; - display: table; + margin-bottom: 50px; +} + +#hostlist .logo img { + padding-top: 15px; + width: 50px; +} + +.thumbnail { + padding: 10px; +} +.thumbnail:hover { + border-color: #999; } #hostlist .list li a { - height: 100px; - display: table-cell; vertical-align: middle; } @@ -31,12 +40,22 @@ h1 { text-decoration: none; } +#hostlist .ips { + margin: 0px; +} + +#hostlist .ips li { + display: inline; + color: #999; +} + td.centering, p.centering { text-align: center; } .searchbox { margin-top: 2em; + margin-bottom: 1em; } table.tablesorter .header:after { diff --git a/htdocs/static/img/archlinux-logo-dark-1200dpi.b42bd35d5916.png b/htdocs/static/img/archlinux-logo-dark-1200dpi.b42bd35d5916.png new file mode 100644 index 0000000..62eeba1 Binary files /dev/null and b/htdocs/static/img/archlinux-logo-dark-1200dpi.b42bd35d5916.png differ diff --git a/htdocs/static/img/archlinux.png b/htdocs/static/img/archlinux.png new file mode 100644 index 0000000..279b656 Binary files /dev/null and b/htdocs/static/img/archlinux.png differ diff --git a/htdocs/static/img/debian.png b/htdocs/static/img/debian.png new file mode 100644 index 0000000..ee04572 Binary files /dev/null and b/htdocs/static/img/debian.png differ diff --git a/htdocs/static/img/gentoo.png b/htdocs/static/img/gentoo.png new file mode 100644 index 0000000..8938831 Binary files /dev/null and b/htdocs/static/img/gentoo.png differ diff --git a/htdocs/static/img/openbsd.png b/htdocs/static/img/openbsd.png new file mode 100644 index 0000000..dbb6eb9 Binary files /dev/null and b/htdocs/static/img/openbsd.png differ diff --git a/htdocs/static/img/unknown.png b/htdocs/static/img/unknown.png new file mode 100644 index 0000000..100e14a Binary files /dev/null and b/htdocs/static/img/unknown.png differ diff --git a/render.py b/render.py index 3e1d215..be2bfef 100644 --- a/render.py +++ b/render.py @@ -4,18 +4,16 @@ import yaml import os import jinja2 import optparse +from utils import filters class Renderer: def __init__(self, output_dir): self.env = jinja2.Environment( loader = jinja2.FileSystemLoader('./templates')) - self.env.filters['select_with_attribute'] = self.select_with_attribute + self.env.filters.update(filters) self.output_dir = output_dir self.templates = {} - def select_with_attribute(self, iterable, attribute, result=True): - return [value for value in iterable if (attribute in value) == result] - def _render(self, template, filename, **kwargs): if template not in self.templates: self.templates[template] = self.env.get_template(template) diff --git a/templates/index.html b/templates/index.html index ebc2408..9681fad 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,19 +3,46 @@ {% block content %}

Hostinfo

-
-