diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index 5612969..9d1ae17 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -40,10 +40,24 @@ module SearchHelper
end
def display_profile_info(profile)
+ # FIXME add distance
+ data = ''
+ unless profile.contact_email.nil?
+ data << content_tag('strong', _('E-Mail:')) + profile.contact_email + '
'
+ end
+ unless profile.contact_phone.nil?
+ data << content_tag('strong', _('Phone:')) + profile.contact_phone + '
'
+ end
+ unless profile.address.nil?
+ data << content_tag('strong', _('Address:')) + profile.address + '
'
+ end
content_tag('table',
content_tag('tr',
content_tag('td', content_tag('div', profile_image(profile, :thumb), :class => 'profile-info-picture')) +
- content_tag('td', content_tag('strong', profile.name) + '
' + link_to(url_for(profile.url), profile.url) + '
')
+ content_tag('td', content_tag('strong', profile.name) + '
' +
+ link_to(url_for(profile.url), profile.url) + '
' + data +
+ link_to(_('Products/Services'), :controller => 'catalog', :profile => profile.identifier)
+ )
),
:class => 'profile-info'
)
diff --git a/config/routes.rb b/config/routes.rb
index fc57a2d..c9925d5 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -42,8 +42,8 @@ ActionController::Routing::Routes.draw do |map|
map.profile 'profile/:profile/:action/:id', :controller => 'profile', :action => 'index', :id => /.*/, :profile => /#{Noosfero.identifier_format}/
# catalog
- map.catalog 'catalog/:profile', :controller => 'catalog', :action => 'index'
- map.product 'catalog/:profile/:id', :controller => 'catalog', :action => 'show'
+ map.catalog 'catalog/:profile', :controller => 'catalog', :action => 'index', :profile => /#{Noosfero.identifier_format}/
+ map.product 'catalog/:profile/:id', :controller => 'catalog', :action => 'show', :profile => /#{Noosfero.identifier_format}/
######################################################
## Controllers that are profile-specific (for profile admins )
diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb
index 24919a1..803da3d 100644
--- a/test/integration/routing_test.rb
+++ b/test/integration/routing_test.rb
@@ -151,4 +151,9 @@ class RoutingTest < ActionController::IntegrationTest
assert_routing('/catalog/colivre/1234', :controller => 'catalog', :action => 'show', :profile => 'colivre', :id => '1234')
end
+ def test_catalog_with_dot_routing
+ assert_routing('/catalog/profile.withdot', :controller => 'catalog', :action => 'index', :profile => 'profile.withdot')
+ assert_routing('/catalog/profile.withdot/1234', :controller => 'catalog', :action => 'show', :profile => 'profile.withdot', :id => '1234')
+ end
+
end
--
libgit2 0.21.2