This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/plugins/poll/assets/javascripts/discourse/templates/poll.hbs
Régis Hanol 4714a562d9 FIX: Poll requires logged in user to log in again
FIX: Open/Closing the poll wasn't updating the UI
REFACTOR: ES6 FTW
2015-03-03 16:17:07 +01:00

38 lines
1.1 KiB
Handlebars

<table>
{{#each po in poll.options}}
<tr {{bind-attr class="po.checked:active"}} {{action "selectOption" po.option}}>
<td class="radio">
<input type="radio" name="poll" {{bind-attr checked="po.checked" disabled="disableRadio"}}>
</td>
<td class="option">
<div class="option">{{{po.option}}}</div>
{{#if showResults}}
<div class="result">{{i18n 'poll.voteCount' count=po.votes}}</div>
{{/if}}
</td>
</tr>
{{/each}}
</table>
<div class='row'>
<button {{action "toggleShowResults"}} class="btn btn-small show-results">
{{#if showResults}}
{{fa-icon "eye-slash"}} {{i18n 'poll.results.hide'}}
{{else}}
{{fa-icon "eye"}} {{i18n 'poll.results.show'}}
{{/if}}
</button>
{{#if showToggleClosePoll}}
<button {{action "toggleClosePoll"}} class="btn btn-small toggle-poll">
{{#if poll.closed}}
{{fa-icon "unlock-alt"}} {{i18n 'poll.open_poll'}}
{{else}}
{{fa-icon "lock"}} {{i18n 'poll.close_poll'}}
{{/if}}
</button>
{{/if}}
</div>
{{loading-spinner condition=loading}}