From af19e08b020a567abada2b1a339be6574cb26555 Mon Sep 17 00:00:00 2001 From: Ecmu Date: Sun, 6 Mar 2016 20:36:22 +0100 Subject: [PATCH 1/7] #51 : make empty vote different from 'No' --- tpl/part/vote_table_classic.tpl | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/tpl/part/vote_table_classic.tpl b/tpl/part/vote_table_classic.tpl index e1feac7..f2a6f2d 100644 --- a/tpl/part/vote_table_classic.tpl +++ b/tpl/part/vote_table_classic.tpl @@ -51,24 +51,25 @@ - {foreach $vote->choices as $id=>$choice} + {foreach $slots as $id=>$slot} {* Parcourt "slots" et non "choices" pour prendre en compte aussi les colonnes non renseignées *} + {assign var='choice' value=$vote->choices[$id]} {/foreach} @@ -352,4 +355,4 @@ {/if} -{/if} \ No newline at end of file +{/if} From c857eac91c9f6731234ab3854fb83b77a272cd35 Mon Sep 17 00:00:00 2001 From: ecmu Date: Sat, 19 Mar 2016 10:30:49 +0100 Subject: [PATCH 4/7] #51 : make empty vote different from 'No' --- tpl/part/vote_table_classic.tpl | 26 ++++++++++++++++++++------ tpl/part/vote_table_date.tpl | 26 ++++++++++++++++++++------ 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/tpl/part/vote_table_classic.tpl b/tpl/part/vote_table_classic.tpl index e5b9836..a9c0507 100644 --- a/tpl/part/vote_table_classic.tpl +++ b/tpl/part/vote_table_classic.tpl @@ -51,8 +51,11 @@ - {foreach $slots as $id=>$slot} {* Parcourt "slots" et non "choices" pour prendre en compte aussi les colonnes non renseignées *} - {assign var='choice' value=$vote->choices[$id]} + {$id=0} {* #51 : Parcoure les slots/moments pour y inclure les nouveaux items sans vote } + {foreach $slots as $slot} + {foreach $slot->moments as $moment} + {$choice=$vote->choices[$id]} + + + {$id=$id + 1} + {/foreach} {/foreach} + {elseif !$hidden} {* Voted line *} @@ -87,8 +94,10 @@ {$vote->name|html} - {foreach $slots as $id=>$slot} - {assign var='choice' value=$vote->choices[$id]} + {$id=0} {* #51 : Parcoure les slots/moments pour y inclure les nouveaux items sans vote } + {foreach $slots as $slot} + {foreach $slot->moments as $moment} + {$choice=$vote->choices[$id]} {if $choice=='2'} {__('Generic', 'Yes')} @@ -96,10 +105,12 @@ (){__('Generic', 'Ifneedbe')} {elseif $choice=='0'} {__('Generic', 'No')} - {else} + {else} {* #51 : default value for unselected vote (new dates) *} ?{__('Generic', 'Unknown')} {/if} + {$id=$id + 1} + {/foreach} {/foreach} {if $active && !$expired && @@ -155,11 +166,14 @@
  • - +
  • +
  • {* #51 : default value for unselected vote *} + +
  • {/foreach} diff --git a/tpl/part/vote_table_date.tpl b/tpl/part/vote_table_date.tpl index ecfa39b..0ef9f64 100644 --- a/tpl/part/vote_table_date.tpl +++ b/tpl/part/vote_table_date.tpl @@ -99,8 +99,11 @@ - {foreach $slots as $k=>$slot} - {assign var='choice' value=$vote->choices[$k]} + {$k=0} {* #51 : Parcoure les slots/moments pour y inclure les nouveaux items sans vote } + {foreach $slots as $slot} + {foreach $slot->moments as $moment} + {$choice=$vote->choices[$k]} + + + {$k=$k + 1} + {/foreach} {/foreach} + @@ -138,8 +145,10 @@ {$vote->name|html} - {foreach $slots as $k=>$slot} - {assign var='choice' value=$vote->choices[$k]} + {$k=0} {* #51 : Parcoure les slots/moments pour y inclure les nouveaux items sans vote } + {foreach $slots as $slot} + {foreach $slot->moments as $moment} + {$choice=$vote->choices[$k]} {if $choice=='2'} {__('Generic', 'Yes')} @@ -147,10 +156,12 @@ (){__('Generic', 'Ifneedbe')} {elseif $choice=='0'} {__('Generic', 'No')} - {else} + {else} {* #51 : default value for unselected vote (new dates) *} ?{__('Generic', 'Unknown')} {/if} + {$k=$k + 1} + {/foreach} {/foreach} {if $active && !$expired && @@ -207,11 +218,14 @@
  • - +
  • +
  • {* #51 : default value for unselected vote *} + +
  • {$i = $i+1} From 8a3e74cadbe2ba429cd059da1930ea4079365c82 Mon Sep 17 00:00:00 2001 From: Olivier Perez Date: Wed, 27 Apr 2016 00:59:20 +0200 Subject: [PATCH 5/7] Clean code --- tpl/part/vote_table_classic.tpl | 12 ++++++------ tpl/part/vote_table_date.tpl | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tpl/part/vote_table_classic.tpl b/tpl/part/vote_table_classic.tpl index a9c0507..7c83e24 100644 --- a/tpl/part/vote_table_classic.tpl +++ b/tpl/part/vote_table_classic.tpl @@ -51,7 +51,7 @@ - {$id=0} {* #51 : Parcoure les slots/moments pour y inclure les nouveaux items sans vote } + {$id=0} {foreach $slots as $slot} {foreach $slot->moments as $moment} {$choice=$vote->choices[$id]} @@ -77,7 +77,7 @@ {__('Generic', 'No')} -
  • {* #51 : default value for unselected vote *} +
  • @@ -94,7 +94,7 @@ {$vote->name|html} - {$id=0} {* #51 : Parcoure les slots/moments pour y inclure les nouveaux items sans vote } + {$id=0} {foreach $slots as $slot} {foreach $slot->moments as $moment} {$choice=$vote->choices[$id]} @@ -105,8 +105,8 @@ (){__('Generic', 'Ifneedbe')} {elseif $choice=='0'} {__('Generic', 'No')} - {else} {* #51 : default value for unselected vote (new dates) *} - ?{__('Generic', 'Unknown')} + {else} + ?{__('Generic', 'Unknown')} {/if} {$id=$id + 1} @@ -171,7 +171,7 @@ {__('Generic', 'No')} -
  • {* #51 : default value for unselected vote *} +
  • diff --git a/tpl/part/vote_table_date.tpl b/tpl/part/vote_table_date.tpl index 0ef9f64..4b44b0e 100644 --- a/tpl/part/vote_table_date.tpl +++ b/tpl/part/vote_table_date.tpl @@ -99,7 +99,7 @@ - {$k=0} {* #51 : Parcoure les slots/moments pour y inclure les nouveaux items sans vote } + {$k=0} {foreach $slots as $slot} {foreach $slot->moments as $moment} {$choice=$vote->choices[$k]} @@ -125,7 +125,7 @@ {__('Generic', 'No')} -
  • {* #51 : default value for unselected vote *} +
  • @@ -145,7 +145,7 @@ {$vote->name|html} - {$k=0} {* #51 : Parcoure les slots/moments pour y inclure les nouveaux items sans vote } + {$k=0} {foreach $slots as $slot} {foreach $slot->moments as $moment} {$choice=$vote->choices[$k]} @@ -156,8 +156,8 @@ (){__('Generic', 'Ifneedbe')} {elseif $choice=='0'} {__('Generic', 'No')} - {else} {* #51 : default value for unselected vote (new dates) *} - ?{__('Generic', 'Unknown')} + {else} + ?{__('Generic', 'Unknown')} {/if} {$k=$k + 1} @@ -223,7 +223,7 @@ {__('Generic', 'No')} -
  • {* #51 : default value for unselected vote *} +
  • From 11ff60a170d3314c04447bcc36824f4b5c29edab Mon Sep 17 00:00:00 2001 From: Olivier Perez Date: Wed, 27 Apr 2016 01:01:23 +0200 Subject: [PATCH 6/7] Fix CHOICE_REGEX to allow space --- app/inc/constants.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/inc/constants.php b/app/inc/constants.php index d82a95e..06128ac 100644 --- a/app/inc/constants.php +++ b/app/inc/constants.php @@ -22,7 +22,7 @@ const VERSION = '0.9'; // Regex const POLL_REGEX = '/^[a-z0-9]+$/i'; -const CHOICE_REGEX = '/^[012]$/'; +const CHOICE_REGEX = '/^[ 012]$/'; const BOOLEAN_REGEX = '/^(on|off|true|false|1|0)$/i'; const BOOLEAN_TRUE_REGEX = '/^(on|true|1)$/i'; const EDITABLE_CHOICE_REGEX = '/^[0-2]$/'; From 4fc2d1022e8de1411e91365b03e87c43e05aff8b Mon Sep 17 00:00:00 2001 From: Olivier Perez Date: Wed, 27 Apr 2016 01:03:59 +0200 Subject: [PATCH 7/7] Use bg-info background instead of '?' for unanswered slots --- tpl/part/vote_table_classic.tpl | 2 +- tpl/part/vote_table_date.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tpl/part/vote_table_classic.tpl b/tpl/part/vote_table_classic.tpl index 7c83e24..07ee275 100644 --- a/tpl/part/vote_table_classic.tpl +++ b/tpl/part/vote_table_classic.tpl @@ -106,7 +106,7 @@ {elseif $choice=='0'} {__('Generic', 'No')} {else} - ?{__('Generic', 'Unknown')} + {__('Generic', 'Unknown')} {/if} {$id=$id + 1} diff --git a/tpl/part/vote_table_date.tpl b/tpl/part/vote_table_date.tpl index 4b44b0e..41b233a 100644 --- a/tpl/part/vote_table_date.tpl +++ b/tpl/part/vote_table_date.tpl @@ -157,7 +157,7 @@ {elseif $choice=='0'} {__('Generic', 'No')} {else} - ?{__('Generic', 'Unknown')} + {__('Generic', 'Unknown')} {/if} {$k=$k + 1}