Skip to content

Commit de7f2f6

Browse files
committed
Add results page
1 parent f61e88d commit de7f2f6

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

app/controllers/home_controller.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
class HomeController < ApplicationController
2-
3-
def dash
4-
@nominees = Nominee.all
5-
end
6-
72
def index
83
@vote = Vote.new
94
end
10-
115
end

app/views/home/results.html.haml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.row
2+
.col-xs-12.col-sm-12.col-sm-offset-0.col-md-8.col-md-offset-2
3+
.nominations
4+
%table.table.table-striped.table-hover.table-responsive
5+
%tbody
6+
- Nominee.all.each_with_index do |nominee, index|
7+
%tr
8+
%td.nominee-name
9+
%h4
10+
%strong= "#{index + 1}."
11+
%td.nominee-name
12+
%h4
13+
= nominee.name
14+
%br
15+
= link_to "@#{nominee.login}", "https://github.com/#{nominee.login}", class: 'small', target: '_blank'
16+
%br
17+
%br
18+
= t('votes', count: nominee.votes_count)
19+
20+
%td.nominee-reason
21+
- nominee.votes.each do |vote|
22+
.clearfix
23+
= vote.reason
24+
25+
= link_to vote.voter.name, "https://github.com/#{vote.voter.login}", class: 'pull-right voter-name', target: '_blank'

config/routes.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
get '/gems', to: 'home#gems'
44
get '/dash', to: 'home#dash'
5+
get "/results-#{ENV['RESULTS_TOKEN']}", to: 'home#results'
56

67
resources 'votes', only: :create
78

0 commit comments

Comments
 (0)