Poll Plugin: Don't allow voting on closed topics.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<table>
|
||||
{{#each poll.options}}
|
||||
<tr {{bind-attr class=checked:active}} {{action selectOption option}}>
|
||||
<td class="radio"><input type="radio" name="poll" {{bind-attr checked=checked disabled=controller.loading}}></td>
|
||||
<td class="radio"><input type="radio" name="poll" {{bind-attr checked=checked disabled=controller.disableRadio}}></td>
|
||||
<td class="option">
|
||||
<div class="option">
|
||||
{{{ option }}}
|
||||
|
||||
@@ -38,8 +38,14 @@ var PollController = Discourse.Controller.extend({
|
||||
poll: null,
|
||||
showResults: false,
|
||||
|
||||
disableRadio: Em.computed.any('poll.post.topic.closed', 'loading'),
|
||||
|
||||
actions: {
|
||||
selectOption: function(option) {
|
||||
if (this.get('disableRadio')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.get('currentUser.id')) {
|
||||
this.get('postController').send('showLogin');
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user