Backed and Gui coding for site status page, made the hyperlink on homepage link correctly to status

Signed-off-by: Nathan Booth <nath.booth@gmail.com>
This commit is contained in:
Nathan Booth
2011-12-21 21:24:16 +00:00
parent 2aa20ddb64
commit b6e20e2203
3 changed files with 103 additions and 77 deletions

View File

@@ -1,6 +1,19 @@
<?php
$main = StatusBoard_Main::instance();
$request = $main->request();
$service_id = $request->get('service', 'Sihnon_Exception_InvalidParameters');
$site_id = $request->get('id', 'Sihnon_Exception_InvalidParameters');
$service = null;
$site = null;
try {
$service = StatusBoard_Service::fromId($service_id);
$site = StatusBoard_Site::fromId($site_id);
} catch (Sihnon_Exception_ResultCountMismatch $e) {
throw new StatusBoard_Exception_FileNotFound();
}
$services = StatusBoard_Service::all();
$this->smarty->assign('services', $services);
$this->smarty->assign('service', $service);
$this->smarty->assign('site', $site);
?>

View File

@@ -15,6 +15,6 @@
{assign var=img_src value="{$base_uri}images/Status_Icons/cross-circle.png"}
{/case}
{/switch}
<a href="{$base_uri}site/id/{$site->id}/{if $start}start/{$start}/{/if}{if $end}end/{$end}/{/if}" class="" rel="popover" data-content="{include file="fragments/site-status-details.tpl"}" data-original-title="{StatusBoard_Status::name($status)|escape:html}">
<a href="{$base_uri}status/service/{$service->id}/id/{$site->id}/{if $start}start/{$start}/{/if}{if $end}end/{$end}/{/if}" class="" rel="popover" data-content="{include file="fragments/site-status-details.tpl"}" data-original-title="{StatusBoard_Status::name($status)|escape:html}">
<img src="{$img_src}" />
</a>

View File

@@ -1,8 +1,8 @@
<div class="container">
<div class="row">
<div class="span16" name="name"><!--name content container -->
<h1>Site Status History {$service->name|escape:html}-{$site->name|escape:html}</h1>
<p>This page details the incident history for a Site related to a Service</p>
<h1>Site Status History: {$service->name|escape:html} - {$site->name|escape:html}</h1>
<p>This page details the incident history for a site</p>
{foreach from=array(0,1,2,3,4,5,6) item=day}
{if $day == 0}
<div class="row" name="edit service">
@@ -10,8 +10,11 @@
<h3 class="status">Today {mktime(0,0,0,date("n"),date("j"))|date_format:"d M Y"}</h3>
<p>x incidents</p>
</div>
<div class="span12 column">
{$start=mktime(0,0,0,date("n"),date("j")-$day)}
{$end=mktime(0,0,0,date("n"),date("j")-$day+1)}
{$incidentsDuring=$site->openIncidentsDuring($start, $end)}
{if $incidentsDuring}
<table class="bordered-table" name="sites_list_table"><!--Services table -->
<thead>
<th>Incident</th>
@@ -21,19 +24,23 @@
<th>Time Closed</th>
</thead>
<tbody>
{foreach from=$incidentsDuring item=incident}
<tr>
<td>123456</td>
<td>Loss of power on remote site</td>
<td>14:00</td>
<td>Major Incident</td>
<td>-</td>
</tr><tr>
<td>123457</td>
<td>Loss of power on remote site</td>
<td>14:00</td>
<td>Major Incident</td>
<td>-</td>
<td>{$incident->reference|escape:html}</td>
<td>{$incident->description|truncate|escape:html}</td>
<td>{date('d-M H:i', $incident->start_time)}</td>
<td>{StatusBoard_Status::name($incident->currentStatus())}</td>
<td>{if $incident->actual_end_time}
{date('d-M H:i', $incident->actual_end_time)}
{else}
Still Open
{/if}
</td>
</tr>
{/foreach}
{else}
<h4>There were no recorded incidents on this day</h4>
{/if}
</tbody>
</table><!--/name table -->
</div>
@@ -44,8 +51,11 @@
<h3 class="status">{mktime(0,0,0,date("n"),date("j")-$day)|date_format:"d M Y"}</h3>
<p>x incidents</p>
</div>
<div class="span12 column">
{$start=mktime(0,0,0,date("n"),date("j")-$day)}
{$end=mktime(0,0,0,date("n"),date("j")-$day+1)}
{$incidentsDuring=$site->openIncidentsDuring($start, $end)}
{if $incidentsDuring}
<table class="bordered-table" name="sites_list_table"><!--Services table -->
<thead>
<th>Incident</th>
@@ -55,25 +65,28 @@
<th>Time Closed</th>
</thead>
<tbody>
{foreach from=$incidentsDuring item=incident}
<tr>
<td>123456</td>
<td>Loss of power on remote site</td>
<td>14:00</td>
<td>Major Incident</td>
<td>-</td>
</tr><tr>
<td>123457</td>
<td>Loss of power on remote site</td>
<td>14:00</td>
<td>Major Incident</td>
<td>-</td>
<td>{$incident->reference|escape:html}</td>
<td>{$incident->description|truncate|escape:html}</td>
<td>{date('d-M H:i', $incident->start_time)}</td>
<td>{StatusBoard_Status::name($incident->currentStatus())}</td>
<td>{if $incident->actual_end_time}
{date('d-M H:i', $incident->actual_end_time)}
{else}
Still Open
{/if}
</tr>
{/foreach}
{else}
<h4>There were no recorded incidents on this day</h4>
{/if}
</tbody>
</table><!--/name table -->
</div>
</div>
{/if}
{/foreach}
</div>
</div>
</div>