Sha256: 72613a1c5bf96e6df96464d7dc83317c683f78b61d66ab4c49348e7813f66de3

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

<div class="vote_wrapper">

  <% if user_signed_in? %>

    <% up_selected =  current_user.voted_for?(@question) ? 'selected' : "" %>
    <%= link_to('Vote Question Up', vote_question_path(@question, vote_type: 'up'), method: :put, remote: true, class: "vote up #{up_selected}") %>

    <div class="count"><%= @question.plusminus %></div>

    <% down_selected = current_user.voted_against?(@question) ? 'selected' : "" %>
    <%= link_to('Vote Question Down', vote_question_path(@question, vote_type: 'down'), method: :put, remote: true, class: "vote down #{down_selected}") %>

  <% else %>

    <%= link_to('Vote Question Up', '#', class: "vote up login_flash") %>
    <div class="count"><%= @question.plusminus %></div>
    <%= link_to('Vote Question Down', '#', class: "vote down login_flash") %>

  <% end %>

</div>

<% unless user_signed_in? %>
  <div class="hidden flash" id="flash_notice">
    You must <%= link_to 'login', main_app.new_user_session_path %> or <%= link_to 'signup', main_app.new_user_registration_path %> in order to vote
  </div>
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rostra-0.0.3 app/views/rostra/shared/_votes.html.erb
rostra-0.0.2 app/views/rostra/shared/_votes.html.erb
rostra-0.0.1 app/views/rostra/shared/_votes.html.erb