diff --git a/plugins/solr/controllers/public/solr_plugin_public_controller.rb b/plugins/solr/controllers/public/solr_plugin_public_controller.rb new file mode 100644 index 0000000..9e9af04 --- /dev/null +++ b/plugins/solr/controllers/public/solr_plugin_public_controller.rb @@ -0,0 +1,22 @@ +# TODO This controller was created to remove the solr dependencies from +# noosfero controllers. All actions here might not be working as they're +# supposed to. Everything here must be reviewed! + +class SolrPluginPublicController < MyProfileController + + include SolrPlugin::ResultsHelper + + + def facets_browse + @asset = params[:asset].to_sym + @asset_class = asset_class(@asset) + + @facets_only = true + send(@asset) + + @facet = @asset_class.map_facets_for(environment).find { |facet| facet[:id] == params[:facet_id] } + raise 'Facet not found' if @facet.nil? + + render :layout => false + end +end diff --git a/plugins/solr/lib/ext/environment.rb b/plugins/solr/lib/ext/environment.rb new file mode 100644 index 0000000..8c69c80 --- /dev/null +++ b/plugins/solr/lib/ext/environment.rb @@ -0,0 +1,5 @@ +require_dependency 'environment' + +class Environment + settings_items :solr_plugin_top_level_category_as_facet_ids, :type => Array, :default => [] +end diff --git a/plugins/solr/views/search/_facets_unselect_menu.rhtml b/plugins/solr/views/search/_facets_unselect_menu.rhtml new file mode 100644 index 0000000..db1393b --- /dev/null +++ b/plugins/solr/views/search/_facets_unselect_menu.rhtml @@ -0,0 +1,6 @@ +