Iker Narvaez

dashboard fixes

......@@ -21,8 +21,10 @@ class ApplicationController < HeimdallEngine::ApplicationController
end
def check_results
return [] unless @current_user
@current_user.bets.join(:matches).order(match: { date: :ASC }).limit(5)
return [] unless current_user
current_user.bets.joins(:match).order('matches.date desc')
.where.not(result: nil)
.limit(5)
end
def recent_matches
......
h1 Leaderboard
table
thead
th Username
th Score
tbody
tr
- @leaders.each do |user, points|
......
header class="mdc-top-app-bar navbar"
header class="mdc-top-app-bar navbar" style='margin-top: -8px; margin-left: -8px;'
div class="mdc-top-app-bar__row"
section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-start"
a href="#" class="material-icons mdc-top-app-bar__navigation-icon" menu
span class="mdc-top-app-bar__title" Title
span class="mdc-top-app-bar__title" Ukko
/a href="#" class="material-icons mdc-top-app-bar__navigation-icon" menu
......
h1 Results
h1 Your most recent 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.match.local
td VS
td = r.match.visit
td = r.points
......
......@@ -5,6 +5,7 @@ table
- @upcoming_matches.each do |u|
td = l(u.date, format: :short)
td = u.local
td VS
td = u.visit
h1 Recent matches
......