diff --git a/tpl/part/vote_table_classic.tpl b/tpl/part/vote_table_classic.tpl index cfa005c8ca78e152bee85514c2b3112ef9736c39..a66e141682c73eebe176be6b85f9758320b23891 100644 --- a/tpl/part/vote_table_classic.tpl +++ b/tpl/part/vote_table_classic.tpl @@ -38,85 +38,86 @@ </thead> <tbody> {foreach $votes as $vote} - <tr> - {* Edited line *} - - {if $editingVoteId === $vote->uniqId} - <td class="bg-info" style="padding:5px"> - <div class="input-group input-group-sm" id="edit"> - <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span> - <input type="hidden" name="edited_vote" value="{$vote->uniqId}"/> - <input type="text" id="name" name="name" value="{$vote->name|html}" class="form-control" title="{__('Genric', 'Your name')}" placeholder="{__('Genric', 'Your name')}" /> - </div> - </td> - {foreach $vote->choices as $id=>$choice} - - <td class="bg-info" headers="C{$id}"> - <ul class="list-unstyled choice"> - <li class="yes"> - <input type="radio" id="y-choice-{$id}" name="choices[{$id}]" value="2" {if $choice==2}checked {/if}/> - <label class="btn btn-default btn-xs" for="y-choice-{$id}" title="{__('Poll results', 'Vote yes for')|html} {$slots[$id]->title|html}"> - <span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Genric', 'Yes')}</span> - </label> - </li> - <li class="ifneedbe"> - <input type="radio" id="i-choice-{$id}" name="choices[{$id}]" value="1" {if $choice==1}checked {/if}/> - <label class="btn btn-default btn-xs" for="i-choice-{$id}" title="{__('Poll results', 'Vote ifneedbe for')|html} {$slots[$id]->title|html}"> - (<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Genric', 'Ifneedbe')}</span> - </label> - </li> - <li class="no"> - <input type="radio" id="n-choice-{$id}" name="choices[{$id}]" value="0" {if $choice==0}checked {/if}/> - <label class="btn btn-default btn-xs" for="n-choice-{$id}" title="{__('Poll results', 'Vote no for')|html} {$slots[$id]->title|html}"> - <span class="glyphicon glyphicon-ban-circle"></span><span class="sr-only">{__('Genric', 'No')}</span> - </label> - </li> - </ul> - </td> - {/foreach} - <td style="padding:5px"><button type="submit" class="btn btn-success btn-xs" name="save" value="{$vote->id|html}" title="{__('Poll results', 'Save the choices')} {$vote->name|html}">{__('Generic', 'Save')}</button></td> - {elseif !$hidden} - {* Voted line *} + {if $editingVoteId === $vote->uniqId} {* Edited line *} - <th class="bg-info">{$vote->name|html}</th> + <tr class="hidden-print"> + <td class="bg-info" style="padding:5px"> + <div class="input-group input-group-sm" id="edit"> + <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span> + <input type="hidden" name="edited_vote" value="{$vote->uniqId}"/> + <input type="text" id="name" name="name" value="{$vote->name|html}" class="form-control" title="{__('Genric', 'Your name')}" placeholder="{__('Genric', 'Your name')}" /> + </div> + </td> - {foreach $vote->choices as $id=>$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">{__('Generic', 'Yes')}</span></td> - {elseif $choice==1} - <td class="bg-warning text-warning" headers="C{$id}">(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Generic', 'Ifneedbe')}</span></td> - {else} - <td class="bg-danger" headers="C{$id}"><span class="sr-only">{__('Generic', 'No')}</span></td> - {/if} + <td class="bg-info" headers="C{$id}"> + <ul class="list-unstyled choice"> + <li class="yes"> + <input type="radio" id="y-choice-{$id}" name="choices[{$id}]" value="2" {if $choice==2}checked {/if}/> + <label class="btn btn-default btn-xs" for="y-choice-{$id}" title="{__('Poll results', 'Vote yes for')|html} {$slots[$id]->title|html}"> + <span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Genric', 'Yes')}</span> + </label> + </li> + <li class="ifneedbe"> + <input type="radio" id="i-choice-{$id}" name="choices[{$id}]" value="1" {if $choice==1}checked {/if}/> + <label class="btn btn-default btn-xs" for="i-choice-{$id}" title="{__('Poll results', 'Vote ifneedbe for')|html} {$slots[$id]->title|html}"> + (<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Genric', 'Ifneedbe')}</span> + </label> + </li> + <li class="no"> + <input type="radio" id="n-choice-{$id}" name="choices[{$id}]" value="0" {if $choice==0}checked {/if}/> + <label class="btn btn-default btn-xs" for="n-choice-{$id}" title="{__('Poll results', 'Vote no for')|html} {$slots[$id]->title|html}"> + <span class="glyphicon glyphicon-ban-circle"></span><span class="sr-only">{__('Genric', 'No')}</span> + </label> + </li> + </ul> + </td> + {/foreach} + <td style="padding:5px"><button type="submit" class="btn btn-success btn-xs" name="save" value="{$vote->id|html}" title="{__('Poll results', 'Save the choices')} {$vote->name|html}">{__('Generic', 'Save')}</button></td> + </tr> + {elseif !$hidden} {* Voted line *} + <tr> - {/foreach} + <th class="bg-info">{$vote->name|html}</th> - {if $active && !$expired && ($poll->editable == constant('Framadate\Editable::EDITABLE_BY_ALL') or $admin)} - <td> - <a href="{if $admin}{poll_url id=$poll->admin_id vote_id=$vote->uniqId admin=true}{else}{poll_url id=$poll->id vote_id=$vote->uniqId}{/if}" class="btn btn-default btn-sm" title="{__('Poll results', 'Edit the line:')|html} {$vote->name|html}"> - <span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic', 'Edit')}</span> - </a> - {if $admin} - <a href="{poll_url id=$admin_poll_id admin=true action='delete_vote' action_value=$vote->id}" - class="btn btn-default btn-sm" - title="{__('Poll results', 'Remove the line:')} {$vote->name|html}"> - <span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{__('Generic', 'Remove')}</span> - </a> - {/if} - </td> + {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">{__('Generic', 'Yes')}</span></td> + {elseif $choice==1} + <td class="bg-warning text-warning" headers="C{$id}">(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Generic', 'Ifneedbe')}</span></td> {else} - <td></td> + <td class="bg-danger" headers="C{$id}"><span class="sr-only">{__('Generic', 'No')}</span></td> {/if} + + {/foreach} + + {if $active && !$expired && ($poll->editable == constant('Framadate\Editable::EDITABLE_BY_ALL') or $admin)} + <td class="hidden-print"> + <a href="{if $admin}{poll_url id=$poll->admin_id vote_id=$vote->uniqId admin=true}{else}{poll_url id=$poll->id vote_id=$vote->uniqId}{/if}" class="btn btn-default btn-sm" title="{__('Poll results', 'Edit the line:')|html} {$vote->name|html}"> + <span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic', 'Edit')}</span> + </a> + {if $admin} + <a href="{poll_url id=$admin_poll_id admin=true action='delete_vote' action_value=$vote->id}" + class="btn btn-default btn-sm" + title="{__('Poll results', 'Remove the line:')} {$vote->name|html}"> + <span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{__('Generic', 'Remove')}</span> + </a> + {/if} + </td> + {else} + <td></td> {/if} </tr> + {/if} {/foreach} {* Line to add a new vote *} {if $active && $editingVoteId === 0 && !$expired} - <tr id="vote-form"> + <tr id="vote-form" class="hidden-print"> <td class="bg-info" style="padding:5px"> <div class="input-group input-group-sm"> <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span> diff --git a/tpl/part/vote_table_date.tpl b/tpl/part/vote_table_date.tpl index 8fdb74cc30851ed85be26626c66a90d80e31cac7..5d21aeda0823eff136483ba7683a86861a6eefd7 100644 --- a/tpl/part/vote_table_date.tpl +++ b/tpl/part/vote_table_date.tpl @@ -86,86 +86,89 @@ </thead> <tbody> {foreach $votes as $vote} - <tr> - {* Edited line *} - - {if $editingVoteId === $vote->uniqId && !$expired} - <td class="bg-info" style="padding:5px"> - <div class="input-group input-group-sm" id="edit"> - <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span> - <input type="hidden" name="edited_vote" value="{$vote->uniqId}"/> - <input type="text" id="name" name="name" value="{$vote->name|html}" class="form-control" title="{__('Generic', 'Your name')}" placeholder="{__('Generic', 'Your name')}" /> - </div> - </td> + {* Edited line *} - {foreach $vote->choices as $k=>$choice} + {if $editingVoteId === $vote->uniqId && !$expired} + <tr class="hidden-print"> + <td class="bg-info" style="padding:5px"> + <div class="input-group input-group-sm" id="edit"> + <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span> + <input type="hidden" name="edited_vote" value="{$vote->uniqId}"/> + <input type="text" id="name" name="name" value="{$vote->name|html}" class="form-control" title="{__('Generic', 'Your name')}" placeholder="{__('Generic', 'Your name')}" /> + </div> + </td> - <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}/> - <label class="btn btn-default btn-xs" for="y-choice-{$k}" title="{__('Poll results', 'Vote yes for')|html} {$slots_raw[$k]}"> - <span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Yes')}</span> - </label> - </li> - <li class="ifneedbe"> - <input type="radio" id="i-choice-{$k}" name="choices[{$k}]" value="1" {if $choice==1}checked {/if}/> - <label class="btn btn-default btn-xs" for="i-choice-{$k}" title="{__('Poll results', 'Vote ifneedbe for')|html} {$slots_raw[$k]}"> - (<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Generic', 'Ifneedbe')}</span> - </label> - </li> - <li class="no"> - <input type="radio" id="n-choice-{$k}" name="choices[{$k}]" value="0" {if $choice==0}checked {/if}/> - <label class="btn btn-default btn-xs" for="n-choice-{$k}" title="{__('Poll results', 'Vote no for')|html} {$slots_raw[$k]}"> - <span class="glyphicon glyphicon-ban-circle"></span><span class="sr-only">{__('Generic', 'No')}</span> - </label> - </li> - </ul> - </td> - {/foreach} - <td style="padding:5px"><button type="submit" class="btn btn-success btn-xs" name="save" value="{$vote->id|html}" title="{__('Poll results', 'Save the choices')} {$vote->name|html}">{__('Generic', 'Save')}</button></td> - {elseif !$hidden} + {foreach $vote->choices as $k=>$choice} - {* Voted line *} + <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}/> + <label class="btn btn-default btn-xs" for="y-choice-{$k}" title="{__('Poll results', 'Vote yes for')|html} {$slots_raw[$k]}"> + <span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Yes')}</span> + </label> + </li> + <li class="ifneedbe"> + <input type="radio" id="i-choice-{$k}" name="choices[{$k}]" value="1" {if $choice==1}checked {/if}/> + <label class="btn btn-default btn-xs" for="i-choice-{$k}" title="{__('Poll results', 'Vote ifneedbe for')|html} {$slots_raw[$k]}"> + (<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Generic', 'Ifneedbe')}</span> + </label> + </li> + <li class="no"> + <input type="radio" id="n-choice-{$k}" name="choices[{$k}]" value="0" {if $choice==0}checked {/if}/> + <label class="btn btn-default btn-xs" for="n-choice-{$k}" title="{__('Poll results', 'Vote no for')|html} {$slots_raw[$k]}"> + <span class="glyphicon glyphicon-ban-circle"></span><span class="sr-only">{__('Generic', 'No')}</span> + </label> + </li> + </ul> + </td> + {/foreach} + <td style="padding:5px"><button type="submit" class="btn btn-success btn-xs" name="save" value="{$vote->id|html}" title="{__('Poll results', 'Save the choices')} {$vote->name|html}">{__('Generic', 'Save')}</button></td> - <th class="bg-info">{$vote->name|html}</th> + </tr> + {elseif !$hidden} + <tr> - {foreach $vote->choices as $k=>$choice} + {* Voted line *} - {if $choice==2} - <td class="bg-success text-success" headers="M{$headersM[$k]} D{$headersD[$k]} H{$k}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Yes')}</span></td> - {elseif $choice==1} - <td class="bg-warning text-warning" headers="M{$headersM[$k]} D{$headersD[$k]} H{$k}">(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Generic', 'Ifneedbe')}</span></td> - {else} - <td class="bg-danger" headers="M{$headersM[$k]} D{$headersD[$k]} H{$k}"><span class="sr-only">{__('Generic', 'No')}</span></td> - {/if} + <th class="bg-info">{$vote->name|html}</th> - {/foreach} + {foreach $vote->choices as $k=>$choice} - {if $active && !$expired && ($poll->editable == constant('Framadate\Editable::EDITABLE_BY_ALL') or $admin)} - <td> - <a href="{if $admin}{poll_url id=$poll->admin_id vote_id=$vote->uniqId admin=true}{else}{poll_url id=$poll->id vote_id=$vote->uniqId}{/if}" class="btn btn-default btn-sm" title="{__('Poll results', 'Edit the line:')|escape} {$vote->name|html}"> - <span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic', 'Edit')}</span> - </a> - {if $admin} - <a href="{poll_url id=$admin_poll_id admin=true action='delete_vote' action_value=$vote->id}" - class="btn btn-default btn-sm" - title="{__('Poll results', 'Remove the line:')} {$vote->name|html}"> - <span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{__('Generic', 'Remove')}</span> - </a> - {/if} - </td> + {if $choice==2} + <td class="bg-success text-success" headers="M{$headersM[$k]} D{$headersD[$k]} H{$k}"><span class="glyphicon glyphicon-ok"></span><span class="sr-only">{__('Generic', 'Yes')}</span></td> + {elseif $choice==1} + <td class="bg-warning text-warning" headers="M{$headersM[$k]} D{$headersD[$k]} H{$k}">(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{__('Generic', 'Ifneedbe')}</span></td> {else} - <td></td> + <td class="bg-danger" headers="M{$headersM[$k]} D{$headersD[$k]} H{$k}"><span class="sr-only">{__('Generic', 'No')}</span></td> {/if} + + {/foreach} + + {if $active && !$expired && ($poll->editable == constant('Framadate\Editable::EDITABLE_BY_ALL') or $admin)} + <td class="hidden-print"> + <a href="{if $admin}{poll_url id=$poll->admin_id vote_id=$vote->uniqId admin=true}{else}{poll_url id=$poll->id vote_id=$vote->uniqId}{/if}" class="btn btn-default btn-sm" title="{__('Poll results', 'Edit the line:')|escape} {$vote->name|html}"> + <span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{__('Generic', 'Edit')}</span> + </a> + {if $admin} + <a href="{poll_url id=$admin_poll_id admin=true action='delete_vote' action_value=$vote->id}" + class="btn btn-default btn-sm" + title="{__('Poll results', 'Remove the line:')} {$vote->name|html}"> + <span class="glyphicon glyphicon-remove text-danger"></span><span class="sr-only">{__('Generic', 'Remove')}</span> + </a> + {/if} + </td> + {else} + <td></td> {/if} </tr> + {/if} {/foreach} {* Line to add a new vote *} {if $active && $editingVoteId === 0 && !$expired} - <tr id="vote-form"> + <tr id="vote-form" class="hidden-print"> <td class="bg-info" style="padding:5px"> <div class="input-group input-group-sm"> <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>