From e6aac9aea3c4f4843dde6764a0ecf9c36d12ed18 Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Wed, 26 Oct 2011 11:28:13 -0200 Subject: [PATCH] Fix css clearing for all searches --- app/views/search/_article.rhtml | 3 ++- app/views/search/_blog.rhtml | 2 +- app/views/search/_display_results.rhtml | 72 ++++++++++++++++++++++++++++++++++++------------------------------------ app/views/search/_event.rhtml | 3 ++- app/views/search/_folder.rhtml | 3 ++- app/views/search/_forum.rhtml | 2 +- app/views/search/_gallery.rhtml | 4 +++- app/views/search/_google_maps.rhtml | 2 +- app/views/search/_search_form.rhtml | 61 ++++++++++++++++++++++++++++++------------------------------- app/views/search/_text_article.rhtml | 3 ++- app/views/search/_uploaded_file.rhtml | 3 ++- app/views/search/articles.rhtml | 2 +- app/views/search/communities.rhtml | 2 +- app/views/search/enterprises.rhtml | 2 +- app/views/search/index.rhtml | 3 ++- app/views/search/people.rhtml | 2 +- app/views/search/products.rhtml | 3 +-- app/views/search/tag.rhtml | 1 + 18 files changed, 90 insertions(+), 83 deletions(-) diff --git a/app/views/search/_article.rhtml b/app/views/search/_article.rhtml index 2304bab..3648fd8 100644 --- a/app/views/search/_article.rhtml +++ b/app/views/search/_article.rhtml @@ -6,5 +6,6 @@
-
+ +
diff --git a/app/views/search/_blog.rhtml b/app/views/search/_blog.rhtml index a3dee5a..da5558b 100644 --- a/app/views/search/_blog.rhtml +++ b/app/views/search/_blog.rhtml @@ -19,5 +19,5 @@ <%= render :partial => 'article_last_change', :object => blog %> -
+
diff --git a/app/views/search/_display_results.rhtml b/app/views/search/_display_results.rhtml index 7c4a100..9489186 100644 --- a/app/views/search/_display_results.rhtml +++ b/app/views/search/_display_results.rhtml @@ -1,42 +1,42 @@
-<% @order.each do |name| %> - <% results = @results[name] %> - <% if !results.nil? and !results.empty? %> -
- - <% if @results.size > 1 %> -

<%= @names[name] %>

- <%= link_to(results.respond_to?(:total_entries) ? _('see all (%d)') % results.total_entries : _('see all...'), - params.merge(:action => name), :class => 'see-more' ) %> - <% end %> - - <% partial = partial_for_class(results.first.class.class_name.constantize) %> -
-
-
    - <% results.each do |hit| %> - <%= render :partial => partial_for_class(hit.class), :object => hit %> - <% end %> -
+ <% @order.each do |name| %> + <% results = @results[name] %> + <% if !results.nil? and !results.empty? %> +
+ + <% if @results.size > 1 %> +

<%= @names[name] %>

+ <%= link_to(results.respond_to?(:total_entries) ? _('see all (%d)') % results.total_entries : _('see all...'), + params.merge(:action => name), :class => 'see-more' ) %> + <% end %> + + <% partial = partial_for_class(results.first.class.class_name.constantize) %> +
+
+
    + <% results.each do |hit| %> + <%= render :partial => partial_for_class(hit.class), :object => hit %> + <% end %> +
+
+
+
+ +
+ <% else %> +
+ <% if @results.size > 1 %> +

<%= @names[name] %>

+ <% end %> +
+
<%= _('None') %>

-
-
- -
- <% else %> -
- <% if @results.size > 1 %> -

<%= @names[name] %>

