<commit_before><%= flash[:login_message] %>

<h1>Listing trips</h1>

<%= search_form_for @search do |f| %>
  <div class="search_results">
    <%= f.text_field :name_cont, placeholder: "Location"%><p>
     <%= f.text_field :budget_gteq, placeholder: "Price from" %> - <%= f.text_field :budget_lteq, placeholder: "To" %>
  </div>
  <br>
  <%= f.submit "Search" %>
<% end %>
<br>
<table>
  <thead>
    <tr>
      <th><%= sort_link @search, :user, "User" %></th>
      <th><%= sort_link @search, :name, "Name" %></th>
      <th><%= sort_link @search, :description, "Description" %></th>
      <th><%= sort_link @search, :budget, "Budget" %></th>
      <th colspan="2"></th>
    </tr>
  </thead>

  <tbody>
    <% @trips.each do |trip| %>
      <tr>
        <td><%= trip.user.username %></td>
        <td><%= link_to trip.name, trip_legs_path(trip) %></td>
        <td><%= trip.description %></td>
        <td><%= trip.budget %></td>
        <td><%= link_to 'Edit', edit_trip_path(trip) %></td>
        <td><%= link_to 'Destroy', trip, method: :delete, data: { confirm: 'Are you sure?' } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to 'New Trip', new_trip_path %>
<commit_msg>add search by location<commit_after><%= flash[:login_message] %>

<h1>Listing trips</h1>

<%= search_form_for @search do |f| %>
  <div class="search_results">
    <%= f.text_field :legs_location_name_cont, placeholder: "Location"%><p>
     <%= f.text_field :budget_gteq, placeholder: "Price from" %> - <%= f.text_field :budget_lteq, placeholder: "To" %>
  </div>
  <br>
  <%= f.submit "Search" %>
<% end %>
<br>
<table>
  <thead>
    <tr>
      <th><%= sort_link @search, :user, "User" %></th>
      <th><%= sort_link @search, :name, "Name" %></th>
      <th><%= sort_link @search, :description, "Description" %></th>
      <th><%= sort_link @search, :budget, "Budget" %></th>
      <th colspan="2"></th>
    </tr>
  </thead>

  <tbody>
    <% @trips.each do |trip| %>
      <tr>
        <td><%= trip.user.username %></td>
        <td><%= link_to trip.name, trip_legs_path(trip) %></td>
        <td><%= trip.description %></td>
        <td><%= trip.budget %></td>
        <td><%= link_to 'Edit', edit_trip_path(trip) %></td>
        <td><%= link_to 'Destroy', trip, method: :delete, data: { confirm: 'Are you sure?' } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to 'New Trip', new_trip_path %>

{'fraction_non_alphanumeric': 0.2399669011170873, 'fraction_numerical': 0.0024824162184526274, 'mean_word_length': 3.1262798634812285, 'pattern_counts': {'":': 0, '<': 123, '<?xml version=': 0, '>': 123, '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': '3926119', 'n_tokens_mistral': 1021, 'n_tokens_neox': 942, 'n_words': 213}