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 <?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(); $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"} {assign var=img_src value="{$base_uri}images/Status_Icons/cross-circle.png"}
{/case} {/case}
{/switch} {/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}" /> <img src="{$img_src}" />
</a> </a>

View File

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