Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

Commit

Permalink
Hide challenge buttons on own profile page
Browse files Browse the repository at this point in the history
  • Loading branch information
proglottis committed Mar 21, 2013
1 parent a0b5e6b commit a2a60eb
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions app/views/profiles/show.html.erb
Expand Up @@ -21,15 +21,17 @@
<%= div_for @tournaments do |tournament| %>
<div class="clearfix">
<%= link_to tournament.name, tournament_path(tournament) %>
<div class="btn-group pull-right">
<%= link_to t(Challenge.model_name.human), new_challenge_path(:defender_id => @user, :tournament_id => tournament), :class => 'btn' %>
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><%= link_to t('tournaments.show.log_a_game'), new_game_path(:tournament_id => tournament, :user_id => @user) %></li>
</ul>
</div>
<% if current_user != @user %>
<div class="btn-group pull-right">
<%= link_to t(Challenge.model_name.human), new_challenge_path(:defender_id => @user, :tournament_id => tournament), :class => 'btn' %>
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><%= link_to t('tournaments.show.log_a_game'), new_game_path(:tournament_id => tournament, :user_id => @user) %></li>
</ul>
</div>
<% end %>
</div>
<%= div_for tournament, :class => "plot", :style => "height:100px;", :'data-ratings' => tournament.glicko2_ratings.where(:user_id => [current_user.id, @user.id]).map {|rating| {:rating => rating.rating, :rating_deviation => rating.rating_deviation, :user_name => rating.user.name}}.to_json do %><% end %>
<% end %>
Expand Down

0 comments on commit a2a60eb

Please sign in to comment.