[aur-dev] [PATCH 3/7] Show participation in vote details

Lukas Fleischer archlinux at cryptocrack.de
Mon Aug 5 04:10:24 EDT 2013


This is calculated by dividing the sum of all votes by the number of
active TUs (where the number of active TUs is measured when the vote
starts).

Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
---
 web/template/tu_details.php | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/web/template/tu_details.php b/web/template/tu_details.php
index be816ce..4f291f0 100644
--- a/web/template/tu_details.php
+++ b/web/template/tu_details.php
@@ -34,6 +34,7 @@
 			<th><?= __("Abstain") ?></th>
 			<th><?= __("Total") ?></th>
 			<th><?= __('Voted') ?></th>
+			<th><?= __('Participation') ?></th>
 		</tr>
 		<tr>
 			<td><?= $row['Yes'] ?></td>
@@ -47,6 +48,11 @@
 				<span style="color: green; font-weight: bold"><?= __("Yes") ?></span>
 				<?php endif; ?>
 			</td>
+			<?php if ($row['ActiveTUs'] > 0): ?>
+			<td><?= number_format(($row['Yes'] + $row['No'] + $row['Abstain']) / $row['ActiveTUs'] * 100, 2) ?>%</td>
+			<?php else: ?>
+			<td><?= __("unknown") ?></td>
+			<?php endif; ?>
 		</tr>
 	</table>
 </div>
-- 
1.8.4.rc1.383.g13e9f3f



More information about the aur-dev mailing list