Sha256: 4bd8318cf765c0a2a08c6d373d4e3398e9ebeab28c56c3b83799746b73d2b3a5

Contents?: true

Size: 1.16 KB

Versions: 8

Compression:

Stored size: 1.16 KB

Contents

.clear
.poll{:id => "poll_ui_#{poll.id}"}
  - has_voted = logged_in? && poll.voted?(current_user)

  %table.poll
    %thead
      %tr
        %th{:colspan => 2}
          .right
            =:total_votes.l
            = poll.votes.size
          = poll.question
    -poll.choices.each do |choice|
      %tr
        -if @is_current_user || has_voted
          %td.bars
            .bar-container
              .bar{:style => "width:#{choice.votes_percentage}%"}
                ="#{choice.votes_percentage}%"
        %td
          - if logged_in? && !has_voted
            = link_to_remote :vote.l, { :url => votes_path(:choice_id => choice), :method => :post, :loading => "$$('table.poll').invoke('addClassName', 'loading')"}, {:title => :vote.l, :class => 'vote'} 
          - elsif !logged_in?
            = link_to :vote.l, new_vote_path(:post_id => poll.post.id), {:title => :log_in_to_vote.l, :class => 'vote'}
          = choice.description
    -if !has_voted
      %tr
        %td{:colspan => 2}
          %small.quiet= :you_must_vote_to_see_the_results.l
    -elsif logged_in?
      %tr
        %td{:colspan => 2}
          %small.quiet= :you_have_already_voted.l
      

.clear
%br

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
community_engine-2.3.2 app/views/polls/_poll_ui.html.haml
community_engine-2.3.1 app/views/polls/_poll_ui.html.haml
community_engine-2.3.0 app/views/polls/_poll_ui.html.haml
community_engine-2.1.0 app/views/polls/_poll_ui.html.haml
community_engine-2.0.0 app/views/polls/_poll_ui.html.haml
community_engine-2.0.0.beta3 app/views/polls/_poll_ui.html.haml
community_engine-2.0.0.beta2 app/views/polls/_poll_ui.html.haml
community_engine-2.0.0.beta1 app/views/polls/_poll_ui.html.haml