<commit_before><h1>Manage <em><a href="/tribes/<%= @tribe.slug %>"><%= @tribe.name %></a></em></h1>

<p>View your tribe's <a href="/messengers/<%= @tribe.slug %>">messenger activity</a>.</p>

<table>
  <tcaption>General</tcaption>
  <tr>
    <td>Name:</td>
    <td><%= @tribe.name %></td>
    <td></td>
  </tr>
  <tr>
    <td>Land:</td>
    <td><%= @tribe.land %> square mile<%= "s" if @tribe.land > 1 %></td>
    <td>
      <form action="/tribes/<%= @tribe.slug %>/land" method="post">
        <input type="hidden" name="_method" value="patch">
        <input type="number" name="amount">
        <input type="submit" value="Buy">
        ($<%= @land_price %>/mi<sup>2</sup>)
      </form>
    </td>
  </tr>
  <tr>
    <td>Technology:</td>
    <td><%= @tribe.technology %></td>
  </tr>
</table>

<table>
  <tcaption>Finances</tcaption>
  <tr>
    <td>Tribe net worth:</td>
    <td>$<%= @tribe.money %></td>
    <td></td>
  </tr>
  <tr>
    <td>Collectible taxes:</td>
    <td>$<%= @tribe.population.taxes %></td>
    <td>
      <form action="/tribes/<%= @tribe.slug %>/taxes" method="post">
        <input type="hidden" name="_method" value="patch">
        <input type="submit" value="Collect">
      </form>
    </td>
  </tr>
</table>

<table>
  <tcaption>Census</tcaption>
  <tr>
    <td>Total population:</td>
    <td><%= @tribe.population.total %></td>
  </tr>
  <tr>
    <td>Warriors:</td>
    <td><%= @tribe.warriors %></td>
  </tr>
  <tr>
    <td>Farmers:</td>
    <td><%= @tribe.farmers %></td>
  </tr>
  <tr>
    <td>Priests:</td>
    <td><%= @tribe.priests %></td>
  </tr>
  <tr>
    <td>Happiness:</td>
    <td><%= @tribe.happiness %></td>
  </tr>
</table>

<table>
  <tcaption>Resources</tcaption>
  <thead>
    <tr>
      <th>#</th>
      <th>Resource Type</th>
    </tr>
  </thead>
  <tbody>
    <% if @tribe.resources.empty? %>
      <tr>
        <td></td>
        <td><em>You have no resources.</em></td>
      </tr>
    <% else %>
      <% @tribe.list_resources.each do |resource_name| %>
        <tr>
          <td><%= @tribe.count_resource(resource_name) %></td>
          <td><%= resource_name.capitalize %></td>
        </tr>
      <% end %>
    <% end %>
  </tbody>
</table>

<table>
  <tcaption>Infrastructure</tcaption>
  <thead>
    <tr>
      <th>#</th>
      <th>Building Type</th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <% if @tribe.buildings.empty? %>
      <tr>
        <td></td>
        <td><em>You have no buildings.</em></td>
        <td></td>
      </tr>
    <% else %>
      <% @tribe.buildings.uniq.each do |building| %>
        <tr>
          <td><%= @tribe.count_building(building.name) %></td>
          <td><%= building.name %></td>
          <td>
            <form action="/tribes/<%= @tribe.slug %>/buildings" method="post">
              <input type="hidden" name="_method" value="patch">
              <input type="hidden" name="building_name" value="<%= building.name %>">
              <input type="submit" value="<%= building.action.capitalize %>">
            </form>
          </td>
        </tr>
      <% end %>
    <% end %>
  </tbody>
  <tfoot>
    <form action="/tribes/<%= @tribe.slug %>/buildings" method="post">
    <tr>
      <td></td>
      <td>
        <select name="building_name">
          <% @buildings.each do |building| %>
            <option value="<%= building.name %>"><%= building.name.capitalize %>: $<%= building.price %> + <%= building.resource_amount %> <%= building.resource_name %></option>
          <% end %>
        </select>
      </td>
      <td>
        <input type="submit" value="Buy">
      </td>
    </tr>
  </form>
  </tfoot>
</table><commit_msg>only show use button if building is usable<commit_after><h1>Manage <em><a href="/tribes/<%= @tribe.slug %>"><%= @tribe.name %></a></em></h1>

<p>View your tribe's <a href="/messengers/<%= @tribe.slug %>">messenger activity</a>.</p>

