<%= erb :'partials/search' %>
<% if errors.empty? %> <% if params[:q] %>

Showing results for <%= params[:q] %>:

<% end %>
<% if results.empty? %>

No results!

<% end %> <% results.each do |result| %>
<% if params[:type] == "threads" %> <%= external_link( "http://board.vivalavinyl.com/thread/view/#{result[:remote_id]}", result[:title] ) %>

created by <%= result[:creator] %> on <%= result[:created_at].strftime('%B %d, %Y') %> last post by <%= result[:last_post_creator] %> at <%= result[:last_post_created_at].strftime('%-I:%M %p EST') %> on <%= result[:last_post_created_at].strftime('%B %-d, %Y') %>

<% elsif params[:type] == "posts" %>

In thread: <%= external_link( "http://board.vivalavinyl.com/thread/view/#{result[:remote_thread_id]}#post_#{result[:remote_id]}", result[:thread_title] ) %>

<%= result[:creator] %> posted this at <%= result[:created_at] %>

<%= truncate(result[:body]) %>

<% end %>
<% end %> <% if params[:q] %> <% if params[:page] > 1 %> previous page <% end %> <% unless results.empty? || next_url.nil? %> next page <% end %> <% end %>
<% else %>

Error(s):

<% errors.each do |error| %>

<%= error %>

<% end %>
<% end %>