Commit 8bc4669ddfed2a8872e9eed708960dd76c2f3463

Authored by Braulio Bhavamitra
1 parent c0ae7ebe

Single column searchs

Showing 1 changed file with 4 additions and 16 deletions   Show diff stats
app/views/search/_display_results.rhtml
1 <div id="search-results" class="<%= 'only-one-result-box' if @results.size == 1 %>"> 1 <div id="search-results" class="<%= 'only-one-result-box' if @results.size == 1 %>">
2 2
3 -<%  
4 - pos2 = :odd # allow to format in a two columns layout  
5 - pos3 = 3 # allow to format in a thre columns layout  
6 -%>  
7 <% @order.each do |name| %> 3 <% @order.each do |name| %>
8 <% results = @results[name] %> 4 <% results = @results[name] %>
9 - <%  
10 - pos3 += 1; pos3 = 1 if pos3 > 3  
11 - pos2==:odd ? pos2=:even : pos2=:odd  
12 - %>  
13 <% if !results.nil? and !results.empty? %> 5 <% if !results.nil? and !results.empty? %>
14 - <div class="search-results-<%= name %> search-results-box <%= pos2 %> <%= 'col%s_of3' % pos3.to_s %>"> 6 + <div class="search-results-<%= name %> search-results-box">
15 <% if @controller.action_name != 'assets' %> 7 <% if @controller.action_name != 'assets' %>
16 <% if @results.size != 1 %> 8 <% if @results.size != 1 %>
17 <h3> 9 <h3>
@@ -36,13 +28,9 @@ @@ -36,13 +28,9 @@
36 <div class="search-results-innerbox search-results-type-<%= partial %> <%= 'common-profile-list-block' if partial == 'profile' %>"> 28 <div class="search-results-innerbox search-results-type-<%= partial %> <%= 'common-profile-list-block' if partial == 'profile' %>">
37 <div class="search-results-innerbox2"><!-- the innerbox2 is a workarround for MSIE --> 29 <div class="search-results-innerbox2"><!-- the innerbox2 is a workarround for MSIE -->
38 <ul> 30 <ul>
39 - <% hit_pos = 0 %>  
40 <% results.each do |hit| %> 31 <% results.each do |hit| %>
41 - <% next if hit.respond_to?(:visible) && !hit.visible? %>  
42 - <%= render :partial => partial_for_class(hit.class),  
43 -  
44 - :object => hit,  
45 - :locals => { :pos => ( hit_pos += 1 ) } %> 32 + <% next if hit.respond_to?(:visible) && !hit.visible? %>
  33 + <%= render :partial => partial_for_class(hit.class), :object => hit %>
46 <% end %> 34 <% end %>
47 </ul> 35 </ul>
48 <hr /> 36 <hr />
@@ -50,7 +38,7 @@ @@ -50,7 +38,7 @@
50 </div><!-- end class="search-results-innerbox" --> 38 </div><!-- end class="search-results-innerbox" -->
51 </div><!-- end class="search-results-<%= name %>" --> 39 </div><!-- end class="search-results-<%= name %>" -->
52 <% else %> 40 <% else %>
53 - <div class="search-results-<%= name %> search-results-empty search-results-box <%= pos2 %> <%= 'col%s_of3' % pos3.to_s %>"> 41 + <div class="search-results-<%= name %> search-results-empty search-results-box">
54 <% if @controller.action_name != 'assets' %> 42 <% if @controller.action_name != 'assets' %>
55 <% if @results.size != 1 %> 43 <% if @results.size != 1 %>
56 <h3><%= @names[name] %></h3> 44 <h3><%= @names[name] %></h3>