From baf90832bf5ba942f0c6acd11b4f3b5fd6a0f1c9 Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Wed, 6 Jul 2011 13:00:14 +0000 Subject: [PATCH] Fix "Display in map" search view --- app/helpers/search_helper.rb | 2 +- app/views/search/_results_header.rhtml | 8 ++++++-- app/views/search/communities.rhtml | 4 +++- app/views/search/enterprises.rhtml | 4 +++- app/views/search/people.rhtml | 4 +++- app/views/search/products.rhtml | 4 +++- public/stylesheets/application.css | 9 ++++++--- 7 files changed, 25 insertions(+), 10 deletions(-) diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index f2c5e89..15dc0b0 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -85,7 +85,7 @@ module SearchHelper content_tag('table', content_tag('tr', content_tag('td', content_tag('div', image_tag(product.image ? product.image.public_filename(:thumb) : '/images/icons-app/product-default-pic-portrait.png'), :class => 'profile-info-picture')) + - content_tag('td', content_tag('strong', link_to(product.name, :controller => 'catalog', :profile => product.enterprise.identifier, :action => 'show', :id => product)) + '
' + data) + content_tag('td', content_tag('strong', link_to(product.name, :controller => 'catalog', :profile => product.enterprise.identifier, :id => product.id)) + '
' + data) ), :class => 'profile-info') end diff --git a/app/views/search/_results_header.rhtml b/app/views/search/_results_header.rhtml index 8d41410..4191434 100644 --- a/app/views/search/_results_header.rhtml +++ b/app/views/search/_results_header.rhtml @@ -1,6 +1,10 @@
<%= label_total_found(asset, results.total_entries) %> - <%= _("Showing page %s of %s") % [results.current_page, results.total_pages] %>
+ <% if params[:display] != 'map' %> + <%= _("Showing page %s of %s") % [results.current_page, results.total_pages] %> + <% end %> + <%= facets_unselect_menu(asset) %> - <%= order_by(asset) %> + + <%= order_by(asset) if params[:display] != 'map' %> diff --git a/app/views/search/communities.rhtml b/app/views/search/communities.rhtml index 5b87dee..0cbfa27 100644 --- a/app/views/search/communities.rhtml +++ b/app/views/search/communities.rhtml @@ -21,7 +21,9 @@ <%# FIXME ARMENGUE %> <%= display_results(false) %> - <%= pagination_links @results.values.first %> + <% if params[:display] != 'map' %> + <%= pagination_links @results.values.first %> + <% end %>
diff --git a/app/views/search/enterprises.rhtml b/app/views/search/enterprises.rhtml index 6adb59b..01feb91 100644 --- a/app/views/search/enterprises.rhtml +++ b/app/views/search/enterprises.rhtml @@ -34,6 +34,8 @@ <% end %> -<%= pagination_links @results[:enterprises] %> +<% if params[:display] != 'map' %> + <%= pagination_links @results[:enterprises] %> +<% end %>
diff --git a/app/views/search/people.rhtml b/app/views/search/people.rhtml index efcd50c..df0514f 100644 --- a/app/views/search/people.rhtml +++ b/app/views/search/people.rhtml @@ -15,6 +15,8 @@ <%# FIXME ARMENGUE %> <%= display_results(false) %> -<%= pagination_links @results.values.first %> +<% if params[:display] != 'map' %> + <%= pagination_links @results.values.first %> +<% end %>
diff --git a/app/views/search/products.rhtml b/app/views/search/products.rhtml index a03a92e..95a165a 100644 --- a/app/views/search/products.rhtml +++ b/app/views/search/products.rhtml @@ -24,6 +24,8 @@ <% end %> -<%= pagination_links @results[:products] %> +<% if params[:display] != 'map' %> + <%= pagination_links @results[:products] %> +<% end %>
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 437c59d..90752ba 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1890,6 +1890,9 @@ input.disabled { #map { height: 500px; } +.map { + clear: both; +} /*********************************************************** * style for blocks ***********************************************************/ @@ -4615,7 +4618,7 @@ float: right; overflow: auto; } -.search-results-type-product li.product-item { +li.product-item { position: relative; height: 60px; overflow: hidden; @@ -6313,7 +6316,7 @@ float: right; color: #007788; font-size: 1.2em; } -.controller-search #content #search-results .search-results-type-product li.product-item { +li.product-item { display:block; float:none overflow:visible; @@ -6323,7 +6326,7 @@ float: right; height:auto; max-height:none; } -.controller-search .search-results-innerbox li.product-item hr { +li.product-item hr { display:block; margin:0; clear: both; -- libgit2 0.21.2