lock voting when interview status not pending
This commit is contained in:
parent
bc31f6cf17
commit
73df3d1258
@ -3,12 +3,21 @@
|
||||
<% if current_user.acts_as_reviewer? %>
|
||||
<div class="review_meta__votes" data-id="vote-count">
|
||||
<strong>Votes: </strong>
|
||||
<%= link_to admin_up_vote_path(test_hash: @candidate.test_hash), remote: true do %>
|
||||
Yea (<span data-id="up-votes"><%= @candidate.votes.yea.count %></span>)
|
||||
<% end %>
|
||||
<%= link_to admin_down_vote_path(test_hash: @candidate.test_hash), remote: true do %>
|
||||
Nay (<span data-id="down-votes"><%= @candidate.votes.nay.count %></span>)
|
||||
|
||||
<% if @candidate.pending? %>
|
||||
<%= link_to admin_up_vote_path(test_hash: @candidate.test_hash), remote: true do %>
|
||||
Yea (<span data-id="up-votes"><%= @candidate.votes.yea.count %></span>)
|
||||
<% end %>
|
||||
|
||||
<%= link_to admin_down_vote_path(test_hash: @candidate.test_hash), remote: true do %>
|
||||
Nay (<span data-id="down-votes"><%= @candidate.votes.nay.count %></span>)
|
||||
<% end %>
|
||||
<% else %>
|
||||
Voting closed -
|
||||
Yea (<%= @candidate.votes.yea.count %>) -
|
||||
Nay (<%= @candidate.votes.nay.count %>)
|
||||
<% end %>
|
||||
|
||||
<small>(Your vote: <span data-id="my-vote"><%= current_user.my_vote(@candidate) %></span>)</small>
|
||||
</div>
|
||||
<% end %>
|
||||
|
6
db/migrate/20161204213828_remove_vote_locking.rb
Normal file
6
db/migrate/20161204213828_remove_vote_locking.rb
Normal file
@ -0,0 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
class RemoveVoteLocking < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
remove_column :reviewer_votes, :locked, :boolean, default: false, null: false
|
||||
end
|
||||
end
|
@ -80,7 +80,6 @@ ActiveRecord::Schema.define(version: 20161120175737) do
|
||||
t.integer "vote", default: 0, null: false
|
||||
t.integer "veto", default: 0, null: false
|
||||
t.datetime "last_reminded"
|
||||
t.boolean "locked", default: false, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["candidate_id", "user_id"], name: "index_reviewer_votes_on_candidate_id_and_user_id", unique: true, using: :btree
|
||||
|
Loading…
Reference in New Issue
Block a user