diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index c5d327b..aad35b2 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -48,6 +48,10 @@ class PollsController < ApplicationController redirect_to polls_url end + def showvotes + raise AccessError unless cuser.admin? + end + private def get_poll diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index 44552ee..eebdaa6 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -1 +1,4 @@ -<%= render :partial => "show" %> \ No newline at end of file +<%= render :partial => "show" %> +<% if cuser && cuser.admin? %> + <%= link_to "Show votes", polls_showvotes_url(@poll) ,class: "button" %> +<% end %> \ No newline at end of file diff --git a/app/views/polls/showvotes.html.erb b/app/views/polls/showvotes.html.erb new file mode 100644 index 0000000..f644c7e --- /dev/null +++ b/app/views/polls/showvotes.html.erb @@ -0,0 +1,16 @@ +
Player | +voted for | +Time | +
---|---|---|
<%= namelink vote.user %> | +<%= vote.votable%> | +