cvs: php-bugs-web / milestone.php style.css

From: Date: Mon, 10 Oct 2005 03:36:56 +0000
Subject: cvs: php-bugs-web / milestone.php style.css
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-29549@lists.php.net to get a copy of this message
magnus Sun Oct 9 23:36:56 2005 EDT Modified files: /php-bugs-web style.css milestone.php Log: Change colors, I'm color blind but what the heck. Split closed and open bugs and add color codes (red = todo, green = done) for them. http://cvs.php.net/diff.php/php-bugs-web/style.css?r1=1.22&r2=1.23&ty=u Index: php-bugs-web/style.css diff -u php-bugs-web/style.css:1.22 php-bugs-web/style.css:1.23 --- php-bugs-web/style.css:1.22 Sun Oct 9 19:02:58 2005 +++ php-bugs-web/style.css Sun Oct 9 23:36:54 2005 @@ -199,10 +199,21 @@ background: #eee; } +table.milestone { + border-spacing: 0px; + border-left: 0px; +} + table.milestone th { text-align: center; } -table.milestone td { - background: #ccc; +table.milestone td.color1 { + background: #abc; + border-left: 2px solid #fff; +} + +table.milestone td.color2 { + background: #cde; + border-left: 2px solid #fff; } http://cvs.php.net/diff.php/php-bugs-web/milestone.php?r1=1.1&r2=1.2&ty=u Index: php-bugs-web/milestone.php diff -u php-bugs-web/milestone.php:1.1 php-bugs-web/milestone.php:1.2 --- php-bugs-web/milestone.php:1.1 Sun Oct 9 19:02:58 2005 +++ php-bugs-web/milestone.php Sun Oct 9 23:36:54 2005 @@ -22,11 +22,12 @@ $milestones = array(); -static $closed_status = array('Closed', 'Bogus'); +static $closed_status = array('Closed', 'Bogus', 'Wont Fix'); $res = mysql_query("SELECT id, name from bugdb_milestones order by name"); while (($row = mysql_fetch_assoc($res))) { - $bugs = array(); + $closed_bugs = array(); + $open_bugs = array(); $closed = 0; $milestone = $row['name']; @@ -34,32 +35,69 @@ $id = (int)$row['id']; $q = mysql_query("SELECT id, bug_type, sdesc, status, assign from bugdb where milestone_id=$id"); while (($row = mysql_fetch_assoc($q))) { - $bugs[] = $row; - $closed += in_array($row['status'], $closed_status); + if (in_array($row['status'], $closed_status)) { + $closed_bugs[] = $row; + $closed++; + } else { + $open_bugs[] = $row; + } } - if (count($bugs)) - $pct = $closed / count($bugs) * 100; + if (count($open_bugs)) + $pct = round($closed / (count($open_bugs) + $closed) * 100); else $pct = 100; echo "<h1>Milestone: " . htmlspecialchars($milestone) . " [$pct %]</h1>"; - if (count($bugs)) { + if (count($open_bugs) || $closed) { echo "<table class=\"milestone\">"; - echo "<tr><th>ID#</th><th>Type</th><th>Status</th><th>Summary</th><th>Assigned</th></tr>"; + echo "<tr><th>Todo </th><th>ID#</th><th>Type</th><th>Status</th><th>Summary</th><th>Assigned</th></tr>"; + $color = 0; + foreach ($open_bugs as $row) { + if (!$color) { + $class = 'color1'; + $color++; + } else { + $class = 'color2'; + $color--; + } + + echo "<tr>"; + echo "<td style=\"background: #a00;\">&nbsp;</td>"; + echo "<td class=\"$class\"><a href=\"bug.php?id=$row[id]\">$row[id]</a></td>"; + echo "<td class=\"$class\">" . htmlspecialchars($row['bug_type']) . "</td>"; + echo "<td class=\"$class\">" . htmlspecialchars($row['status']) . "</td>"; + echo "<td class=\"$class\">" . htmlspecialchars($row['sdesc']) . "</td>"; + echo "<td class=\"$class\">" . htmlspecialchars($row['assign']) . "</td>"; + echo "</tr>"; + } + + echo "<tr><td colspan=\"6\" style=\"background-color: transparent; border: 0px;\">&nbsp;</tr>"; + + echo "<tr><th>Done </th><th>ID#</th><th>Type</th><th>Status</th><th>Summary</th><th>Assigned</th></tr>"; + $color = 0; + foreach ($closed_bugs as $row) { + if (!$color) { + $class = 'color1'; + $color++; + } else { + $class = 'color2'; + $color--; + } - foreach ($bugs as $row) { echo "<tr>"; - echo "<td><a href=\"bug.php?id=$row[id]\">$row[id]</a></td>"; - echo "<td>" . htmlspecialchars($row['bug_type']) . "</td>"; - echo "<td>" . htmlspecialchars($row['status']) . "</td>"; - echo "<td>" . htmlspecialchars($row['sdesc']) . "</td>"; - echo "<td>" . htmlspecialchars($row['assign']) . "</td>"; + echo "<td style=\"background: #0a0;\">&nbsp;</td>"; + echo "<td class=\"$class\"><a href=\"bug.php?id=$row[id]\">$row[id]</a></td>"; + echo "<td class=\"$class\">" . htmlspecialchars($row['bug_type']) . "</td>"; + echo "<td class=\"$class\">" . htmlspecialchars($row['status']) . "</td>"; + echo "<td class=\"$class\">" . htmlspecialchars($row['sdesc']) . "</td>"; + echo "<td class=\"$class\">" . htmlspecialchars($row['assign']) . "</td>"; echo "</tr>"; } + echo "</table>"; } echo "<br/>";

« previous php.mirrors (#29549) next »