<%=h @team.name %>

<% if @team.logo %> <% end %> <% if cuser && cuser.teamers %> <%= form_for @teamer do |f| %> <%= f.error_messages %> <%= f.hidden_field :user_id, :value => cuser.id %> <%= f.hidden_field :team_id, :value => @team.id %> <% if cuser.teamers.joining.count == 0 && @team.active %>
<%= f.submit "Request To Join", class: 'button' %>
<% elsif cuser.teamers.joining.first.team != @team %>
<%= f.submit "Request To Join", class: 'button', data: { confirm: "You have already requested to join #{cuser.teamers.joining.first.team}. Do you want to request to join #{@team} instead?" } %>
<% end %> <% end %> <% end %>
IRC:
<%=h @team.irc %>
Web:
<%=h @team.web %>
Tag:
<%=h @team.tag %>
Country:
<%=h @team.country %>
Founder:
<%= namelink @team.founder %>
Comment:
<%=h @team.comment %>
<% if @team.recruiting %>
Recruiting:
<%=h @team.recruiting %>
<% end %>
<%= link_to "Send a message", { controller: "messages", action: "new", id: "Team", id2: @team }, { class: 'button tiny' } %>
<% if @team.teamers.active.ordered.distinct.length > 0 %>

Current Members

<%= render partial: "teamers/list", locals: { teamers: @team.teamers.active.ordered.distinct, blacklist: false, comment: true } %> <% end %> <% if @team.teamers.past.distinct.length > 0 %>

Past Members

<%= render partial: "teamers/list", locals: { teamers: @team.teamers.past.distinct, blacklist: @team.teamers.active.ordered.distinct, comment: false } %> <% end %>
<% @team.contesters.chronological.each do |contester| %> <% next if Match.finished.ordered.of_contester(contester).count == 0 %>

<%= link_to contester.contest, contester.contest, :name => "contest_#{contester.contest.id}" %>

<%= render partial: "matches/list", locals: { matches: Match.finished.ordered.of_contester(contester), friendly: contester.team, contest: false } %> <% end %>
Matches:
<%= @team.matches_finished.count %> played / <%= @team.matches.count %> total
Won:
<%= @team.matches_won.count %> (<%= 100.0*@team.matches_won.count/@team.matches_finished.count %> %)
Lost:
<%= @team.matches_lost.count %> (<%= 100.0*@team.matches_lost.count/@team.matches_finished.count %> %)
Draw:
<%= @team.matches_draw.count %> (<%= 100.0*@team.matches_draw.count/@team.matches_finished.count %> %)
<% if cuser and @team.can_update? cuser %>
<%= link_to 'Edit Team', edit_team_path(@team), class: 'button' %>
<% end %>