Fix accessibility on classical polls

This commit is contained in:
Olivier PEREZ 2015-02-02 21:14:24 +01:00
parent a3b56d6339
commit be754a8628
3 changed files with 10 additions and 6 deletions

View File

@ -72,6 +72,7 @@ $date_format['txt_full'] = _('%A, den %e. %B %Y'); //summary in choix_date.php a
$date_format['txt_short'] = _('%A %e %B %Y'); // radio title
$date_format['txt_day'] = _('%a %e');
$date_format['txt_date'] = _('%Y-%m-%d');
$date_format['txt_year_month'] = _('%B %Y');
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { //%e can't be used on Windows platform, use %#d instead
foreach ($date_format as $k => $v) {
$date_format[$k] = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $v); //replace %e by %#d for windows

View File

@ -25,7 +25,7 @@
<tr>
<th role="presentation"></th>
{foreach $slots as $id=>$slot}
<th class="bg-info" id="H{$id}">{$slot->title|html|markdown}</th>
<th class="bg-info" id="C{$id}">{$slot->title|html|markdown}</th>
{/foreach}
<th></th>
</tr>
@ -76,7 +76,7 @@
<th class="bg-info">{$vote->name|html}</th>
{foreach $vote->choices as $choice}
{foreach $vote->choices as $id=>$choice}
{if $choice==2}
<td class="bg-success text-success" headers="C{$id}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{_('Yes')}</span></td>

View File

@ -29,7 +29,7 @@
<tr>
<th role="presentation"></th>
{foreach $slots as $id=>$slot}
<th colspan="{$slot->moments|count}" class="bg-primary month" id="M{$id}">{$slot->day|date_format:'%B %Y'|html}</th>
<th colspan="{$slot->moments|count}" class="bg-primary month" id="M{$id}">{$slot->day|date_format:$date_format.txt_year_month|html}</th>
{for $foo=0 to ($slot->moments|count)-1}
{append var='headersM' value=$id}
{/for}
@ -40,6 +40,9 @@
<th role="presentation"></th>
{foreach $slots as $id=>$slot}
<th colspan="{$slot->moments|count}" class="bg-primary day" id="D{$id}">{$slot->day|date_format:$date_format.txt_day|html}</th>
{for $foo=0 to ($slot->moments|count)-1}
{append var='headersD' value=$id}
{/for}
{/foreach}
<th></th>
</tr>
@ -49,7 +52,7 @@
{foreach $slots as $slot}
{foreach $slot->moments as $id=>$moment}
<th colspan="1" class="bg-info" id="H{$headersDCount}">{$moment|html}</th>
{append var='headersD' value=$headersDCount}
{append var='headersH' value=$headersDCount}
{$headersDCount = $headersDCount+1}
{/foreach}
{/foreach}
@ -72,7 +75,7 @@
{foreach $vote->choices as $k=>$choice}
<td class="bg-info" headers="M{$headersM[$k]} D{$headersD[$k]} H{$k}">
<td class="bg-info" headers="M{$headersM[$k]} D{$headersD[$k]} H{$headersH[$k]}">
<ul class="list-unstyled choice">
<li class="yes">
<input type="radio" id="y-choice-{$k}" name="choices[{$k}]" value="2" {if $choice==2}checked {/if}/>
@ -145,7 +148,7 @@
{$i = 0}
{foreach $slots as $slot}
{foreach $slot->moments as $moment}
<td class="bg-info" headers="M{$headersM[$i]} D{$headersD[$i]} H{$i}">
<td class="bg-info" headers="M{$headersM[$i]} D{$headersD[$i]} H{$headersH[$i]}">
<ul class="list-unstyled choice">
<li class="yes">
<input type="radio" id="y-choice-{$i}" name="choices[{$i}]" value="2" />