Add a "today" column to the Staus Board

This commit is contained in:
2011-12-21 14:14:08 +00:00
parent 10001c5012
commit e527a7db8e
2 changed files with 10 additions and 12 deletions

View File

@@ -1,12 +1,6 @@
<?php
$services = StatusBoard_Service::all();
for ($i = 1; $i <= 6; ++$i){
$tbl_header_date[] = date("M. d", strtotime("-{$i}day"));
}
$this->smarty->assign('days', $tbl_header_date);
$this->smarty->assign('services', $services);
$this->smarty->assign('requested_page', $this->page);
?>

View File

@@ -4,15 +4,19 @@
<tr>
<th>Service</th>
<th class="status">Now</th>
{foreach from=$days key="ind" item="day"}
<th class="status">{$day}</th>
{foreach from=array(0,1,2,3,4,5,6) item=day}
{if $day == 0}
<th class="status">Today</th>
{else}
<th class="status">{mktime(0,0,0,date("n"),date("j")-$day)|date_format:"M j"}</th>
{/if}
{/foreach}
</tr>
</thead>
<tbody>
{foreach from=$services item=service}
<tr>
<th colspan="8" class="service">
<th colspan="9" class="service">
{$service->name}
</th>
</tr>
@@ -26,9 +30,9 @@
{$status=$site->status()}
{include file="fragments/site-status.tpl" nocache start=null end=null}
</td>
{foreach from=array(1,2,3,4,5,6) item=day}
{$start=mktime(0,0,0,date("n"),date("j")-$day-1)}
{$end=mktime(0,0,0,date("n"),date("j")-$day)}
{foreach from=array(0,1,2,3,4,5,6) item=day}
{$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)}
{$statusDuring=StatusBoard_Incident::highestSeverityStatus($incidentsDuring, $end)}
<td>