Overhaul trusted user proposal page to match archweb

* Change all boxes and other CSS to match archweb
* General fixups in XHTML formatting
* Change results table to match color scheme everywhere else

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
canyonknight 2012-05-23 13:49:43 -04:00 committed by Lukas Fleischer
parent d2480e8b9d
commit af8f60fe7f
3 changed files with 137 additions and 137 deletions

View file

@ -154,17 +154,20 @@ if ($atype == "Trusted User" || $atype == "Developer") {
$qnext = "SELECT ID FROM TU_VoteInfo"; $qnext = "SELECT ID FROM TU_VoteInfo";
$nextresult = db_query($qnext, $dbh); $nextresult = db_query($qnext, $dbh);
?> ?>
<div class="pgbox"> <div class="box">
<p><a href='addvote.php'><?php print __("Add Proposal") ?></a></p> <p><a href="addvote.php"><?php print __("Add Proposal") ?></a></p>
<?php if (mysql_num_rows($result)) { $by = htmlentities($by, ENT_QUOTES); ?> <?php if (mysql_num_rows($result)):
<?php if ($off != 0) { $back = (($off - $limit) <= 0) ? 0 : $off - $limit; ?> $by = htmlentities($by, ENT_QUOTES); ?>
<?php if ($off != 0):
$back = (($off - $limit) <= 0) ? 0 : $off - $limit; ?>
<a href='tu.php?off=<?php print $back ?>&amp;by=<?php print $by ?>'><?php print __("Back") ?></a> <a href='tu.php?off=<?php print $back ?>&amp;by=<?php print $by ?>'><?php print __("Back") ?></a>
<?php } ?> <?php endif; ?>
<?php if (($off + $limit) < mysql_num_rows($nextresult)) { $forw = $off + $limit; ?> <?php if (($off + $limit) < mysql_num_rows($nextresult)):
<a href='tu.php?off=<?php print $forw ?>&amp;by=<?php print $by ?>'><?php print __("Next") ?></a> $forw = $off + $limit; ?>
<?php } ?> <a href="tu.php?off=<?php print $forw ?>&amp;by=<?php print $by ?>"><?php print __("Next") ?></a>
<?php } ?> <?php endif; ?>
<?php endif; ?>
</div> </div>
<?php <?php
} }

View file

