From 13049b9b3d60a3bbacf369fc408f8d72b599ce8c Mon Sep 17 00:00:00 2001 From: "Jesse C. Fisher" Date: Tue, 30 Jun 2015 06:08:17 -0700 Subject: [PATCH] Logic for whether game has started --- app/views/games/show.html.haml | 35 ++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/app/views/games/show.html.haml b/app/views/games/show.html.haml index 10c1870b..74c8963d 100644 --- a/app/views/games/show.html.haml +++ b/app/views/games/show.html.haml @@ -42,21 +42,24 @@ // Show the card TODO hide values of cards of other players = [card.rank, card.suit].join(' ') -.table - - if @game.current_hand - %h1 Hand to beat - - else - %h1 Open table - %h2 - Played - - @game.plays.last.player_cards.each do |card| - = card.to_s +-# TODO better logic, not in view +- unless @game.status == nil + .table + - if @game.current_hand + %h1 Hand to beat + - else + %h1 Open table + %h2 + Played + - if @game.plays.count > 0 + - @game.plays.last.player_cards.each do |card| + = card.to_s -.controls - - if @game.control_user == current_user - // Play hand form - = form_for @game, :url => play_hand_game_path(@game) do |f| - // Provide id of current game - -#= f.hidden_field :id - = f.submit "Play Hand" + .controls + - if @game.control_user == current_user + // Play hand form + = form_for @game, :url => play_hand_game_path(@game) do |f| + // Provide id of current game + -#= f.hidden_field :id + = f.submit "Play Hand"