From b6ca02d8104ac851128f79d937dd96acee23d6d2 Mon Sep 17 00:00:00 2001 From: Luciano Date: Mon, 15 Dec 2014 17:33:50 -0200 Subject: [PATCH] Move hard coded list of profiles from view to SearchHelper --- app/helpers/search_helper.rb | 8 +++++++- app/views/search/_display_results.html.erb | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index 1f1114e..d536341 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -21,6 +21,12 @@ module SearchHelper 'more_comments' => _('More comments') } + COMMON_PROFILE_LIST_BLOCK = [ + :enterprises, + :people, + :communities + ] + # FIXME remove it after search_controler refactored include EventsHelper @@ -94,7 +100,7 @@ module SearchHelper compact_link = display?(asset, :compact) ? (display == 'compact' ? _('Compact') : link_to(_('Compact'), params.merge(:display => 'compact'))) : nil map_link = display?(asset, :map) ? (display == 'map' ? _('Map') : link_to(_('Map'), params.merge(:display => 'map'))) : nil full_link = display?(asset, :full) ? (display == 'full' ? _('Full') : link_to(_('Full'), params.merge(:display => 'full'))) : nil - content_tag('div', + content_tag('div', content_tag('strong', _('Display')) + ': ' + [compact_link, map_link, full_link].compact.join(' | ').html_safe, :class => 'search-customize-options' ) diff --git a/app/views/search/_display_results.html.erb b/app/views/search/_display_results.html.erb index c95be59..6babcd7 100644 --- a/app/views/search/_display_results.html.erb +++ b/app/views/search/_display_results.html.erb @@ -14,7 +14,7 @@ <% display = display_filter(name, params[:display]) %> -
+
    <% search[:results].each do |hit| %> <% partial = partial_for_class(hit.class, display) %> -- libgit2 0.21.2