Commit cd4a78e99e167059fefc012fcc8944bd2ac1190a
1 parent
843c5cb9
Exists in
master
and in
29 other branches
ActionItem376: showing description of communities
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1779 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
23 additions
and
18 deletions
Show diff stats
app/views/memberships/index.rhtml
@@ -4,23 +4,17 @@ | @@ -4,23 +4,17 @@ | ||
4 | <%= _('%s is a member of the following groups:') % profile.name %> | 4 | <%= _('%s is a member of the following groups:') % profile.name %> |
5 | </p> | 5 | </p> |
6 | 6 | ||
7 | - | ||
8 | <table> | 7 | <table> |
9 | - <tr> | ||
10 | - <th><%= _('Name') %></th> | ||
11 | - <th><%= _('Type') %></th> | ||
12 | - <th><%= _('Members') %></th> | ||
13 | - <th><%= _('Created at') %></th> | ||
14 | - <th><%= _('Actions') %></th> | ||
15 | - </tr> | ||
16 | <% for membership in @memberships %> | 8 | <% for membership in @memberships %> |
17 | <tr> | 9 | <tr> |
18 | - <td><%= link_to membership.name, membership.url %></td> | ||
19 | - <td><%= _(membership.class.name) %></td> | ||
20 | - <td><%= membership.members.size.to_s %></td> | ||
21 | - <td><%= show_date(membership.created_at) %></td> | 10 | + <td> <%= image_tag(profile_icon(membership)) %> </td> |
22 | <td> | 11 | <td> |
23 | - <%= link_to _('Manage'), membership.admin_url %> | 12 | + <%= _('Name: %s:') % link_to(membership.name, membership.url) %> <br/> |
13 | + <%= _('Type: %s') % _(membership.class.name) %> <br/> | ||
14 | + <%= _('Description: %s') % membership.description + '<br/>' if membership.kind_of?(Community) %> | ||
15 | + <%= _('Members: %s') % membership.members.size.to_s %> <br/> | ||
16 | + <%= _('Created at: %s') % show_date(membership.created_at) %> <br/> | ||
17 | + <%= _('Actions: %s') % link_to(_('Manage'), membership.admin_url) %> <br/> | ||
24 | </td> | 18 | </td> |
25 | </tr> | 19 | </tr> |
26 | <% end %> | 20 | <% end %> |
test/functional/memberships_controller_test.rb
@@ -89,17 +89,28 @@ class MembershipsControllerTest < Test::Unit::TestCase | @@ -89,17 +89,28 @@ class MembershipsControllerTest < Test::Unit::TestCase | ||
89 | community = Community.create!(:name => 'my test community') | 89 | community = Community.create!(:name => 'my test community') |
90 | community.add_member(profile) | 90 | community.add_member(profile) |
91 | get :index, :profile => profile.identifier | 91 | get :index, :profile => profile.identifier |
92 | - assert_tag :tag => 'th', :content => 'Members' | ||
93 | - assert_tag :tag => 'td', :content => '1' | 92 | + assert_tag :tag => 'td', :content => /Members: 1/ |
94 | end | 93 | end |
95 | 94 | ||
96 | should 'show created at on list' do | 95 | should 'show created at on list' do |
97 | community = Community.create!(:name => 'my test community') | 96 | community = Community.create!(:name => 'my test community') |
98 | community.add_member(profile) | 97 | community.add_member(profile) |
99 | - created = show_date(community.created_at) | ||
100 | get :index, :profile => profile.identifier | 98 | get :index, :profile => profile.identifier |
101 | - assert_tag :tag => 'th', :content => 'Created at' | ||
102 | - assert_tag :tag => 'td', :content => created | 99 | + assert_tag :tag => 'td', :content => /Created at: #{show_date(community.created_at)}/ |
100 | + end | ||
101 | + | ||
102 | + should 'show description on list' do | ||
103 | + community = Community.create!(:name => 'my test community', :description => 'description test') | ||
104 | + community.add_member(profile) | ||
105 | + get :index, :profile => profile.identifier | ||
106 | + assert_tag :tag => 'td', :content => /Description: description test/ | ||
107 | + end | ||
108 | + | ||
109 | + should 'not show description to enterprises on list' do | ||
110 | + enterprise = Enterprise.create!(:identifier => 'enterprise-test', :name => 'my test enterprise') | ||
111 | + enterprise.add_member(profile) | ||
112 | + get :index, :profile => profile.identifier | ||
113 | + assert_no_tag :tag => 'td', :content => /Description:/ | ||
103 | end | 114 | end |
104 | 115 | ||
105 | end | 116 | end |