From 17cff0555257a000ea3dbf37290b9947ac239a10 Mon Sep 17 00:00:00 2001 From: JoenioCosta Date: Mon, 9 Jun 2008 21:27:52 +0000 Subject: [PATCH] ActionItem265: added profile photo --- app/helpers/search_helper.rb | 20 ++++++++++++++++++++ app/views/search/_google_maps.rhtml | 6 +++--- test/unit/search_helper.rb | 14 ++++++++++++++ 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 test/unit/search_helper.rb diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index b82f26e..cafb82e 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -39,4 +39,24 @@ module SearchHelper content_tag('div', data[:toggle] + (render :partial => data[:partial]), :class => "map-or-list-search-results #{data[:class]}") end + def display_profile_info(profile) + profile = Enterprise.find :first + table_rows = '' + profile.summary.each do |item| + name = item[0] + value = item[1] + if value.is_a?(Proc) + value = self.instance_eval(value) + end + table_rows << content_tag('tr', content_tag('td', _(name)) + content_tag('td', value)) + 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('table', table_rows)) + ), + :class => 'profile-info' + ) + end + end diff --git a/app/views/search/_google_maps.rhtml b/app/views/search/_google_maps.rhtml index 776846b..bd0ebd6 100644 --- a/app/views/search/_google_maps.rhtml +++ b/app/views/search/_google_maps.rhtml @@ -7,13 +7,13 @@