1 <p class="title">Search results</p>
2 <% unless @result.blank? %>
3 <i>Your query "<%= @search_query %>" produced <%= @result.size %> result(s)</i><br>
6 <table class="grid" width="750">
8 <% @result.each do |result| %>
9 <% odd_or_even = cycle('even', 'odd') %>
10 <% if result.class == Folder %>
11 <tr class="<%= odd_or_even %>">
12 <td width="16"><%= image_tag('folder.png') %></td>
14 <%= link_to result.name, :controller => 'folder', :action => 'list', :id => result.id %>
15 <% unless result.is_root %>
16 in <%= path(result.parent, true) %>
20 <% elsif result.class == Myfile %>
21 <tr class="<%= odd_or_even %>">
22 <td width="16"><%= image_tag('file.png') %></td>
23 <td><%= h(result.filename) %> (<%= result.filesize %> KB) in <%= path(result.folder, true) %></td>
25 <%= link_to 'Download', :controller => 'file', :action => 'download', :id => result.id %>
26 <% if result.indexed %>
27 or <%= link_to 'Preview', :controller => 'file', :action => 'preview', :id => result.id, :search => @search_query %>
32 <% highlighted_text = result.highlight(@search_query, { :field => :text, :pre_tag => '[h]', :post_tag => '[/h]' }) %>
33 <% unless highlighted_text.blank? %>
34 <tr class="<%= odd_or_even %>">
35 <td colspan="3" class="smallResult"><%= h(highlighted_text).gsub('[h]', '<b>').gsub('[/h]', '</b>') %></td>
44 <i>Sorry, no results for your query "<%= @search_query %>"</i>