Make seen reports visible, widgetize tables

This commit is contained in:
Latif Khalifa
2013-10-11 10:37:55 +02:00
parent 73c10e7e3b
commit 2f4164b3b7
3 changed files with 44 additions and 37 deletions

View File

@@ -4,6 +4,11 @@ define("SITE_ROOT", realpath(dirname(__file__)));
require_once SITE_ROOT . "/lib/init.php";
$S->requireUser();
function lk($id, $txt)
{
echo '<a href="'. URL_ROOT . '/report_detail.php?id=' . $id . '">' . htmlentities($txt) . '</a>';
}
$filter = new SearchFilter();
$total = CrashReport::getTotal($filter);
$reports = CrashReport::getReports($filter);
@@ -23,12 +28,12 @@ $filter->render();
<th>Grid (region)</th>
</tr>
<?php for ($i=0; $i<count($reports); $i++): ?>
<tr class="rowhighlight hand" onclick="window.location.href='report_detail?id=<?php echo $reports[$i]->id ?>'">
<td><?php echo (int)$reports[$i]->id ?></td>
<td><?php echo htmlspecialchars($reports[$i]->client_channel . " " . $reports[$i]->client_version) ?></td>
<td><?php echo htmlspecialchars($reports[$i]->os) ?></td>
<td><?php echo htmlspecialchars($reports[$i]->gpu) ?></td>
<td><?php echo htmlspecialchars($reports[$i]->grid . " (" . $reports[$i]->region . ")") ?></td>
<tr class="rowhighlight">
<td><?php lk($reports[$i]->id, $reports[$i]->id) ?></td>
<td><?php lk($reports[$i]->id, $reports[$i]->client_channel . " " . $reports[$i]->client_version) ?></td>
<td><?php lk($reports[$i]->id, $reports[$i]->os) ?></td>
<td><?php lk($reports[$i]->id, $reports[$i]->gpu) ?></td>
<td><?php lk($reports[$i]->id, $reports[$i]->grid . " (" . $reports[$i]->region . ")") ?></td>
</tr>
<?php endfor ?>
</table>

View File

@@ -47,6 +47,30 @@ td, th {
border: none;
}
tr.rowhighlight a {
display: block;
width: 100%;
height: 100%;
}
table.jtable tr:hover, table.jtable th {
background: #2b3233 url(images/ui-bg_highlight-hard_20_2b3233_1x100.png) 50% 50% repeat-x;
color: #ffffff;
}
table.jtable {
border-spacing: 0px;
border-collapse:collapse;
border: 1px solid #555555;
background: #1e1e1e url(images/ui-bg_flat_25_1e1e1e_40x100.png) 50% 50% repeat-x;
color: #c5c5c5;
}
table.jtable a:visited {
color: #888;
}
.hand {
cursor: pointer;
}
@@ -57,7 +81,3 @@ pre {
white-space: pre-wrap;
word-wrap: break-word;
}
.jtable tr .ui-state-hover {
font-weight: normal;
}

View File

@@ -109,8 +109,8 @@ class Layout
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="<?php print URL_ROOT ?>/css/singularity/jquery-ui-1.10.3.custom.min.css"/>
<link rel="stylesheet" type="text/css" href="<?php print URL_ROOT ?>/singularity.css"/>
<link rel="stylesheet" type="text/css" href="<?php print URL_ROOT ?>/css/singularity/jquery-ui-1.10.3.custom.css"/>
<link rel="stylesheet" type="text/css" href="<?php print URL_ROOT ?>/css/singularity/singularity.css"/>
<link rel="shortcut icon" href="<?php print IMG_ROOT ?>/favicon.ico" type="image/x-icon" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
@@ -120,32 +120,14 @@ class Layout
//<![CDATA[
$(function() {
$( ".toolbarbutton" ).button();
$( ".rowhighlight" )
/*
$( ".rowhighlight" ).on("mousedown", function(e) {
$(this).addClass("ui-state-disabled");
});
*/
});
$().ready(function(){
$(".jtable th").each(function(){
$(this).addClass("ui-widget-header");
});
$(".jtable td").each(function(){
$(this).addClass("ui-widget-content");
});
$(".jtable tr").hover(
function()
{
$(this).children("td").addClass("ui-state-hover");
},
function()
{
$(this).children("td").removeClass("ui-state-hover");
}
);
});
//]]>
</script>