Iker Narvaez

dashboard fixes

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