Commit be7ad56cbb3473ca59e898af20e5c5884c1db65b
1 parent
4f106fcd
Exists in
master
and in
29 other branches
ActionItem167: and action item 168 are now working
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1476 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
5 changed files
with
35 additions
and
1 deletions
Show diff stats
app/controllers/public/profile_controller.rb
| @@ -12,4 +12,12 @@ class ProfileController < ApplicationController | @@ -12,4 +12,12 @@ class ProfileController < ApplicationController | ||
| 12 | @tagged = profile.find_tagged_with(@tag) | 12 | @tagged = profile.find_tagged_with(@tag) |
| 13 | end | 13 | end |
| 14 | 14 | ||
| 15 | + def communities | ||
| 16 | + @communities = profile.communities | ||
| 17 | + end | ||
| 18 | + | ||
| 19 | + def enterprises | ||
| 20 | + @enterprises = profile.enterprises | ||
| 21 | + end | ||
| 22 | + | ||
| 15 | end | 23 | end |
app/models/person.rb
| @@ -28,10 +28,14 @@ class Person < Profile | @@ -28,10 +28,14 @@ class Person < Profile | ||
| 28 | memberships(:type => Enterprise.name) | 28 | memberships(:type => Enterprise.name) |
| 29 | end | 29 | end |
| 30 | 30 | ||
| 31 | + alias :enterprises :enterprise_memberships | ||
| 32 | + | ||
| 31 | def community_memberships | 33 | def community_memberships |
| 32 | memberships(:type => Community.name) | 34 | memberships(:type => Community.name) |
| 33 | end | 35 | end |
| 34 | 36 | ||
| 37 | + alias :communities :community_memberships | ||
| 38 | + | ||
| 35 | 39 | ||
| 36 | def info | 40 | def info |
| 37 | person_info | 41 | person_info |
| @@ -0,0 +1,11 @@ | @@ -0,0 +1,11 @@ | ||
| 1 | +<h1><%= _("%s's communities") % profile.name %></h1> | ||
| 2 | + | ||
| 3 | +<ul class='profile-list'> | ||
| 4 | +<% @communities.each do |community| %> | ||
| 5 | + <li><%= profile_image_link(community)%></li> | ||
| 6 | +<% end %> | ||
| 7 | +</ul> | ||
| 8 | + | ||
| 9 | +<% button_bar do %> | ||
| 10 | + <%= button(:back, _('Go back'), :controller => 'profile') %> | ||
| 11 | +<% end %> |
| @@ -0,0 +1,11 @@ | @@ -0,0 +1,11 @@ | ||
| 1 | +<h1><%= _("%s's enterprises") % profile.name %></h1> | ||
| 2 | + | ||
| 3 | +<ul class='profile-list'> | ||
| 4 | +<% @enterprises.each do |enterprise| %> | ||
| 5 | + <li><%= profile_image_link(enterprise)%></li> | ||
| 6 | +<% end %> | ||
| 7 | +</ul> | ||
| 8 | + | ||
| 9 | +<% button_bar do %> | ||
| 10 | + <%= button(:back, _('Go back'), :controller => 'profile') %> | ||
| 11 | +<% end %> |
app/views/profile/index.rhtml
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | </li> | 7 | </li> |
| 8 | <li> | 8 | <li> |
| 9 | <strong><%= _('Homepage: ') %></strong> | 9 | <strong><%= _('Homepage: ') %></strong> |
| 10 | - <%= link_to profile.url, profile.url %> | 10 | + <%= link_to url_for(profile.url), profile.url %> |
| 11 | </li> | 11 | </li> |
| 12 | 12 | ||
| 13 | <%# FIXME %> | 13 | <%# FIXME %> |