psanchezp

Merge branch 'master' of git.ukko.mx:psanchezp/quiniela-mundial

......@@ -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.leaderboard
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" aria-label="Home" alt="Home" home
section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end"
a href="/bets" class="material-icons mdc-top-app-bar__navigation-icon" aria-label="Attach_Money" alt="Attach_Money" attach_money
a href="/logout" class="material-icons mdc-top-app-bar__navigation-icon" aria-label="Exit_to_app" alt="Exit_to_app" exit_to_app
\ No newline at end of file
/ <section class="mdc-top-app-bar__section mdc-top-app-bar__section--align-end" role="toolbar">
/ <a href="#" class="material-icons mdc-top-app-bar__action-item" aria-label="Download" alt="Download">file_download</a>
/ <a href="#" class="material-icons mdc-top-app-bar__action-item" aria-label="Print this page" alt="Print this page">print</a>
/ <a href="#" class="material-icons mdc-top-app-bar__action-item" aria-label="Bookmark this page" alt="Bookmark this page">bookmark</a>
/ </section>
......
h1 Results
table.results
thead
th Team 1
th Team 2
th Points obtained
h1 Your most recent results
table
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
tr
td = l(u.date, format: :short)
td = u.local
td VS
td = u.visit
h1 Recent matches
......