From 6ae99cef94360781c39a41b2c4ca48caa6339c77 Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Wed, 11 Aug 2010 19:56:40 -0300 Subject: [PATCH] Balloon links appear in communities block too --- app/helpers/application_helper.rb | 2 ++ features/balloon.feature | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7826e62..769111f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -538,7 +538,9 @@ module ApplicationHelper # #profile_image) and its name and number of members beside it. def community_image_link( profile, size=:portrait, tag='li' ) name = h(profile.name) + links = links_for_balloon(profile) content_tag tag, + (environment.enabled?(:show_balloon_with_profile_links_when_clicked) ? link_to( content_tag( 'span', _('Profile links')), '#', :onclick => "toggleSubmenu(this, '#{profile.short_name}', #{links.to_json}); return false", :class => 'menu-submenu-trigger' ) : "") + link_to( content_tag( 'span', profile_image( profile, size ), :class => 'profile-image' ) + content_tag( 'span', name, :class => 'org' ) + diff --git a/features/balloon.feature b/features/balloon.feature index 35f2158..6f8dcf9 100644 --- a/features/balloon.feature +++ b/features/balloon.feature @@ -29,7 +29,7 @@ Feature: balloon Then I should not see "Friends" @selenium - Scenario: I should see balloon when clicked on block trigger + Scenario: I should see balloon when clicked on people block trigger Given the following blocks | owner | type | | environment | PeopleBlock | @@ -41,6 +41,18 @@ Feature: balloon And I should see "Home Page" @selenium + Scenario: I should see balloon when clicked on community block trigger + Given the following blocks + | owner | type | + | environment | CommunitiesBlock | + And feature "show_balloon_with_profile_links_when_clicked" is enabled on environment + And I go to the homepage + When I click ".menu-submenu-trigger" + Then I should see "Profile" + And I should see "Members" + And I should see "Agenda" + + @selenium Scenario: I should not see trigger if not enabled on page Given feature "show_balloon_with_profile_links_when_clicked" is disabled on environment And I go to /assets/communities -- libgit2 0.21.2