psanchezp

basic root

//
.container {
display: grid;
grid-template-rows: 10vh auto;
grid-template-columns: auto auto auto;
}
.navbar {
grid-row: 1;
grid-columns: 1/4;
}
.content {
grid-row: 2;
justify-self: center;
}
.left {
grid-column: 1;
}
.center {
grid-column: 2;
}
.right {
grid-column: 3;
}
\ No newline at end of file
......@@ -2,7 +2,7 @@ class ApplicationController < HeimdallEngine::ApplicationController
protect_from_forgery with: :exception
def root
@leaderboard = check_leaderboard
@leaders = check_leaderboard
@upcoming_matches = check_matches
@results = check_results
end
......@@ -10,7 +10,7 @@ class ApplicationController < HeimdallEngine::ApplicationController
private
def check_leaderboard
User.all.order_by(&:user_score).take(5)
(User.all.sort {|a,b| a.user_score <=> b.user_score }).take(5)
end
def check_matches
......
h1 Leaderboard
table
thead
th Username
th Score
tbody
tr
- @leaders.each do |l|
td = l.name
td = l.user_score
\ No newline at end of file
h1 Results
table
thead
th Team 1
th Team 2
th Points obtained
tbody
tr
- @results.each do |r|
td = r.local
td = r.visit
td = r.points
h1 Upcoming matches
table
thead
th Team 1
th Team 2
th Date
tbody
tr
- @upcoming_matches.each do |u|
td = u.local
td = u.visit
td = u.date
\ No newline at end of file
.container
.navbar
.left.content
- if @current_user
= render 'login'
- else
= render 'results'
.center.content
= render 'leaderboard'
.right.content
= render 'upcoming_matches'
\ No newline at end of file