@ -1,76 +1,75 @@
<div class="pgbox"> <div class="box">
<h2><?php print __("Proposal Details") ?></h2> <h2><?php print __("Proposal Details") ?></h2>
<div class="pgboxbody">
<?php <?php if ($isrunning == 1): ?>
if ($isrunning == 1) { ?> <p style="font-weight: bold; color: red">
<p style='font-weight: bold; color: red'>
<?php print __("This vote is still running.") ?> <?php print __("This vote is still running.") ?>
</p> </p>
<?php <?php endif; ?>
} ?>
<p> <p>
<?php echo __('User') ?>: <b> <?php echo __("User") ?>:
<?php if (!empty($row['User'])) { ?> <b>
<a href='packages.php?K=<?php print $row['User'] ?>&amp;SeB=m'><?php print $row['User'] ?></a> <?php if (!empty($row['User'])): ?>
<?php } else { ?> <a href="packages.php?K=<?php print $row['User'] ?>&amp;SeB=m"><?php print $row['User'] ?></a>
<?php else: ?>
N/A N/A
<?php } ?> <?php endif; ?>
</b><br /> </b>
<?php print __("Submitted: %s by %s", "<b>" . gmdate("Y-m-d H:i", $row['Submitted']) . "</b>", "<b>" . username_from_id($row['SubmitterID']) . "</b>") ?><br /> <br />
<?php print __('End') ?>: <b><?php print gmdate("Y-m-d H:i", $row['End']) ?></b></p> <?php print __("Submitted: %s by %s", "<b>" . gmdate("Y-m-d H:i", $row['Submitted']) . "</b>", "<b>" . username_from_id($row['SubmitterID']) . "</b>") ?>
<br />
<?php print __("End") ?>:
<b><?php print gmdate("Y-m-d H:i", $row['End']) ?></b>
</p>
<p> <p>
<?php print str_replace("\n", "<br />\n", htmlspecialchars($row['Agenda'])) ?> <?php print str_replace("\n", "<br />\n", htmlspecialchars($row['Agenda'])) ?>
</p> </p>
<table class="boxSoft"> <table>
<tr> <tr>
<th class='boxSoftTitle'><span class='f2'><?php print __("Yes") ?></span></th> <th><?php print __("Yes") ?></th>
<th class='boxSoftTitle'><span class='f2'><?php print __("No") ?></span></th> <th><?php print __("No") ?></th>
<th class='boxSoftTitle'><span class='f2'><?php print __("Abstain") ?></span></th> <th><?php print __("Abstain") ?></th>
<th class='boxSoftTitle'><span class='f2'><?php print __("Total") ?></span></th> <th><?php print __("Total") ?></th>
<th class='boxSoftTitle'><span class='f2'><?php print __('Voted') ?></span></th> <th><?php print __('Voted') ?></th>
</tr> </tr>
<tr> <tr>
<td class='data1'><span class='f5'><span class='blue'><?php print $row['Yes'] ?></span></span></td> <td><?php print $row['Yes'] ?></td>
<td class='data1'><span class='f5'><span class='blue'><?php print $row['No'] ?></span></span></td> <td><?php print $row['No'] ?></td>
<td class='data1'><span class='f5'><span class='blue'><?php print $row['Abstain'] ?></span></span></td> <td><?php print $row['Abstain'] ?></td>
<td class='data1'><span class='f5'><span class='blue'><?php print ($row['Yes'] + $row['No'] + $row['Abstain']) ?></span></span></td> <td><?php print ($row['Yes'] + $row['No'] + $row['Abstain']) ?></td>
<td class='data1'><span class='f5'><span class='blue'> <td>
<?php if ($hasvoted == 0) { ?> <?php if ($hasvoted == 0): ?>
<span style='color: red; font-weight: bold'><?php print __("No") ?></span> <span style="color: red; font-weight: bold"><?php print __("No") ?></span>
<?php } else { ?> <?php else: ?>
<span style='color: green; font-weight: bold'><?php print __("Yes") ?></span> <span style="color: green; font-weight: bold"><?php print __("Yes") ?></span>
<?php } ?> <?php endif; ?>
</span></span></td> </td>
</tr> </tr>
</table> </table>
</div></div> </div>
<?php <?php if (!$isrunning): ?>
if (!$isrunning) { ?> <div class="box">
<div class="pgbox"> <h2><?php echo __("Voters"); ?></h2>
<h2><?php echo __('Voters'); ?></h2>
<div class="pgboxbody">
<?php echo $whovoted; ?> <?php echo $whovoted; ?>
</div> </div>
</div> <?php endif; ?>
<?php
} ?>
<div class='pgbox'> <div class="box">
<div class='pgboxbody'>
<?php if ($canvote == 1) { ?> <?php if ($canvote == 1): ?>
<form action='tu.php?id=<?php print $row['ID'] ?>' method='post'> <form action="tu.php?id=<?php print $row['ID'] ?>" method="post">
<fieldset> <fieldset>
<input type='submit' class='button' name='voteYes' value='<?php print __("Yes") ?>' /> <input type="submit" class="button" name="voteYes" value="<?php print __("Yes") ?>" />
<input type='submit' class='button' name='voteNo' value='<?php print __("No") ?>' /> <input type="submit" class="button" name="voteNo" value="<?php print __("No") ?>" />
<input type='submit' class='button' name='voteAbstain' value='<?php print __("Abstain") ?>' /> <input type="submit" class="button" name="voteAbstain" value="<?php print __("Abstain") ?>" />
<input type='hidden' name='doVote' value='1' /> <input type="hidden" name="doVote" value="1" />
</fieldset> </fieldset>
</form> </form>
<?php } else { ?> <?php else:
<?php print $errorvote ?> print $errorvote ?>
<?php } ?> <?php endif; ?>
</div></div> </div>

View file

