mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 11:42:07 +00:00
show live player count on landing page
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
defmodule ChesstrainerWeb.PageController do
|
||||
use ChesstrainerWeb, :controller
|
||||
|
||||
alias Chesstrainer.Attempts
|
||||
alias Chesstrainer.DailyPuzzles
|
||||
alias Chesstrainer.Endgames
|
||||
|
||||
@@ -20,6 +21,7 @@ defmodule ChesstrainerWeb.PageController do
|
||||
endgames: endgames,
|
||||
active_endgame: DailyPuzzles.today(),
|
||||
puzzle_count: Endgames.count_endgames(),
|
||||
user_count: Attempts.count_users_with_attempts(),
|
||||
today: Date.utc_today()
|
||||
)
|
||||
end
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<i>♜</i>
|
||||
</span>
|
||||
<span>
|
||||
<strong>12,400+</strong> players training
|
||||
<strong>{count_label(@user_count)}</strong> players training
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -42,7 +42,7 @@
|
||||
<span>minutes a day</span>
|
||||
</div>
|
||||
<div class="stat">
|
||||
<strong>{puzzle_count_label(@puzzle_count)}</strong>
|
||||
<strong>{count_label(@puzzle_count)}</strong>
|
||||
<span>puzzles</span>
|
||||
</div>
|
||||
<div class="stat">
|
||||
|
||||
Reference in New Issue
Block a user