Commit fe89e1a39220dad9f9638f4b2ad678a2aa2e4706
1 parent
3cf76cde
Exists in
master
and in
29 other branches
ActionItem301: show control panel link in own person profile
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1736 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
3 changed files
with
16 additions
and
1 deletions
Show diff stats
app/views/blocks/profile_info.rhtml
@@ -6,6 +6,9 @@ | @@ -6,6 +6,9 @@ | ||
6 | <li><%= _('Since %{year}/%{month}') % { :year => block.owner.created_at.year, :month => block.owner.created_at.month } %></li> | 6 | <li><%= _('Since %{year}/%{month}') % { :year => block.owner.created_at.year, :month => block.owner.created_at.month } %></li> |
7 | <li><%= link_to _('Homepage'), block.owner.url %></li> | 7 | <li><%= link_to _('Homepage'), block.owner.url %></li> |
8 | <li><%= link_to _('View profile'), block.owner.public_profile_url %></li> | 8 | <li><%= link_to _('View profile'), block.owner.public_profile_url %></li> |
9 | + <% if profile == user %> | ||
10 | + <li><%= link_to _('Control panel'), :controller => 'profile_editor' %></li> | ||
11 | + <% end %> | ||
9 | </ul> | 12 | </ul> |
10 | 13 | ||
11 | <div class="profile-info-options"> | 14 | <div class="profile-info-options"> |
test/functional/my_profile_controller_test.rb
@@ -24,7 +24,6 @@ class MyProfileControllerTest < Test::Unit::TestCase | @@ -24,7 +24,6 @@ class MyProfileControllerTest < Test::Unit::TestCase | ||
24 | @controller = OnlyForPersonTestController.new | 24 | @controller = OnlyForPersonTestController.new |
25 | user = create_user('test_user').person | 25 | user = create_user('test_user').person |
26 | assert_local_files_reference :get, :index, :profile => user.identifier | 26 | assert_local_files_reference :get, :index, :profile => user.identifier |
27 | - #get :index, :profile => user.identifier | ||
28 | end | 27 | end |
29 | 28 | ||
30 | def test_valid_xhtml | 29 | def test_valid_xhtml |
test/functional/profile_controller_test.rb
@@ -132,4 +132,17 @@ class ProfileControllerTest < Test::Unit::TestCase | @@ -132,4 +132,17 @@ class ProfileControllerTest < Test::Unit::TestCase | ||
132 | assert_tag :tag => 'a', :attributes => { :href => '/tag/tag1' }, :content => 'See content tagged with "tag1" in the entire site' | 132 | assert_tag :tag => 'a', :attributes => { :href => '/tag/tag1' }, :content => 'See content tagged with "tag1" in the entire site' |
133 | end | 133 | end |
134 | 134 | ||
135 | + should 'show a link to own control panel' do | ||
136 | + login_as(@profile.identifier) | ||
137 | + get :index, :profile => @profile.identifier | ||
138 | + assert_tag :tag => 'ul', :attributes => { :class => 'profile-info-data' }, :descendant => { :tag => 'a', :content => 'Control panel' } | ||
139 | + end | ||
140 | + | ||
141 | + should 'not show a link to others control panel' do | ||
142 | + login_as(@profile.identifier) | ||
143 | + other = create_user('person_1').person | ||
144 | + get :index, :profile => other.identifier | ||
145 | + assert_no_tag :tag => 'ul', :attributes => { :class => 'profile-info-data' }, :descendant => { :tag => 'a', :content => 'Control panel' } | ||
146 | + end | ||
147 | + | ||
135 | end | 148 | end |