com web/wiki: Hide vote choices for in-progress votes: dokuwiki/lib/plugins/doodle/doodle_template.php dokuwiki/ lib/plugins/doodle/style.css
systems/doodle-hide-votes-in-p rogress.diff
| From: | Hannes Magnusson | Date: | Fri, 03 Jan 2014 11:02:51 +0000 |
| Subject: | com web/wiki: Hide vote choices for in-progress votes: dokuwiki/lib/plugins/doodle/doodle_template.php dokuwiki/ lib/plugins/doodle/style.css systems/doodle-hide-votes-in-p rogress.diff |
||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-18031@lists.php.net to get a copy of this message | ||
Commit: 2c8876d460f8731afffcaa9d83f50da535616a0e
Author: Peter Cowburn <petercowburn@gmail.com> Fri, 3 Jan 2014 10:57:12 +0000
Parents: 571d08492a5239114663667eb947a98aaa76b172
Branches: master
Link: http://git.php.net/?p=web/wiki.git;a=commitdiff;h=2c8876d460f8731afffcaa9d83f50da535616a0e
Log:
Hide vote choices for in-progress votes
Changed paths:
M dokuwiki/lib/plugins/doodle/doodle_template.php
M dokuwiki/lib/plugins/doodle/style.css
A systems/doodle-hide-votes-in-progress.diff
Diff:
diff --git a/dokuwiki/lib/plugins/doodle/doodle_template.php
b/dokuwiki/lib/plugins/doodle/doodle_template..php
index 0dafba4..843a7cd 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']);
?>
@@ -42,18 +43,30 @@
<?php $fullname = '<a href="//people.php.net/user.php?username=' .
$fullname.'">' .$fullname. '</a>';?>
<?php echo $userData['editLinks'].$fullname..$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
?>"> </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;
+}
diff --git a/systems/doodle-hide-votes-in-progress.diff b/systems/doodle-hide-votes-in-progress.diff
new file mode 100644
index 0000000..9a6da8f
--- /dev/null
+++ b/systems/doodle-hide-votes-in-progress.diff
@@ -0,0 +1,62 @@
+diff --git a/dokuwiki/lib/plugins/doodle/doodle_template.php
b/dokuwiki/lib/plugins/doodle/doodle_template.php
+index 0dafba4..843a7cd 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']);
+ ?>
+
+@@ -42,18 +43,30 @@
+ <?php $fullname = '<a href="//people.php.net/user.php?username=' .
$fullname.'">' .$fullname. '</a>';?>
+ <?php echo $userData['editLinks'].$fullname.$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
?>"> </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;
++}