<table>
  <tcaption>General</tcaption>
  <tr>
    <td>Name:</td>
    <td><%= @tribe.name %></td>
    <td></td>
  </tr>
  <tr>
    <td>Land:</td>
    <td><%= @tribe.land %> square mile<%= "s" if @tribe.land > 1 %></td>
    <td>
      <form action="/tribes/<%= @tribe.slug %>/land" method="post">
        <input type="hidden" name="_method" value="patch">
        <input type="number" name="amount">
        <input type="submit" value="Buy">
        ($<%= @land_price %>/mi<sup>2</sup>)
      </form>
    </td>
  </tr>
  <tr>
    <td>Technology:</td>
    <td><%= @tribe.technology %></td>
  </tr>
</table>

<table>
  <tcaption>Finances</tcaption>
  <tr>
    <td>Tribe net worth:</td>
    <td>$<%= @tribe.money %></td>
    <td></td>
  </tr>
  <tr>
    <td>Collectible taxes:</td>
    <td>$<%= @tribe.population.taxes %></td>
    <td>
      <form action="/tribes/<%= @tribe.slug %>/taxes" method="post">
        <input type="hidden" name="_method" value="patch">
        <input type="submit" value="Collect">
      </form>
    </td>
  </tr>
</table>

<table>
  <tcaption>Census</tcaption>
  <tr>
    <td>Total population:</td>
    <td><%= @tribe.population.total %></td>
  </tr>
  <tr>
    <td>Warriors:</td>
    <td><%= @tribe.warriors %></td>
  </tr>
  <tr>
    <td>Farmers:</td>
    <td><%= @tribe.farmers %></td>
  </tr>
  <tr>
    <td>Priests:</td>
    <td><%= @tribe.priests %></td>
  </tr>
  <tr>
    <td>Happiness:</td>
    <td><%= @tribe.happiness %></td>
  </tr>
</table>

<table>
  <tcaption>Resources</tcaption>
  <thead>
    <tr>
      <th>#</th>
      <th>Resource Type</th>
    </tr>
  </thead>
  <tbody>
    <% if @tribe.resources.empty? %>
      <tr>
        <td></td>
        <td><em>You have no resources.</em></td>
      </tr>
    <% else %>
      <% @tribe.list_resources.each do |resource_name| %>
        <tr>
          <td><%= @tribe.count_resource(resource_name) %></td>
          <td><%= resource_name.capitalize %></td>
        </tr>
      <% end %>
    <% end %>
  </tbody>
</table>

<table>
  <tcaption>Infrastructure</tcaption>
  <thead>
    <tr>
      <th>#</th>
      <th>Building Type</th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <% if @tribe.buildings.empty? %>
      <tr>
        <td></td>
        <td><em>You have no buildings.</em></td>
        <td></td>
      </tr>
    <% else %>
      <% @tribe.buildings.uniq.each do |building| %>
        <tr>
          <td><%= @tribe.count_building(building.name) %></td>
          <td><%= building.name %></td>
          <td>
            <% if building.usable? %>
              <form action="/tribes/<%= @tribe.slug %>/buildings" method="post">
                <input type="hidden" name="_method" value="patch">
                <input type="hidden" name="building_name" value="<%= building.name %>">
                <input type="submit" value="<%= building.action.capitalize %>">
              </form>
            <% end %>
          </td>
        </tr>
      <% end %>
    <% end %>
  </tbody>
  <tfoot>
    <form action="/tribes/<%= @tribe.slug %>/buildings" method="post">
    <tr>
      <td></td>
      <td>
        <select name="building_name">
          <% @buildings.each do |building| %>
            <option value="<%= building.name %>"><%= building.name.capitalize %>: $<%= building.price %> + <%= building.resource_amount %> <%= building.resource_name %></option>
          <% end %>
        </select>
      </td>
      <td>
        <input type="submit" value="Buy">
      </td>
    </tr>
  </form>
  </tfoot>
</table>
{'fraction_non_alphanumeric': 0.24137464483831686, 'fraction_numerical': 0.0010823975104857259, 'mean_word_length': 2.24780316344464, 'pattern_counts': {'":': 0, '<': 459, '<?xml version=': 0, '>': 461, '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': '1433083', 'n_tokens_mistral': 2976, 'n_tokens_neox': 2802, 'n_words': 521}