Merge branch 'revert-hide-votes'

Couple of people really did not like this

* revert-hide-votes:
  Revert "Merge pull request #1 from salathe/salathe/hide-votes-in-progress"
  Revert "fix showing your vote"
This commit is contained in:
Hannes Magnusson
2014-01-06 17:25:11 -08:00
3 changed files with 8 additions and 93 deletions

View File

@ -9,7 +9,6 @@
global $ID;
$template = $this->template;
$is_closed = $this->params['closed'];
$c = count($template['choices']);
?>
@ -40,33 +39,21 @@
<?php foreach ($template['doodleData'] as $fullname => $userData) { ?>
<tr>
<td class="rightalign">
<?php $people_link = '<a href="//people.php.net/user.php?username=' . $fullname.'">' .$fullname. '</a>';?>
<?php echo $userData['editLinks'].$people_link.$userData['username'] ?>
<?php $fullname = '<a href="//people.php.net/user.php?username=' . $fullname.'">' .$fullname. '</a>';?>
<?php echo $userData['editLinks'].$fullname.$userData['username'] ?>
</td>
<?php
if ($is_closed || $INFO['userinfo']['name'] == $fullname) {
for ($col = 0; $col < $c; $col++) {
<?php for ($col = 0; $col < $c; $col++) {
echo $userData['choice'][$col];
}
} else {
?><td class="votehidden" colspan="<?php echo $c ?>">&nbsp;</td><?php
}
?>
} ?>
</tr>
<?php } ?>
<!-- Results / sum per column -->
<tr>
<th class="rightalign"><b><?php echo $template['result'] ?></b></th>
<?php
if ($is_closed) {
for ($col = 0; $col < $c; $col++) {
?><th class="centeralign"><b><?php echo $template['count'][$col] ?></b></th><?php
}
} else {
?><th class="centeralign" colspan="<?php echo $c ?>"><?php echo count($template['doodleData']) ?></th><?php
}
?>
<?php for ($col = 0; $col < $c; $col++) { ?>
<th class="centeralign"><b><?php echo $template['count'][$col] ?></b></th>
<?php } ?>
</tr>
<?php

View File

@ -27,8 +27,3 @@ div.dokuwiki table.inline td.notokay {
border: 0;
color: rgba(0, 0, 0, 0);
}
div.dokuwiki table.inline td.votehidden {
background-color: #f3f3f3;
text-align: center;
}

View File

@ -1,67 +0,0 @@
diff --git a/dokuwiki/lib/plugins/doodle/doodle_template.php b/dokuwiki/lib/plugins/doodle/doodle_template.php
index 0dafba4..2f0dccf 100755
--- a/dokuwiki/lib/plugins/doodle/doodle_template.php
+++ b/dokuwiki/lib/plugins/doodle/doodle_template.php
@@ -9,6 +9,7 @@
global $ID;
$template = $this->template;
+ $is_closed = $this->params['closed'];
$c = count($template['choices']);
?>
@@ -39,21 +40,33 @@
<?php foreach ($template['doodleData'] as $fullname => $userData) { ?>
<tr>
<td class="rightalign">
- <?php $fullname = '<a href="//people.php.net/user.php?username=' . $fullname.'">' .$fullname. '</a>';?>
- <?php echo $userData['editLinks'].$fullname.$userData['username'] ?>
+ <?php $people_link = '<a href="//people.php.net/user.php?username=' . $fullname.'">' .$fullname. '</a>';?>
+ <?php echo $userData['editLinks'].$people_link.$userData['username'] ?>
</td>
- <?php for ($col = 0; $col < $c; $col++) {
- echo $userData['choice'][$col];
- } ?>
+ <?php
+ if ($is_closed || $INFO['userinfo']['name'] == $fullname) {
+ for ($col = 0; $col < $c; $col++) {
+ echo $userData['choice'][$col];
+ }
+ } else {
+ ?><td class="votehidden" colspan="<?php echo $c ?>">&nbsp;</td><?php
+ }
+ ?>
</tr>
<?php } ?>
<!-- Results / sum per column -->
<tr>
<th class="rightalign"><b><?php echo $template['result'] ?></b></th>
-<?php for ($col = 0; $col < $c; $col++) { ?>
- <th class="centeralign"><b><?php echo $template['count'][$col] ?></b></th>
-<?php } ?>
+ <?php
+ if ($is_closed) {
+ for ($col = 0; $col < $c; $col++) {
+ ?><th class="centeralign"><b><?php echo $template['count'][$col] ?></b></th><?php
+ }
+ } else {
+ ?><th class="centeralign" colspan="<?php echo $c ?>"><?php echo count($template['doodleData']) ?></th><?php
+ }
+ ?>
</tr>
<?php
diff --git a/dokuwiki/lib/plugins/doodle/style.css b/dokuwiki/lib/plugins/doodle/style.css
index 0db25ee..661dfbc 100644
--- a/dokuwiki/lib/plugins/doodle/style.css
+++ b/dokuwiki/lib/plugins/doodle/style.css
@@ -27,3 +27,8 @@ div.dokuwiki table.inline td.notokay {
border: 0;
color: rgba(0, 0, 0, 0);
}
+
+div.dokuwiki table.inline td.votehidden {
+ background-color: #f3f3f3;
+ text-align: center;
+}