Commit 28011292d60072a593b6b5a3d6f36555ad599ce8
1 parent
5e1647a9
Exists in
master
and in
29 other branches
ActionItem512: add distance to google map information block
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2148 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
app/helpers/search_helper.rb
... | ... | @@ -48,7 +48,6 @@ module SearchHelper |
48 | 48 | end |
49 | 49 | |
50 | 50 | def display_profile_info(profile) |
51 | - # FIXME add distance | |
52 | 51 | data = '' |
53 | 52 | unless profile.contact_email.nil? |
54 | 53 | data << content_tag('strong', _('E-Mail: ')) + profile.contact_email + '<br/>' |
... | ... | @@ -65,6 +64,9 @@ module SearchHelper |
65 | 64 | unless profile.products.empty? |
66 | 65 | data << content_tag('strong', _('Products/Services: ')) + profile.products.map{|i| link_to(i.name, :controller => 'catalog', :profile => profile.identifier, :action => 'show', :id => i)}.join(', ') + '<br/>' |
67 | 66 | end |
67 | + if profile.respond_to?(:distance) and !profile.distance.nil? | |
68 | + data << content_tag('strong', _('Distance: ')) + "%.2f%" % profile.distance + '<br/>' | |
69 | + end | |
68 | 70 | content_tag('table', |
69 | 71 | content_tag('tr', |
70 | 72 | content_tag('td', content_tag('div', profile_image(profile, :thumb), :class => 'profile-info-picture')) + | ... | ... |