From 95d1bcd28e53504b4822c24d14b3f5a7134b5e8e Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Sat, 17 Dec 2011 01:04:05 +0000 Subject: [PATCH] Add basic service/site/incident listings to the homepage. Basic functionality to serve as a test case for core class development. --- public/styles/normal.css | 16 ++++++++++++++++ source/webui/pages/home.php | 7 +++++++ source/webui/templates/home.tpl | 21 ++++++++++++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 source/webui/pages/home.php diff --git a/public/styles/normal.css b/public/styles/normal.css index 9f4e8eb..e28ef70 100644 --- a/public/styles/normal.css +++ b/public/styles/normal.css @@ -89,4 +89,20 @@ label { background: lightcyan; color: darkblue; margin: 1em; +} + +/** + * Page specific content + */ + +div.service { + border-top: 1px solid grey; +} + +div.site { + margin-left: 5em; +} + +div.incident { + margin-left: 2em; } \ No newline at end of file diff --git a/source/webui/pages/home.php b/source/webui/pages/home.php new file mode 100644 index 0000000..7d6468e --- /dev/null +++ b/source/webui/pages/home.php @@ -0,0 +1,7 @@ +smarty->assign('services', $services); + +?> \ No newline at end of file diff --git a/source/webui/templates/home.tpl b/source/webui/templates/home.tpl index 30404ce..93649b4 100644 --- a/source/webui/templates/home.tpl +++ b/source/webui/templates/home.tpl @@ -1 +1,20 @@ -TODO \ No newline at end of file +
+ {foreach from=$services item=service} +
+ {$service->name()} + {foreach from=$service->sites() item=site} + {assign var=incidents value=$site->incidents_open()} +
+ {$site->name()} ({$incidents|count}) + {foreach from=$incidents item=incident} +
+ {$incident->description()} +
+ {/foreach} +
+ {foreachelse} + + {/foreach} +
+ {/foreach} +