Commit 69ebcc107eb7b3b9bf4980f3216a5006a3ca5257

Authored by JoenioCosta
1 parent 4f4a3b4e

ActionItem512: add more informations in box of map

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2128 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/helpers/search_helper.rb
@@ -40,10 +40,24 @@ module SearchHelper @@ -40,10 +40,24 @@ module SearchHelper
40 end 40 end
41 41
42 def display_profile_info(profile) 42 def display_profile_info(profile)
  43 + # FIXME add distance
  44 + data = ''
  45 + unless profile.contact_email.nil?
  46 + data << content_tag('strong', _('E-Mail:')) + profile.contact_email + '<br/>'
  47 + end
  48 + unless profile.contact_phone.nil?
  49 + data << content_tag('strong', _('Phone:')) + profile.contact_phone + '<br/>'
  50 + end
  51 + unless profile.address.nil?
  52 + data << content_tag('strong', _('Address:')) + profile.address + '<br/>'
  53 + end
43 content_tag('table', 54 content_tag('table',
44 content_tag('tr', 55 content_tag('tr',
45 content_tag('td', content_tag('div', profile_image(profile, :thumb), :class => 'profile-info-picture')) + 56 content_tag('td', content_tag('div', profile_image(profile, :thumb), :class => 'profile-info-picture')) +
46 - content_tag('td', content_tag('strong', profile.name) + '<br/>' + link_to(url_for(profile.url), profile.url) + '<br/>') 57 + content_tag('td', content_tag('strong', profile.name) + '<br/>' +
  58 + link_to(url_for(profile.url), profile.url) + '<br/>' + data +
  59 + link_to(_('Products/Services'), :controller => 'catalog', :profile => profile.identifier)
  60 + )
47 ), 61 ),
48 :class => 'profile-info' 62 :class => 'profile-info'
49 ) 63 )
config/routes.rb
@@ -42,8 +42,8 @@ ActionController::Routing::Routes.draw do |map| @@ -42,8 +42,8 @@ ActionController::Routing::Routes.draw do |map|
42 map.profile 'profile/:profile/:action/:id', :controller => 'profile', :action => 'index', :id => /.*/, :profile => /#{Noosfero.identifier_format}/ 42 map.profile 'profile/:profile/:action/:id', :controller => 'profile', :action => 'index', :id => /.*/, :profile => /#{Noosfero.identifier_format}/
43 43
44 # catalog 44 # catalog
45 - map.catalog 'catalog/:profile', :controller => 'catalog', :action => 'index'  
46 - map.product 'catalog/:profile/:id', :controller => 'catalog', :action => 'show' 45 + map.catalog 'catalog/:profile', :controller => 'catalog', :action => 'index', :profile => /#{Noosfero.identifier_format}/
  46 + map.product 'catalog/:profile/:id', :controller => 'catalog', :action => 'show', :profile => /#{Noosfero.identifier_format}/
47 47
48 ###################################################### 48 ######################################################
49 ## Controllers that are profile-specific (for profile admins ) 49 ## Controllers that are profile-specific (for profile admins )
test/integration/routing_test.rb
@@ -151,4 +151,9 @@ class RoutingTest &lt; ActionController::IntegrationTest @@ -151,4 +151,9 @@ class RoutingTest &lt; ActionController::IntegrationTest
151 assert_routing('/catalog/colivre/1234', :controller => 'catalog', :action => 'show', :profile => 'colivre', :id => '1234') 151 assert_routing('/catalog/colivre/1234', :controller => 'catalog', :action => 'show', :profile => 'colivre', :id => '1234')
152 end 152 end
153 153
  154 + def test_catalog_with_dot_routing
  155 + assert_routing('/catalog/profile.withdot', :controller => 'catalog', :action => 'index', :profile => 'profile.withdot')
  156 + assert_routing('/catalog/profile.withdot/1234', :controller => 'catalog', :action => 'show', :profile => 'profile.withdot', :id => '1234')
  157 + end
  158 +
154 end 159 end