noosfero | 2 new commits pushed to repository
Antonio Terceiro
gitlab at gitlab.com
Wed Jan 21 16:26:58 BRST 2015
Antonio Terceiro pushed to refs/heads/master at <a href="https://gitlab.com/noosfero/noosfero">Noosfero / noosfero</a>
Commits:
<a href="https://gitlab.com/noosfero/noosfero/commit/b6ca02d8104ac851128f79d937dd96acee23d6d2">b6ca02d8</a> by Luciano
Move hard coded list of profiles from view to SearchHelper
Signed-off-by: Gabriela Navarro <navarro1703 at gmail.com>
Signed-off-by: Luciano Prestes <lucianopcbr at gmail.com>
- - - - -
<a href="https://gitlab.com/noosfero/noosfero/commit/1f3cc39fc0db3bda75203afd974d4c0abd39d367">1f3cc39f</a> by Antonio Terceiro
Merge branch 'move_list_of_profile' into 'master'
Move list of profile
Move list of profiles that are included in the search css to SearchHelper
See merge request !394
- - - - -
Changes:
=====================================
app/helpers/search_helper.rb
=====================================
--- 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'
)
=====================================
app/views/search/_display_results.html.erb
=====================================
--- 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]) %>
- <div class="search-results-innerbox search-results-type-<%= name.to_s.singularize %> <%= 'common-profile-list-block' if [:enterprises, :people, :communities].include?(name) %>">
+ <div class="search-results-innerbox search-results-type-<%= name.to_s.singularize %> <%= 'common-profile-list-block' if SearchHelper::COMMON_PROFILE_LIST_BLOCK.include?(name) %>">
<ul>
<% search[:results].each do |hit| %>
<% partial = partial_for_class(hit.class, display) %>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150121/e7537943/attachment.html>
More information about the Noosfero-dev
mailing list