- <% end %> -
-
<%= _('None') %>
-
-
-
+
+
+ <% end %> <% end %> -<% end %> - -
+ +
diff --git a/app/views/search/_event.rhtml b/app/views/search/_event.rhtml index de7d97a..911a40b 100644 --- a/app/views/search/_event.rhtml +++ b/app/views/search/_event.rhtml @@ -19,5 +19,6 @@ <%= render :partial => 'article_common', :object => event %> -
+ +
diff --git a/app/views/search/_folder.rhtml b/app/views/search/_folder.rhtml index e35e72c..35866da 100644 --- a/app/views/search/_folder.rhtml +++ b/app/views/search/_folder.rhtml @@ -15,5 +15,6 @@ <%= render :partial => 'article_common', :object => folder %> -
+ +
diff --git a/app/views/search/_forum.rhtml b/app/views/search/_forum.rhtml index 1ce7b6d..a6caa85 100644 --- a/app/views/search/_forum.rhtml +++ b/app/views/search/_forum.rhtml @@ -16,5 +16,5 @@ <%= render :partial => 'article_common', :object => forum %> -
+
diff --git a/app/views/search/_gallery.rhtml b/app/views/search/_gallery.rhtml index e036ccb..7b50c86 100644 --- a/app/views/search/_gallery.rhtml +++ b/app/views/search/_gallery.rhtml @@ -6,5 +6,7 @@
<%= render :partial => 'article_common', :object => gallery %>
-
+ +
+ diff --git a/app/views/search/_google_maps.rhtml b/app/views/search/_google_maps.rhtml index d2a7ff0..ace7851 100644 --- a/app/views/search/_google_maps.rhtml +++ b/app/views/search/_google_maps.rhtml @@ -1,4 +1,4 @@ -
+
diff --git a/app/views/search/_search_form.rhtml b/app/views/search/_search_form.rhtml index e956dc1..fc2b884 100644 --- a/app/views/search/_search_form.rhtml +++ b/app/views/search/_search_form.rhtml @@ -1,38 +1,37 @@
-<% form_tag( { :controller => 'search', :action => @asset ? @asset : 'index', :asset => nil, :category_path => ( @category ? @category.explode_path : [] ) }, - :method => 'get', :class => 'search_form' ) do %> - - <%= hidden_field_tag :display, params[:display] %> - -
- - <%= text_field_tag 'query', @query, :id => 'search-input', :size => 50 %> - <%= javascript_tag "jQuery('#search-input').attr('title', \"#{hint}\").hint()" if defined?(hint) %> - <%= javascript_tag "jQuery('.search_form').submit(function() { - if (jQuery('#search-input').val().length < 3) { - jQuery('#search-empty-query-error').slideDown(200).delay(2500).slideUp(200); - return false; - } - });" %> - - - <%= submit_button(:search, _('Search')) %> - -
- <%= _("Type more than 2 characters to start a search") %> + <% form_tag( { :controller => 'search', :action => @asset ? @asset : 'index', :asset => nil, :category_path => ( @category ? @category.explode_path : [] ) }, + :method => 'get', :class => 'search_form' ) do %> + + <%= hidden_field_tag :display, params[:display] %> + +
+ + <%= text_field_tag 'query', @query, :id => 'search-input', :size => 50 %> + <%= javascript_tag "jQuery('#search-input').attr('title', \"#{hint}\").hint()" if defined?(hint) %> + <%= javascript_tag "jQuery('.search_form').submit(function() { + if (jQuery('#search-input').val().length < 3) { + jQuery('#search-empty-query-error').slideDown(200).delay(2500).slideUp(200); + return false; + } + });" %> + + + <%= submit_button(:search, _('Search')) %> + +
+ <%= _("Type more than 2 characters to start a search") %> +
-
- - <% if @empty_query %> - <% hint = environment.search_hints[@asset] %> - <% if hint and !hint.blank? %> - <%= hint %> + + <% if @empty_query %> + <% hint = environment.search_hints[@asset] %> + <% if hint and !hint.blank? %> + <%= hint %> + <% end %> <% end %> + <% end %>
- -<% end %> - -
+
diff --git a/app/views/search/_text_article.rhtml b/app/views/search/_text_article.rhtml index 964aca2..8b76f44 100644 --- a/app/views/search/_text_article.rhtml +++ b/app/views/search/_text_article.rhtml @@ -6,5 +6,6 @@
<%= render :partial => 'article_common', :object => text_article %>
-
+ +
diff --git a/app/views/search/_uploaded_file.rhtml b/app/views/search/_uploaded_file.rhtml index c97a983..16717dd 100644 --- a/app/views/search/_uploaded_file.rhtml +++ b/app/views/search/_uploaded_file.rhtml @@ -32,5 +32,6 @@ <%= render :partial => 'article_categories', :object => uploaded_file.categories %> <%= render :partial => 'article_last_change', :object => uploaded_file %> -
+ +
diff --git a/app/views/search/articles.rhtml b/app/views/search/articles.rhtml index a131214..f47efa6 100644 --- a/app/views/search/articles.rhtml +++ b/app/views/search/articles.rhtml @@ -16,4 +16,4 @@ <% end %> -
+
diff --git a/app/views/search/communities.rhtml b/app/views/search/communities.rhtml index f27d23a..91a2d83 100644 --- a/app/views/search/communities.rhtml +++ b/app/views/search/communities.rhtml @@ -21,5 +21,5 @@ <%= pagination_links @results.values.first %> -
+
diff --git a/app/views/search/enterprises.rhtml b/app/views/search/enterprises.rhtml index 5c0d57b..e8bfedf 100644 --- a/app/views/search/enterprises.rhtml +++ b/app/views/search/enterprises.rhtml @@ -25,4 +25,4 @@ <% end %> -
+
diff --git a/app/views/search/index.rhtml b/app/views/search/index.rhtml index c8544e5..f3eacd5 100644 --- a/app/views/search/index.rhtml +++ b/app/views/search/index.rhtml @@ -25,4 +25,5 @@ -
+ +
diff --git a/app/views/search/people.rhtml b/app/views/search/people.rhtml index 50ed044..adb29fd 100644 --- a/app/views/search/people.rhtml +++ b/app/views/search/people.rhtml @@ -16,4 +16,4 @@ <% end %> -
+
diff --git a/app/views/search/products.rhtml b/app/views/search/products.rhtml index 513b393..4e7afc0 100644 --- a/app/views/search/products.rhtml +++ b/app/views/search/products.rhtml @@ -21,5 +21,4 @@ <% end %> - -
+
diff --git a/app/views/search/tag.rhtml b/app/views/search/tag.rhtml index 390d06e..c414ad8 100644 --- a/app/views/search/tag.rhtml +++ b/app/views/search/tag.rhtml @@ -18,4 +18,5 @@ <%= pagination_links @tagged, :param_name => 'npage' %> +
<% end %> -- libgit2 0.21.2