Updated homepage and added incident detail page

Widened the site/service column on homepage to allow for longer site names.

Added page for incident, modified link on status page to link to incident history.

Signed-off-by: Nathan Booth <nath.booth@gmail.com>
This commit is contained in:
Nathan Booth
2011-12-30 20:34:47 +00:00
parent 4e8aa99803
commit 1fe73f3426
6 changed files with 102 additions and 12 deletions

View File

@@ -112,7 +112,6 @@ div.incident {
table{
background:#fff;
table-layout:fixed;
}
table th, table td {

View File

@@ -0,0 +1,39 @@
<?php
$main = StatusBoard_Main::instance();
$request = $main->request();
$auth = $main->auth();
$incident_id = $request->get('id', 'Sihnon_Exception_InvalidParameters');
try
{
$incident = StatusBoard_Incident::fromId($incident_id);
$site_id = $incident->site;
$site = StatusBoard_Site::fromId($site_id);
$service_id = $site->service;
$service = StatusBoard_Service::fromId($service_id);
}
catch (Sihnon_Exception_ResultCountMismatch $e)
{
throw new StatusBoard_Exception_FileNotFound();
}
$statuses = $incident->statusChanges();
$this->smarty->assign('service', $service);
$this->smarty->assign('site', $site);
$this->smarty->assign('incident', $incident);
$this->smarty->assign('statuses', $statuses);
$this->smarty->assign('messages', $messages);
$display_admin_links = ($auth->isAuthenticated() && $auth->isAdministrator());
$this->smarty->assign('display_admin_links', $display_admin_links);
?>

View File

@@ -144,7 +144,7 @@
</div><!--/Row for Existing Service-->
<div class="row"><!--Row for New Service-->
<div class="span4 column"><!--New Service description-->
<h3>Add New Service</h3>
<h3> New Service</h3>
<p>Use this form to define a new service</p>
</div><!--/New Service description-->
<div class="span11 column"><!--Add New Service -->

View File

@@ -4,19 +4,19 @@
<h2>{$site_title}</h2>
</div>
<div class="span2">
<a href="{$base_uri}admin/add-incident/" class="btn small">Add Incident</a>
{if $display_admin_links}<a href="{$base_uri}admin/add-incident/" class="btn small">Add Incident</a>{/if}
</div>
</div>
<table class="bordered-table">
<thead>
<tr>
<th>Service</th>
<th class="status">Now</th>
<th width="200px">Service / Site</th>
<th class="status" width="50px">Now</th>
{foreach from=array(0,1,2,3,4,5,6) item=day}
{if $day == 0}
<th class="status">Today</th>
<th class="status" width="50px">Today</th>
{else}
<th class="status">{mktime(0,0,0,date("n"),date("j")-$day)|date_format:"M j"}</th>
<th class="status" width="50px">{mktime(0,0,0,date("n"),date("j")-$day)|date_format:"M j"}</th>
{/if}
{/foreach}
</tr>

View File

@@ -0,0 +1,56 @@
<div class="container">
<div class="row">
<div class="span16"><!--name content container -->
<h1>Incident History: {$incident->reference|escape:html}</h1>
<div class="rounded_content">
<div class="row">
<div class="span13 column">
<p>This page details the history of incident: {$incident->reference|escape:html}</p>
</div>
<div class="span2 column">
{if $display_admin_links}<button class='btn small primary' onclick="document.location.href='{$base_uri}admin/incident/service/{$service->id}/site/{$site->id}/id/{$incident->id}/';return false;">Edit Incident</button>{/if}
</div>
</div>
<div class="row">
<div class="span4 column">
<h3>Incident Details</h3>
<p></p>
</div>
<div class="span11 column">
<p style="padding-top:10px;"><b>Service:</b> {$service->name|escape:html}</p>
<p><b>Site:</b> {$site->name|escape:html}</p>
<p><b>Opened:</b> {$incident->start_time|date_format:'h:i:s y-m-d'}</p>
<p><b>Estimated End:</b> {$incident->estimated_end_time|date_format:'h:i:s y-m-d'}</p>
</div>
</div>
<div class="row">
<div class="span4 column">
<h3>Status Changes</h3>
<p>The table display an audit log of changes to this incident</p>
</div><!--/New Service description-->
<div class="span11 column">
<table>
<thead>
<th>Date/Time</th>
<th>Status</th>
<th>Description</th>
</thead>
<tbody>
{foreach from=$statuses item=status}
<tr>
<td>
{StatusBoard_DateTime::fuzzyTime($status->ctime)}<br />
<em>{$status->ctime|date_format:'y-m-d h:i:s'}</em>
</td>
<td>{StatusBoard_Status::name($status->status)}</td>
<td>{$status->description|escape:html}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>
</div>

View File

@@ -73,11 +73,7 @@
{foreach from=$incidentsDuring item=incident}
<tr>
<td>
{if $display_admin_links && $incident->currentStatus() != StatusBoard_Status::STATUS_Resolved}
<a href="{$base_uri}admin/incident/service/{$service->id}/site/{$site->id}/id/{$incident->id}/" title="Edit {$incident->reference|escape:html}">{$incident->reference|escape:html}</a>
{else}
{$incident->reference|escape:html}
{/if}
<a href="{$base_uri}incident/id/{$incident->id}/" title="Indident History">{$incident->reference|escape:html}</a>
</td>
<td>{$incident->description|truncate|escape:html}</td>
<td>{date('d-M H:i', $incident->start_time)}</td>