From d01c0ccf107713841a6995d9fa41242c7d1abd28 Mon Sep 17 00:00:00 2001 From: "Jesse C. Fisher" Date: Thu, 24 Oct 2019 19:51:28 -0700 Subject: [PATCH] Add confirm alert to pass or stand from seat --- app/views/tables/_seat.html.haml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/tables/_seat.html.haml b/app/views/tables/_seat.html.haml index 8acf124..ba95a60 100644 --- a/app/views/tables/_seat.html.haml +++ b/app/views/tables/_seat.html.haml @@ -4,7 +4,8 @@ - if seat.occupied? - if seat.occupied_by? current_user = button_to "Stand", - stand_seat_path(seat) + stand_seat_path(seat), + :data => { :confirm => 'Are you sure you want to leave this seat?' } - else = button_to "Sit", sit_seat_path(seat) @@ -33,6 +34,7 @@ data: {value: card.id, card_name: card.rank.gsub('11','J') .gsub('12','Q') .gsub('13','K') .gsub('14','A') .gsub('15','2') + ' ' + card.suit}} %img{src: "/assets/cards/png/" + (card.rank.gsub('J','jack').gsub('Q','queen').gsub('K','king').gsub('A','ace') + '_of_' + card.suit.downcase + "s.png").gsub('11','jack') .gsub('12','queen') .gsub('13','king') .gsub('14','ace') .gsub('15','2') } - %input{type: "submit", value: "Play Hand", name: "hand_type"} - %input{type: "submit", value: "Pass", name: "hand_type"} + %input{type: "submit", value: "Play Hand", name: "hand_type"} + %input{type: "submit", value: "Pass", name: "hand_type", + :data => { :confirm => 'Are you sure you want to pass?' }}