Skip to content

Commit

Permalink
move Withdraw link to the player's personal page. Closes rchatley#13
Browse files Browse the repository at this point in the history
  • Loading branch information
rchatley committed Sep 8, 2011
1 parent e9ac1b3 commit 5678341
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion features/step_definitions/team_steps.rb
Expand Up @@ -42,7 +42,8 @@
end

When /^I withdraw$/ do
visit '/'
player_uuid = app.players.keys.first
visit "/players/#{player_uuid}"
click_link 'Withdraw'
end

Expand Down
2 changes: 1 addition & 1 deletion lib/extreme_startup/web_server.rb
Expand Up @@ -72,7 +72,7 @@ def to_json(*a)
end

get %r{/players/([\w]+)} do |uuid|
haml :personal_page, :locals => { :name => players[uuid].name, :score => scoreboard.scores[uuid], :log => players[uuid].log[0..25] }
haml :personal_page, :locals => { :name => players[uuid].name, :playerid => uuid, :score => scoreboard.scores[uuid], :log => players[uuid].log[0..25] }
end

get '/players' do
Expand Down
2 changes: 0 additions & 2 deletions views/leaderboard.haml
Expand Up @@ -11,8 +11,6 @@
%li.player
%div{:class => ["ranking", "name"]} #{html_escape(entry.playername)}
%div{:class => ["ranking", "points"]} #{entry.score}
%a{ :href => "/withdraw/#{entry.playerid}" }
Withdraw

:javascript
refresh = function() { window.location.reload(); };
Expand Down
3 changes: 3 additions & 0 deletions views/personal_page.haml
Expand Up @@ -8,6 +8,9 @@
%h2
Your score is:
%span.score #{score}

%a{ :href => "/withdraw/#{playerid}" }
Withdraw

%h2 Log:
%ul
Expand Down

0 comments on commit 5678341

Please sign in to comment.