<commit_before>
<%= title @team.name %>

<%= content_tag_for :div, @team, class: "row" do %>
  <div class="row">
    <div class="span8">
      <h1><%= @team.name %></h1>
    </div>
    <div class="pull-right">
      <% if can? :join, @team %>
      <%= simple_form_for [@team, @membership] do |f| %>
        <%= f.submit t("team.join.action"), class: "btn header-btn" %>
      <% end %>
    <% end %>

    <% if can? :manage, @team %>
      <%= link_to t("team.edit.action"), edit_team_path(@team), class: "btn header-btn" %>
      <%= link_to t("team.delete.action"), delete_team_path(@team), class: "btn header-btn" %>
    <% end %>
    </div>
  </div>

  <p>
    <%# user a presenter for this %>
    Created by: <%= mail_to @team.captain.email, @team.captain.username %>
  </p>
  <p>
    Business Size: <%= @team.business_size %>
  </p>
  <%= simple_format @team.description %>

  <h2>Members (<%= @team.memberships_count %>)</h2>

  <table class="memberships table table-striped table-bordered table-hover">
    <thead>
      <tr>
        <th>Username</th>
        <th>Trips</th>
        <th>Miles</th>

        <% if can? :manage, @team %>
          <th class="span2 hidden-phone">Status</th>
          <th class="span3 hidden-phone">Actions</th>
        <% end %>
      </tr>
    </thead>

    <% @team.memberships.each do |membership| %>
      <%= content_tag_for :tr, membership, class: ("warning" unless membership.approved?) do %>
        <td class="span3"><%= membership.user.username %></td>
        <td class="muted">Coming soon</td>
        <td class="muted">Coming soon</td>

        <% if can? :manage, @team %>
          <td class="hidden-phone"><%= membership.approved? ? "Approved" : "Pending" %></td>

          <td class="hidden-phone">
            <% unless membership.approved? %>
              <i class="icon-plus"></i>
              <%= link_to t("team.join.approve_action"), team_membership_path(@team, membership, membership: { approved: true }), data: { method: :put } %>
            <% end %>

            <%= link_to delete_team_membership_path(@team, membership) do %>
              <i class="icon-trash"></i>
              <%= t("membership.delete.action") %>
            <% end %>
          </td>
        <% end %>
      <% end %>
    <% end %>
  </table>

  <div>
    <% if @team.competitors.any? %>
      <h3>Current Competitions</h3>

      <table class="table table-striped table-bordered table-hover">
        <thead>
          <tr>
            <th class="span3">Name</th>
            <th>Description</th>
            <th class="span3 hidden-phone">Actions</th>
          </tr>
        </thead>

        <% @team.competitors.each do |competitor|%>
          <%= content_tag_for :tr, competitor do %>
            <td><%= competitor.competition.title %></td>
            <td><%= simple_format competitor.competition.description.truncate(200) %></td>

            <td class="hidden-phone">
              <% if can? :manage, competitor %>
                <%= link_to delete_competition_competitor_path(competitor.competition, competitor) do %>
                  <i class="icon-trash"></i>
                  <%= t("competitor.delete.action") %>
                <% end %>
              <% end %>
            </td>
          <% end %>
        <% end %>
      </table>
    <% end %>

    <% if can?(:manage, @team) && @team.available_competitions.any? %>
      <h3>Join a Competition</h3>

      <table class="table table-striped table-bordered table-hover">
        <% @team.available_competitions.each do |competition|%>
          <thead>
            <tr><commit_msg>Restrict action column to team managers:<commit_after>
<%= title @team.name %>

<%= content_tag_for :div, @team, class: "row" do %>
  <div class="row">
    <div class="span8">
      <h1><%= @team.name %></h1>
    </div>
    <div class="pull-right">
      <% if can? :join, @team %>
      <%= simple_form_for [@team, @membership] do |f| %>
        <%= f.submit t("team.join.action"), class: "btn header-btn" %>
      <% end %>
    <% end %>

    <% if can? :manage, @team %>
      <%= link_to t("team.edit.action"), edit_team_path(@team), class: "btn header-btn" %>
      <%= link_to t("team.delete.action"), delete_team_path(@team), class: "btn header-btn" %>
    <% end %>
    </div>
  </div>

  <p>
    <%# user a presenter for this %>
    Created by: <%= mail_to @team.captain.email, @team.captain.username %>
  </p>
  <p>
    Business Size: <%= @team.business_size %>
  </p>
  <%= simple_format @team.description %>

  <h2>Members (<%= @team.memberships_count %>)</h2>

  <table class="memberships table table-striped table-bordered table-hover">
    <thead>
      <tr>
        <th>Username</th>
        <th>Trips</th>
        <th>Miles</th>

        <% if can? :manage, @team %>
          <th class="span2 hidden-phone">Status</th>
          <th class="span3 hidden-phone">Actions</th>
        <% end %>
      </tr>
    </thead>

    <% @team.memberships.each do |membership| %>
      <%= content_tag_for :tr, membership, class: ("warning" unless membership.approved?) do %>
        <td class="span3"><%= membership.user.username %></td>
        <td class="muted">Coming soon</td>
        <td class="muted">Coming soon</td>

        <% if can? :manage, @team %>
          <td class="hidden-phone"><%= membership.approved? ? "Approved" : "Pending" %></td>

          <td class="hidden-phone">
            <% unless membership.approved? %>
              <i class="icon-plus"></i>
              <%= link_to t("team.join.approve_action"), team_membership_path(@team, membership, membership: { approved: true }), data: { method: :put } %>
            <% end %>

            <%= link_to delete_team_membership_path(@team, membership) do %>
              <i class="icon-trash"></i>
              <%= t("membership.delete.action") %>
            <% end %>
          </td>
        <% end %>
      <% end %>
    <% end %>
  </table>

  <div>
    <% if @team.competitors.any? %>
      <h3>Current Competitions</h3>

      <table class="table table-striped table-bordered table-hover">
        <thead>
          <tr>
            <th class="span3">Name</th>
            <th>Description</th>
            <% if can? :manage, @team %>
              <th class="span3 hidden-phone">Actions</th>
            <% end %>
          </tr>
        </thead>

        <% @team.competitors.each do |competitor|%>
          <%= content_tag_for :tr, competitor do %>
            <td><%= competitor.competition.title %></td>
            <td><%= simple_format competitor.competition.description.truncate(200) %></td>
            <% if can? :manage, @team %>
              <td class="hidden-phone">
                <%= link_to delete_competition_competitor_path(competitor.competition, competitor) do %>
                  <i class="icon-trash"></i>
                  <%= t("competitor.delete.action") %>
                <% end %>
              </td>
            <% end %>
          <% end %>
        <% end %>
      </table>
    <% end %>

    <% if can?(:manage, @team) && @team.available_competitions.any? %>
      <h3>Join a Competition</h3>

      <table class="table table-striped table-bordered table-hover">
        <% @team.available_competitions.each do |competition|%>
          <thead>
            <tr>
{'fraction_non_alphanumeric': 0.18643602416254806, 'fraction_numerical': 0.004667764964305327, 'mean_word_length': 2.1400862068965516, 'pattern_counts': {'":': 0, '<': 245, '<?xml version=': 0, '>': 245, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5498727', 'n_tokens_mistral': 2572, 'n_tokens_neox': 2306, 'n_words': 473}