Commit c3a2bee33987ea1e6b0def4ce43f84300f403f3a
1 parent
c4582941
Exists in
master
and in
29 other branches
Small fixes
Showing
7 changed files
with
7 additions
and
29 deletions
Show diff stats
app/helpers/search_helper.rb
... | ... | @@ -70,7 +70,7 @@ module SearchHelper |
70 | 70 | if display?(asset, display) |
71 | 71 | display |
72 | 72 | else |
73 | - item.default_search_display | |
73 | + item.class.default_search_display | |
74 | 74 | end |
75 | 75 | end |
76 | 76 | |
... | ... | @@ -88,6 +88,7 @@ module SearchHelper |
88 | 88 | end |
89 | 89 | |
90 | 90 | def display_selector(asset, display, float = 'right') |
91 | + display ||= asset_class(asset).default_search_display | |
91 | 92 | if [display?(asset, :map), display?(asset, :compact), display?(asset, :full)].select {|option| option}.count > 1 |
92 | 93 | compact_link = display?(asset, :compact) ? (display == 'compact' ? _('Compact') : link_to(_('Compact'), params.merge(:display => 'compact'))) : nil |
93 | 94 | map_link = display?(asset, :map) ? (display == 'map' ? _('Map') : link_to(_('Map'), params.merge(:display => 'map'))) : nil | ... | ... |
app/models/article.rb
app/models/product.rb
app/models/profile.rb
app/views/search/category_index.rhtml
... | ... | @@ -4,8 +4,7 @@ |
4 | 4 | <div id="category-image"><%= image_tag(@category.image.public_filename(:thumb), :id => 'category-image') if @category.image %></div> |
5 | 5 | <% end %> |
6 | 6 | |
7 | - <%= search_page_title(_('Search Results'), @category) %> | |
8 | - <%= render :partial => 'search_form', :locals => { :hint => '' } %> | |
7 | + <h1><%= _("Category Index") %></h1> | |
9 | 8 | <%= category_context(@category, params) %> |
10 | 9 | <%= display_results @searches %> |
11 | 10 | ... | ... |
plugins/solr/controllers/public/solr_plugin_public_controller.rb
... | ... | @@ -1,22 +0,0 @@ |
1 | -# TODO This controller was created to remove the solr dependencies from | |
2 | -# noosfero controllers. All actions here might not be working as they're | |
3 | -# supposed to. Everything here must be reviewed! | |
4 | - | |
5 | -class SolrPluginPublicController < MyProfileController | |
6 | - | |
7 | - include SolrPlugin::ResultsHelper | |
8 | - | |
9 | - | |
10 | - def facets_browse | |
11 | - @asset = params[:asset].to_sym | |
12 | - @asset_class = asset_class(@asset) | |
13 | - | |
14 | - @facets_only = true | |
15 | - send(@asset) | |
16 | - | |
17 | - @facet = @asset_class.map_facets_for(environment).find { |facet| facet[:id] == params[:facet_id] } | |
18 | - raise 'Facet not found' if @facet.nil? | |
19 | - | |
20 | - render :layout => false | |
21 | - end | |
22 | -end |
plugins/solr/views/search/_facets_menu.html.erb
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 | |
24 | 24 | <% if facet_count > less_options_limit %> |
25 | 25 | <%= link_to_function _("Options"), |
26 | - "facet_options_toggle('#{facet[:id].to_s}', '#{url_for(params.merge(:action => 'facets_browse', :facet_id => facet[:id], :asset => @asset, :escape => false))}'); " + | |
26 | + "facet_options_toggle('#{facet[:id].to_s}', '#{url_for(params.merge(:controller => 'solr_plugin_controller' :action => 'facets_browse', :facet_id => facet[:id], :asset => @asset, :escape => false))}'); " + | |
27 | 27 | "jQuery(this).toggleClass('facet-less-options')", :class => "facet-options-toggle" %> |
28 | 28 | <br /> |
29 | 29 | <% end %> | ... | ... |