1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00

Nice one liner

This commit is contained in:
Daniel Barber 2018-04-06 15:49:40 -04:00
parent ba70cb5f30
commit 693263fb6d
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8

View File

@ -8,10 +8,7 @@ defmodule ChessWeb.GameView do
end end
def player_colour(conn, game) do def player_colour(conn, game) do
cond do current_user(conn).id == game.user_id && "white" || "black"
current_user(conn).id == game.user_id -> "white"
current_user(conn).id == game.opponent_id -> "black"
end
end end
def opponent(conn, game) do def opponent(conn, game) do