@ -1,60 +1,58 @@
<div class="pgbox"> <div class="box">
<h2><?php print $type ?></h2> <h2><?php print $type ?></h2>
<table class='results'> <table class="results">
<thead>
<tr> <tr>
<th class='header'><span class='f2'><?php print __("Proposal") ?></span></th> <th><?php print __("Proposal") ?></th>
<th class='header'><span class='f2'> <th><a href="?off=<?php print $off ?>&amp;by=<?php print $by_next ?>"><?php print __("Start") ?></a></th>
<a href='?off=<?php print $off ?>&amp;by=<?php print $by_next ?>'><?php print __("Start") ?></a> <th><?php print __("End") ?></th>
</span></th> <th><?php print __("User") ?></th>
<th class='header'><span class='f2'><?php print __("End") ?></span></th> <th><?php print __("Yes") ?></th>
<th class='header'><span class='f2'><?php print __("User") ?></span></th> <th><?php print __("No") ?></th>
<th class='header'><span class='f2'><?php print __("Yes") ?></span></th> <th><?php print __('Voted') ?></th>
<th class='header'><span class='f2'><?php print __("No") ?></span></th>
<th class='header'><span class='f2'><?php print __('Voted') ?></span></th>
</tr> </tr>
<?php if (mysql_num_rows($result) == 0) { ?> </thead>
<tr><td align='center' colspan='0'><?php print __("No results found.") ?></td></tr>
<?php } else { for ($i = 0; $row = mysql_fetch_assoc($result); $i++) { (($i % 2) == 0) ? $c = "data1" : $c = "data2"; ?> <tbody>
<tr> <?php if (mysql_num_rows($result) == 0): ?>
<td class='<?php print $c ?>'><span class='f4'><span class='blue'> <tr><td align="center" colspan="0"><?php print __("No results found.") ?></td></tr>
<?php <?php else: for ($i = 0; $row = mysql_fetch_assoc($result); $i++): (($i % 2) == 0) ? $c = 'odd' : $c = 'even'; ?>
$row["Agenda"] = htmlspecialchars(substr($row["Agenda"], 0, $prev_Len)); <tr class="<?php print $c ?>">
?> <td><?php $row["Agenda"] = htmlspecialchars(substr($row["Agenda"], 0, $prev_Len)); ?>
<a href='tu.php?id=<?php print $row['ID'] ?>'><?php print $row["Agenda"] ?></a></span></span> <a href="tu.php?id=<?php print $row['ID'] ?>"><?php print $row["Agenda"] ?></a></span></span>
</td> </td>
<td class='<?php print $c ?>'><span class='f5'><span class='blue'><?php print gmdate("Y-m-d", $row["Submitted"]) ?></span></span></td> <td><?php print gmdate("Y-m-d", $row["Submitted"]) ?></td>
<td class='<?php print $c ?>'><span class='f5'><span class='blue'><?php print gmdate("Y-m-d", $row["End"]) ?></span></span></td> <td><?php print gmdate("Y-m-d", $row["End"]) ?></td>
<td class='<?php print $c ?>'><span class='f6'><span class='blue'> <td>
<?php <?php if (!empty($row['User'])): ?>
if (!empty($row['User'])) { <a href="packages.php?K=<?php echo $row['User'] ?>&amp;SeB=m"><?php echo $row['User'] ?></a>
print "<a href='packages.php?K=" . $row['User'] . "&amp;SeB=m'>" . $row['User'] . "</a>"; <?php else:
} else {
print "N/A"; print "N/A";
} endif;
?> ?>
</span></span></td> </td>
<td class='<?php print $c ?>'><span class='f5'><span class='blue'><?php print $row['Yes'] ?></span></span></td> <td><?php print $row['Yes'] ?></td>
<td class='<?php print $c ?>'><span class='f5'><span class='blue'><?php print $row['No'] ?></span></span></td> <td><?php print $row['No'] ?></td>
<td class='<?php print $c ?>'> <td>
<?php <?php
$q = "SELECT * FROM TU_Votes WHERE VoteID = " . $row['ID'] . " AND UserID = " . uid_from_sid($_COOKIE["AURSID"]); $q = "SELECT * FROM TU_Votes WHERE VoteID = " . $row['ID'] . " AND UserID = " . uid_from_sid($_COOKIE["AURSID"]);
$result_tulist = db_query($q, $dbh); $result_tulist = db_query($q, $dbh);
if ($result_tulist) { if ($result_tulist):
$hasvoted = mysql_num_rows($result_tulist); $hasvoted = mysql_num_rows($result_tulist);
} else:
else {
$hasvoted = 0; $hasvoted = 0;
} endif;
?> if ($hasvoted == 0): ?>
<span class='f5'><span class='blue'> <span style="color: red; font-weight: bold"><?php print __("No") ?></span>
<?php if ($hasvoted == 0) { ?> <?php else: ?>
<span style='color: red; font-weight: bold'><?php print __("No") ?></span> <span style="color: green; font-weight: bold"><?php print __("Yes") ?></span>
<?php } else { ?> <?php endif; ?>
<span style='color: green; font-weight: bold'><?php print __("Yes") ?></span>
<?php } ?>
</span></span>
</td> </td>
</tr> </tr>
<?php } } ?> <?php
endfor;
endif;
?>
</tbody>
</table> </table>
</div> </div>