Author: Derick Rethans (derickr)
Date: 2025-09-09T08:39:49+01:00

Commit: 
https://github.com/php/web-wiki/commit/dab1c87ccc6b59f969dc365fdc79bdaeb96e866a
Raw diff: 
https://github.com/php/web-wiki/commit/dab1c87ccc6b59f969dc365fdc79bdaeb96e866a.diff

Handle overflow of account names better

Changed paths:
  M  dokuwiki/lib/plugins/doodle/doodle_template.php
  M  dokuwiki/lib/plugins/doodle/style.css
  M  dokuwiki/lib/plugins/doodle/syntax.php


Diff:

diff --git a/dokuwiki/lib/plugins/doodle/doodle_template.php 
b/dokuwiki/lib/plugins/doodle/doodle_template.php
index dd9cf8b8..c71914e9 100755
--- a/dokuwiki/lib/plugins/doodle/doodle_template.php
+++ b/dokuwiki/lib/plugins/doodle/doodle_template.php
@@ -24,12 +24,12 @@
 
 <table class="doodle__results">
        <thead>
-       <tr class="title_row" style="grid-template-columns: 2fr repeat(<?php 
echo $c; ?>, 1fr)">
+       <tr class="title_row" style="grid-template-columns: minmax(0, 2fr) 
repeat(<?php echo $c; ?>, 1fr)">
          <th class="title_caption" style="grid-column: 1 / <?php echo ($c+2) 
?>">
                <?php echo $template['title'] ?>
          </th>
        </tr>
-       <tr class="fields_row" style="grid-template-columns: 2fr repeat(<?php 
echo $c; ?>, 1fr)">
+       <tr class="fields_row" style="grid-template-columns: minmax(0, 2fr) 
repeat(<?php echo $c; ?>, 1fr)">
                <th class="fields_caption"><?php echo $lang['fullname'] ?></th>
 <?php foreach ($template['choices'] as $choice) {  ?>
                <th class="fields_data"><?php echo $choice ?></th>
@@ -39,7 +39,7 @@
 
        <tbody>
 <?php foreach ($template['doodleData'] as $fullname => $userData) { ?>
-    <tr class="data_row" style="grid-template-columns: 2fr repeat(<?php echo 
$c; ?>, 1fr)">
+    <tr class="data_row" style="grid-template-columns: minmax(0, 2fr) 
repeat(<?php echo $c; ?>, 1fr)">
         <td class="data_caption">
           <?php $link = '<a href="https://people.php.net/' . 
htmlspecialchars($userData['username']) . '">' . 
htmlspecialchars($userData['username']) . '</a>';?>
           <?php echo (array_key_exists('editLinks', $userData) ? 
$userData['editLinks'] : '') . $link; ?>
@@ -51,7 +51,7 @@
 <?php } ?>
 
     <!-- Results / sum per column -->
-    <tr class="results_row" style="grid-template-columns: 2fr repeat(<?php 
echo $c; ?>, 1fr)">
+    <tr class="results_row" style="grid-template-columns: minmax(0, 2fr) 
repeat(<?php echo $c; ?>, 1fr)">
         <td class="results_caption"><?php echo $template['result'] ?></td>
 <?php for ($col = 0; $col < $c; $col++) { ?>
         <td class="results_data"><?php echo $template['count'][$col] ?></td>
@@ -64,7 +64,7 @@
 ?>
 
 <?php if (!empty($template['msg'])) { ?>
-    <tr class="title_row" style="grid-template-columns: 2fr repeat(<?php echo 
$c; ?>, 1fr)">
+    <tr class="title_row" style="grid-template-columns: minmax(0, 2fr) 
repeat(<?php echo $c; ?>, 1fr)">
       <td class="title_caption" style="grid-column: 1 / <?php echo ($c+2) ?>">
         <?php echo $template['msg'] ?>
       </td>
diff --git a/dokuwiki/lib/plugins/doodle/style.css 
b/dokuwiki/lib/plugins/doodle/style.css
index 08013435..3301b3cd 100644
--- a/dokuwiki/lib/plugins/doodle/style.css
+++ b/dokuwiki/lib/plugins/doodle/style.css
@@ -55,6 +55,12 @@ table.doodle__results .input_row {
 table.doodle__results .title_caption, table.doodle__results .fields_caption, 
table.doodle__results .data_caption, table.doodle__results .results_caption {
 }
 
+table.doodle__results td.data_caption {
+       overflow: hidden;
+       text-overflow: ellipsis;
+       white-space: nowrap;
+}
+
 table.doodle__results .title_caption a, table.doodle__results .fields_caption 
a, table.doodle__results .data_caption a, table.doodle__results 
.results_caption a {
        margin: 0.25em;
 }
@@ -79,3 +85,7 @@ table.doodle__results .data_row:nth-child(odd) {
 table.doodle__results .data_row:nth-child(even) {
        background-color: #E2E4EF;
 }
+
+a.poll_action {
+       margin-right: 0 !important;
+}
diff --git a/dokuwiki/lib/plugins/doodle/syntax.php 
b/dokuwiki/lib/plugins/doodle/syntax.php
index 1749497b..5843901d 100755
--- a/dokuwiki/lib/plugins/doodle/syntax.php
+++ b/dokuwiki/lib/plugins/doodle/syntax.php
@@ -311,10 +311,10 @@ function render($mode, Doku_Renderer $renderer, $data) {
             {
                 // the javascript source of these functions is in script.js
                 $this->template['doodleData']["$fullname"]['editLinks'] =
-                   '<a 
href="javascript:editEntry(\''.$formId.'\',\''.$fullname.'\')">'.
+                   '<a class="poll_action" 
href="javascript:editEntry(\''.$formId.'\',\''.$fullname.'\')">'.
                    '  <b title="edit entry">&#9998;</b>'.
                    '</a>'.
-                   '<a 
href="javascript:deleteEntry(\''.$formId.'\',\''.$fullname.'\')">'.
+                   '<a class="poll_action" 
href="javascript:deleteEntry(\''.$formId.'\',\''.$fullname.'\')">'.
                    '  <b title="delete entry">&#128465;</b>'.
                    '</a>';
             }
@@ -503,7 +503,7 @@ function getInputTR() {
         $c = count($this->choices);
         $TR  = '';
         //$TR .= '<tr style="height:3px"><th colspan="'.($c+1).'"></th></tr>';
-        $TR .= '<tr class="input_row" style="grid-template-columns: 2fr 
repeat('. $c . ', 1fr)">';
+        $TR .= '<tr class="input_row" style="grid-template-columns: minmax(0, 
2fr) repeat('. $c . ', 1fr)">';
         $TR .= '<td class="input_caption">';
         if ($fullname) {
             if ($editMode) $TR .= $this->getLang('edit').':&nbsp;';

Reply via email to