<commit_before><% content_for(:head) do %>
    <%= javascript_include_tag 'post.js', 'data-turbolinks-track' => true  %>
<% end %>

<h1>Ilmoitukset</h1><br>

<%= form_tag search_path, id: "search", :method => 'get' do%>

    <div class="Row">
      <div class="Column">
        <div class="Column">
          <%= check_box_tag :post_type_buying_value, 'Osto', params[:post_type_buying] %> Etsitään helpperiä
        </div>
        <div class="Column">
          <%= check_box_tag :post_type_selling_value, 'Myynti', params[:post_type_selling] %> Halutaan helpperiksi
        </div>
        <div class="Row">
          <div class="Column">
            Hakusana<br>
            <%= text_field_tag :word, params[:word], size: "11" %>
          </div>
          <div class="Column">
            Kategoria<br>
            <%= select_tag :category_ids, options_for_select(Category.all.collect {|x| [x.name, x.id]}, params[:category_ids]), :multiple => true %>
          </div>
        </div>
        <div class="Row">
          <div class="Column">
            Kaupunki<br>
            <%= text_field_tag :city, params[:city], size: "11" %>
          </div>
          <div class="Column">
            Postinumero<br>
            <%= text_field_tag :zip_code, params[:zip_code], size: "8" %>
          </div>
        </div>
        <div class="Row">
          <div class="Column">
            Palkkio vähintään<br>
            <%= number_field_tag :min, params[:min], min: 0, max: 999 %>
          </div>
          <div class="Column">
            Palkkio enintään<br>
            <%= number_field_tag :max, params[:max], min: 0, max: 999 %>
          </div>
        </div>
        <div class="Row">
          <div class="Column">
            <%= submit_tag "Hae" %>
          </div>
          <div class="Column">
            <%= check_box_tag :remember, true, false %> Muista valintani
          </div>
        </div>
      </div>
    </div>
    <div align="right"><%= collection_select(:table, :id, ["Uusimmat", "Sulkeutumassa", "Pienin palkkio", "Suurin palkkio"], :to_s, :to_s, {:selected => params[:order]}, { :onchange => "changeOrder();return false;"}) %></div>
<% end %><br>

<table class="table table-striped">
  <tbody class="form-group">

  <% @posts.each do |post| %>
      <tr>
        <% if post.image_is_set? %>

            <td ><%= image_tag post.image_url(:list), align: 'left' %></td>
        <% else %>
            <td ><%= image_tag post.category_to_take_image_from.image_url(:list), align: 'left' %></td>

        <% end %>
        <td>
          <p><b><%= link_to truncate(post.title, :length => 30), post %></b></p>
          <% if post.buyer? %>
              <p><span class="selling-badge">Helpperi</span></p>
          <% end %>
          <p>
            <% post.categories.each do |category| %>
                <span class="category-badge"><%= "#{category.name}" %></span>
            <% end %>
          </p>
        </td>
        <td>
          <%= post.city %>
        </td>
        <td><% if post.price %>
              <%= post.price %> €
          <% end %>
        </td>
        <td>[tähdet]</td>
      </tr>
  <% end %>
  </tbody>
</table>

<div class="pagination">
  <%= will_paginate @posts %>
</div>
<commit_msg>konfliktin korjaus<commit_after><% content_for(:head) do %>
    <%= javascript_include_tag 'post.js', 'data-turbolinks-track' => true  %>
<% end %><br>

<%= form_tag search_path, id: "search", :method => 'get' do%>

    <div class="Row">
      <div class="Column">
        <div class="Column">
          <%= check_box_tag :post_type_buying_value, 'Osto', params[:post_type_buying] %> Etsitään helpperiä
        </div>
        <div class="Column">
          <%= check_box_tag :post_type_selling_value, 'Myynti', params[:post_type_selling] %> Halutaan helpperiksi
        </div>
        <div class="Row">
          <div class="Column">
            Hakusana<br>
            <%= text_field_tag :word, params[:word], size: "11" %>
          </div>
          <div class="Column">
            Kategoria<br>
            <%= select_tag :category_ids, options_for_select(Category.all.collect {|x| [x.name, x.id]}, params[:category_ids]), :multiple => true %>
          </div>
        </div>
        <div class="Row">
          <div class="Column">
            Kaupunki<br>
            <%= text_field_tag :city, params[:city], size: "11" %>
          </div>
          <div class="Column">
            Postinumero<br>
            <%= text_field_tag :zip_code, params[:zip_code], size: "8" %>
          </div>
        </div>
        <div class="Row">
          <div class="Column">
            Palkkio<br>
            <%= number_field_tag :min, params[:min], min: 0, max: 499, placeholder: "min" %> -
            <%= number_field_tag :max, params[:max], min: 0, max: 499, placeholder: "max" %>
          </div>
        </div>
        <div class="Row">
          <div class="Column">
            <%= submit_tag "Hae" %>
          </div>
          <div class="Column">
            <%= check_box_tag :remember, true, false %> Muista valintani
          </div>
        </div>
      </div>
    </div>
    <div align="right"><%= collection_select(:table, :id, ["Uusimmat", "Sulkeutumassa", "Pienin palkkio", "Suurin palkkio"], :to_s, :to_s, {:selected => params[:order]}, { :onchange => "changeOrder();return false;"}) %></div>
<% end %><br>

<table class="table table-striped">
  <tbody class="form-group">

  <% @posts.each do |post| %>
      <tr>
        <% if post.image_is_set? %>

            <td ><%= image_tag post.image_url(:list), align: 'left' %></td>
        <% else %>
            <td ><%= image_tag post.category_to_take_image_from.image_url(:list), align: 'left' %></td>

        <% end %>
        <td>
          <p><b><%= link_to truncate(post.title, :length => 30), post %></b></p>
          <% if post.buyer? %>
              <p><span class="selling-badge">Helpperi</span></p>
          <% end %>
          <p>
            <% post.categories.each do |category| %>
                <span class="category-badge"><%= "#{category.name}" %></span>
            <% end %>
          </p>
        </td>
        <td>
          <%= post.city %>
        </td>
        <td><% if post.price %>
              <%= post.price %> €
          <% end %>
        </td>
        <td>[tähdet]</td>
      </tr>
  <% end %>
  </tbody>
</table>

<div class="pagination">
  <%= will_paginate @posts %>
</div>

{'fraction_non_alphanumeric': 0.19240348692403486, 'fraction_numerical': 0.0049813200498132005, 'mean_word_length': 2.0079588014981273, 'pattern_counts': {'":': 0, '<': 218, '<?xml version=': 0, '>': 230, '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': '945584', 'n_tokens_mistral': 2320, 'n_tokens_neox': 2147, 'n_words': 437}