Clean tpl indentation

This commit is contained in:
Olivier PEREZ 2014-12-15 13:29:27 +01:00
parent 083c9eef2f
commit 448a7c2d38

View File

@ -3,7 +3,7 @@
<form action="{$poll_id|poll_url}" method="POST"> <form action="{$poll_id|poll_url}" method="POST">
{* Global informations about the current poll *} {* Global informations about the current poll *}
<div class="jumbotron"> <div class="jumbotron">
<div class="row"> <div class="row">
@ -29,233 +29,233 @@
</div> </div>
</div> </div>
{if !empty($poll->comment)} {if !empty($poll->comment)}
<div class="form-group col-md-7"> <div class="form-group col-md-7">
<h4 class="control-label">{_("Description")}</h4><br /> <h4 class="control-label">{_("Description")}</h4><br />
<p class="form-control-static well">{$poll->comment}</p> <p class="form-control-static well">{$poll->comment}</p>
</div> </div>
{/if} {/if}
</div> </div>
</div> </div>
{* Information about voting *} {* Information about voting *}
{if $poll->active} {if $poll->active}
<div class="alert alert-info"> <div class="alert alert-info">
<p>{_("If you want to vote in this poll, you have to give your name, choose the values that fit best for you and validate with the plus button at the end of the line.")}</p> <p>{_("If you want to vote in this poll, you have to give your name, choose the values that fit best for you and validate with the plus button at the end of the line.")}</p>
<p aria-hidden="true"><b>{_('Legend:')}</b> <span class="glyphicon glyphicon-ok"></span> = {_('Yes')}, <b>(<span class="glyphicon glyphicon-ok"></span>)</b> = {_('Ifneedbe')}, <span class="glyphicon glyphicon-ban-circle"></span> = {_('No')}</p> <p aria-hidden="true"><b>{_('Legend:')}</b> <span class="glyphicon glyphicon-ok"></span> = {_('Yes')}, <b>(<span class="glyphicon glyphicon-ok"></span>)</b> = {_('Ifneedbe')}, <span class="glyphicon glyphicon-ban-circle"></span> = {_('No')}</p>
</div> </div>
{else} {else}
<div class="alert alert-danger"> <div class="alert alert-danger">
<p>{_("The administrator locked this poll, votes and comments are frozen, it's not possible to participate anymore.")}</p> <p>{_("The administrator locked this poll, votes and comments are frozen, it's not possible to participate anymore.")}</p>
<p aria-hidden="true"><b>{_('Legend:')}</b> <span class="glyphicon glyphicon-ok"></span> = {_('Yes')}, <b>(<span class="glyphicon glyphicon-ok"></span>)</b> = {_('Ifneedbe')}, <span class="glyphicon glyphicon-ban-circle"></span> = {_('No')}</p> <p aria-hidden="true"><b>{_('Legend:')}</b> <span class="glyphicon glyphicon-ok"></span> = {_('Yes')}, <b>(<span class="glyphicon glyphicon-ok"></span>)</b> = {_('Ifneedbe')}, <span class="glyphicon glyphicon-ban-circle"></span> = {_('No')}</p>
</div> </div>
{/if} {/if}
{* Scroll left and right *} {* Scroll left and right *}
<div class="hidden row scroll-buttons" aria-hidden="true"> <div class="hidden row scroll-buttons" aria-hidden="true">
<div class="btn-group pull-right"> <div class="btn-group pull-right">
<button class="btn btn-sm btn-link scroll-left" title="{_('Scroll to the left')}"> <button class="btn btn-sm btn-link scroll-left" title="{_('Scroll to the left')}">
<span class="glyphicon glyphicon-chevron-left"></span> <span class="glyphicon glyphicon-chevron-left"></span>
</button> </button>
<button class="btn btn-sm btn-link scroll-right" title="{_('Scroll to the right')}"> <button class="btn btn-sm btn-link scroll-right" title="{_('Scroll to the right')}">
<span class="glyphicon glyphicon-chevron-right"></span> <span class="glyphicon glyphicon-chevron-right"></span>
</button> </button>
</div> </div>
</div> </div>
{* Vote table *} {* Vote table *}
<h3>{_('Votes of the poll')}</h3> <h3>{_('Votes of the poll')}</h3>
<div id="tableContainer" class="tableContainer"> <div id="tableContainer" class="tableContainer">
<table class="results"> <table class="results">
<caption class="sr-only">{_('Votes of the poll')} {$poll->title}</caption> <caption class="sr-only">{_('Votes of the poll')} {$poll->title}</caption>
<thead> <thead>
<tr> <tr>
<th role="presentation"></th> <th role="presentation"></th>
{foreach $slots as $id=>$slot} {foreach $slots as $id=>$slot}
<th colspan="{$slot->moments|count}" class="bg-primary month" id="M{$id}">{$slot->day|date_format:'%B %Y'}</th> <th colspan="{$slot->moments|count}" class="bg-primary month" id="M{$id}">{$slot->day|date_format:'%B %Y'}</th>
{for $foo=0 to ($slot->moments|count)-1} {for $foo=0 to ($slot->moments|count)-1}
{append var='headersM' value=$id} {append var='headersM' value=$id}
{/for} {/for}
{/foreach} {/foreach}
<th></th> <th></th>
</tr> </tr>
<tr> <tr>
<th role="presentation"></th> <th role="presentation"></th>
{foreach $slots as $id=>$slot} {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}</th> <th colspan="{$slot->moments|count}" class="bg-primary day" id="D{$id}">{$slot->day|date_format:$date_format.txt_day}</th>
{/foreach} {/foreach}
<th></th> <th></th>
</tr> </tr>
<tr> <tr>
<th role="presentation"></th> <th role="presentation"></th>
{$headersDCount=0} {$headersDCount=0}
{foreach $slots as $slot} {foreach $slots as $slot}
{foreach $slot->moments as $id=>$moment} {foreach $slot->moments as $id=>$moment}
<th colspan="1" class="bg-info" id="H{$headersDCount}">{$moment}</th> <th colspan="1" class="bg-info" id="H{$headersDCount}">{$moment}</th>
{append var='headersD' value=$headersDCount} {append var='headersD' value=$headersDCount}
{$headersDCount = $headersDCount+1} {$headersDCount = $headersDCount+1}
{/foreach} {/foreach}
{/foreach} {/foreach}
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{foreach $votes as $vote} {foreach $votes as $vote}
<tr> <tr>
{* Edited line *} {* Edited line *}
<th class="bg-info">{$vote->name}</th> <th class="bg-info">{$vote->name}</th>
{if $editingVoteId == $vote->id} {if $editingVoteId == $vote->id}
{foreach $vote->choices as $k=>$choice} {foreach $vote->choices as $k=>$choice}
<td class="bg-info" headers="'.$td_headers[$k].'"> <td class="bg-info" headers="'.$td_headers[$k].'">
<ul class="list-unstyled choice"> <ul class="list-unstyled choice">
<li class="yes"> <li class="yes">
<input type="radio" id="y-choice-{$k}" name="choice{$k}" value="2" {if $choice==2}checked {/if}/> <input type="radio" id="y-choice-{$k}" name="choice{$k}" value="2" {if $choice==2}checked {/if}/>
<label class="btn btn-default btn-xs" for="y-choice-{$k}" title="{_('Vote yes for ')} . $radio_title[$k] . '"> <label class="btn btn-default btn-xs" for="y-choice-{$k}" title="{_('Vote yes for ')} . $radio_title[$k] . '">
<span class="glyphicon glyphicon-ok"></span><span class="sr-only">{_('Yes')}</span> <span class="glyphicon glyphicon-ok"></span><span class="sr-only">{_('Yes')}</span>
</label> </label>
</li> </li>
<li class="ifneedbe"> <li class="ifneedbe">
<input type="radio" id="i-choice-{$k}" name="choice{$k}" value="1" {if $choice==1}checked {/if}/> <input type="radio" id="i-choice-{$k}" name="choice{$k}" value="1" {if $choice==1}checked {/if}/>
<label class="btn btn-default btn-xs" for="i-choice-{$k}" title="{_('Vote ifneedbe for ')} . $radio_title[$k] . '"> <label class="btn btn-default btn-xs" for="i-choice-{$k}" title="{_('Vote ifneedbe for ')} . $radio_title[$k] . '">
(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{_('Ifneedbe')}</span> (<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{_('Ifneedbe')}</span>
</label> </label>
</li> </li>
<li class="no"> <li class="no">
<input type="radio" id="n-choice-{$k}" name="choice{$k}" value="0" {if $choice==0}checked {/if}/> <input type="radio" id="n-choice-{$k}" name="choice{$k}" value="0" {if $choice==0}checked {/if}/>
<label class="btn btn-default btn-xs" for="n-choice-{$k}" title="{_('Vote no for ')} . $radio_title[$k] . '"> <label class="btn btn-default btn-xs" for="n-choice-{$k}" title="{_('Vote no for ')} . $radio_title[$k] . '">
<span class="glyphicon glyphicon-ban-circle"></span><span class="sr-only">{_('No')}</span> <span class="glyphicon glyphicon-ban-circle"></span><span class="sr-only">{_('No')}</span>
</label> </label>
</li> </li>
</ul> </ul>
</td> </td>
<td></td> <td></td>
{/foreach} {/foreach}
{else} {else}
{* Voted line *} {* Voted line *}
{foreach $vote->choices as $k=>$choice} {foreach $vote->choices as $k=>$choice}
{if $choice==2} {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">{_('Yes')}</span></td> <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">{_('Yes')}</span></td>
{else if $choice==1} {else if $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">{_('Ifneedbe')}</span></td> <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">{_('Ifneedbe')}</span></td>
{else} {else}
<td class="bg-danger" headers="M{$headersM[$k]} D{$headersD[$k]} H{$k}"><span class="sr-only">{_('No')}</span></td> <td class="bg-danger" headers="M{$headersM[$k]} D{$headersD[$k]} H{$k}"><span class="sr-only">{_('No')}</span></td>
{/if} {/if}
{/foreach} {/foreach}
{if $poll->active && $poll->editable} {if $poll->active && $poll->editable}
<td> <td>
<input type="hidden" name="edit_vote" value="{$vote->id}"/> <input type="hidden" name="edit_vote" value="{$vote->id}"/>
<button type="submit" class="btn btn-link btn-sm" name="edit_vote" title="{_('Edit the line:')} {$vote->name}"> <button type="submit" class="btn btn-link btn-sm" name="edit_vote" title="{_('Edit the line:')} {$vote->name}">
<span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{_('Edit')}</span> <span class="glyphicon glyphicon-pencil"></span><span class="sr-only">{_('Edit')}</span>
</button> </button>
</td> </td>
{else} {else}
<td></td> <td></td>
{/if} {/if}
{/if} {/if}
</tr> </tr>
{/foreach} {/foreach}
{* Line to add a new vote *} {* Line to add a new vote *}
{if $poll->active && $editingVoteId == 0} {if $poll->active && $editingVoteId == 0}
<tr id="vote-form"> <tr id="vote-form">
<td class="bg-info" style="padding:5px"> <td class="bg-info" style="padding:5px">
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
<span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span> <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
<input type="text" id="nom" name="nom" class="form-control" title="{_('Your name')}" placeholder="{_('Your name')}" /> <input type="text" id="nom" name="nom" class="form-control" title="{_('Your name')}" placeholder="{_('Your name')}" />
</div> </div>
</td> </td>
{$i = 0} {$i = 0}
{foreach $slots as $slot} {foreach $slots as $slot}
{foreach $slot->moments as $moment} {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{$i}">
<ul class="list-unstyled choice"> <ul class="list-unstyled choice">
<li class="yes"> <li class="yes">
<input type="radio" id="y-choice-{$i}" name="choice{$i}" value="2" /> <input type="radio" id="y-choice-{$i}" name="choice{$i}" value="2" />
<label class="btn btn-default btn-xs" for="y-choice-{$i}" title="{_('Vote yes for')} {$slot->day|date_format:$date_format.txt_short} - {$moment}"> <label class="btn btn-default btn-xs" for="y-choice-{$i}" title="{_('Vote yes for')} {$slot->day|date_format:$date_format.txt_short} - {$moment}">
<span class="glyphicon glyphicon-ok"></span><span class="sr-only">{_('Yes')}</span> <span class="glyphicon glyphicon-ok"></span><span class="sr-only">{_('Yes')}</span>
</label> </label>
</li> </li>
<li class="ifneedbe"> <li class="ifneedbe">
<input type="radio" id="i-choice-{$i}" name="choice{$i}" value="1" /> <input type="radio" id="i-choice-{$i}" name="choice{$i}" value="1" />
<label class="btn btn-default btn-xs" for="i-choice-{$i}" title="{_('Vote ifneedbe for')} {$slot->day|date_format:$date_format.txt_short} - {$moment}"> <label class="btn btn-default btn-xs" for="i-choice-{$i}" title="{_('Vote ifneedbe for')} {$slot->day|date_format:$date_format.txt_short} - {$moment}">
(<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{_('Ifneedbe')}</span> (<span class="glyphicon glyphicon-ok"></span>)<span class="sr-only">{_('Ifneedbe')}</span>
</label> </label>
</li> </li>
<li class="no"> <li class="no">
<input type="radio" id="n-choice{$i}" name="choice{$i}" value="0" checked/> <input type="radio" id="n-choice{$i}" name="choice{$i}" value="0" checked/>
<label class="btn btn-default btn-xs" for="n-choice-{$i}" title="{_('Vote no for')} {$slot->day|date_format:$date_format.txt_short} - {$moment}"> <label class="btn btn-default btn-xs" for="n-choice-{$i}" title="{_('Vote no for')} {$slot->day|date_format:$date_format.txt_short} - {$moment}">
<span class="glyphicon glyphicon-ban-circle"></span><span class="sr-only">{_('No')}</span> <span class="glyphicon glyphicon-ban-circle"></span><span class="sr-only">{_('No')}</span>
</label> </label>
</li> </li>
</ul> </ul>
</td> </td>
{$i = $i+1} {$i = $i+1}
{/foreach} {/foreach}
{/foreach} {/foreach}
<td><button type="submit" class="btn btn-success btn-sm" name="add_vote" title="{_('Save the choices')}">{_('Save')}</button></td> <td><button type="submit" class="btn btn-success btn-sm" name="add_vote" title="{_('Save the choices')}">{_('Save')}</button></td>
</tr> </tr>
{/if} {/if}
{* Line displaying best moments *} {* Line displaying best moments *}
{$count_bests = 0} {$count_bests = 0}
<tr id="addition"> <tr id="addition">
<td>{_("Addition")}</td> <td>{_("Addition")}</td>
{$max = max($best_moments)} {$max = max($best_moments)}
{foreach $best_moments as $best_moment} {foreach $best_moments as $best_moment}
{if $max == $best_moment} {if $max == $best_moment}
{$count_bests = $count_bests +1} {$count_bests = $count_bests +1}
<td><span class="glyphicon glyphicon-star text-warning"></span><span>{$max}</span></td> <td><span class="glyphicon glyphicon-star text-warning"></span><span>{$max}</span></td>
{else} {else}
<td></td> <td></td>
{/if} {/if}
{/foreach} {/foreach}
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
{* Best votes listing *} {* Best votes listing *}
{$max = max($best_moments)} {$max = max($best_moments)}
{if $max > 0} {if $max > 0}
<div class="row"> <div class="row">
{if $count_bests == 1} {if $count_bests == 1}
<div class="col-sm-12"><h3>{_("Best choice")}</h3></div> <div class="col-sm-12"><h3>{_("Best choice")}</h3></div>
<div class="col-sm-6 col-sm-offset-3 alert alert-success"> <div class="col-sm-6 col-sm-offset-3 alert alert-success">
<p><span class="glyphicon glyphicon-star text-warning"></span>{_("The best choice at this time is:")}</p> <p><span class="glyphicon glyphicon-star text-warning"></span>{_("The best choice at this time is:")}</p>
{elseif $count_bests > 1} {elseif $count_bests > 1}
<div class="col-sm-12"><h3>{_("Best choices")}</h3></div> <div class="col-sm-12"><h3>{_("Best choices")}</h3></div>
<div class="col-sm-6 col-sm-offset-3 alert alert-success"> <div class="col-sm-6 col-sm-offset-3 alert alert-success">
<p><span class="glyphicon glyphicon-star text-warning"></span>{_("The bests choices at this time are:")}</p> <p><span class="glyphicon glyphicon-star text-warning"></span>{_("The bests choices at this time are:")}</p>
{/if} {/if}
{$i = 0} {$i = 0}
<ul style="list-style:none"> <ul style="list-style:none">
{foreach $slots as $slot} {foreach $slots as $slot}
{foreach $slot->moments as $moment} {foreach $slot->moments as $moment}
{if $best_moments[$i] == $max} {if $best_moments[$i] == $max}
<li><strong>{$slot->day|date_format:$date_format.txt_full} - {$moment}</strong></li> <li><strong>{$slot->day|date_format:$date_format.txt_full} - {$moment}</strong></li>
{/if} {/if}
{$i = $i+1} {$i = $i+1}
{/foreach} {/foreach}
{/foreach} {/foreach}
</ul> </ul>
<p>{_("with")} <b>{$max}</b> {if $max==1}{_('vote')}{else}{_('votes')}{/if}.</p> <p>{_("with")} <b>{$max}</b> {if $max==1}{_('vote')}{else}{_('votes')}{/if}.</p>
</div> </div>
</div> </div>
{/if} {/if}
</form> </form>
{include file='footer.tpl'} {include file='footer.tpl'}