Commit 938e6ccd7ad6fe0b9b0c8526c863392840904274
Committed by
Antonio Terceiro
1 parent
4280df89
Exists in
master
and in
28 other branches
highlight the profile description
(ActionItem1471)
Showing
5 changed files
with
29 additions
and
2 deletions
Show diff stats
app/views/profile/_organization.rhtml
1 | <tr> | 1 | <tr> |
2 | <th colspan='2'><%= _('Basic information')%></th> | 2 | <th colspan='2'><%= _('Basic information')%></th> |
3 | </tr> | 3 | </tr> |
4 | -<%= display_field(_('Description:'), profile, :description) if !@action %> | ||
5 | 4 | ||
6 | <tr> | 5 | <tr> |
7 | <td class='field-name'><%= _('Members') %></td> | 6 | <td class='field-name'><%= _('Members') %></td> |
app/views/profile/_person.rhtml
1 | <tr> | 1 | <tr> |
2 | <th colspan='2'><%= _('Basic information')%></th> | 2 | <th colspan='2'><%= _('Basic information')%></th> |
3 | </tr> | 3 | </tr> |
4 | -<%= display_field(_('About:'), profile, :description) if !@action %> | ||
5 | <%= display_field(_('Sex:'), profile, :sex) { |gender| { 'male' => _('Male'), 'female' => _('Female') }[gender] } %> | 4 | <%= display_field(_('Sex:'), profile, :sex) { |gender| { 'male' => _('Male'), 'female' => _('Female') }[gender] } %> |
6 | <%= display_field(_('Date of birth:'), profile, :birth_date) { |date| show_date(date) }%> | 5 | <%= display_field(_('Date of birth:'), profile, :birth_date) { |date| show_date(date) }%> |
7 | <%= display_field(_('Location:'), profile, :location, true) %> | 6 | <%= display_field(_('Location:'), profile, :location, true) %> |
app/views/profile/index.rhtml
@@ -6,6 +6,12 @@ | @@ -6,6 +6,12 @@ | ||
6 | <%= render :partial => 'private_profile' %> | 6 | <%= render :partial => 'private_profile' %> |
7 | <% end %> | 7 | <% end %> |
8 | 8 | ||
9 | +<% if !@action %> | ||
10 | + <div class='public-profile-description'> | ||
11 | + <%= profile.description %> | ||
12 | + </div> | ||
13 | +<% end %> | ||
14 | + | ||
9 | <table class='profile'> | 15 | <table class='profile'> |
10 | <%= render :partial => partial_for_class(profile.class) %> | 16 | <%= render :partial => partial_for_class(profile.class) %> |
11 | 17 |
public/stylesheets/application.css
@@ -3038,6 +3038,10 @@ h1#agenda-title { | @@ -3038,6 +3038,10 @@ h1#agenda-title { | ||
3038 | padding: 10px; | 3038 | padding: 10px; |
3039 | } | 3039 | } |
3040 | 3040 | ||
3041 | +.controller-profile .public-profile-description { | ||
3042 | + font-weight: bold; | ||
3043 | +} | ||
3044 | + | ||
3041 | .controller-profile .private-profile-message, | 3045 | .controller-profile .private-profile-message, |
3042 | .controller-profile .private-profile-description { | 3046 | .controller-profile .private-profile-description { |
3043 | margin: 5px 0px 5px 160px; | 3047 | margin: 5px 0px 5px 160px; |
test/functional/profile_controller_test.rb
@@ -665,4 +665,23 @@ class ProfileControllerTest < Test::Unit::TestCase | @@ -665,4 +665,23 @@ class ProfileControllerTest < Test::Unit::TestCase | ||
665 | get :index, :profile => profile.identifier | 665 | get :index, :profile => profile.identifier |
666 | assert_tag :tag => 'a', :content => 'One picture', :attributes => { :href => /\/testuser\/gallery/ } | 666 | assert_tag :tag => 'a', :content => 'One picture', :attributes => { :href => /\/testuser\/gallery/ } |
667 | end | 667 | end |
668 | + | ||
669 | + should 'show description of orgarnization' do | ||
670 | + login_as(@profile.identifier) | ||
671 | + ent = fast_create(Enterprise) | ||
672 | + ent.description = 'Enterprise\'s description' | ||
673 | + ent.save | ||
674 | + get :index, :profile => ent.identifier | ||
675 | + assert_tag :tag => 'div', :attributes => { :class => 'public-profile-description' }, :content => /Enterprise\'s description/ | ||
676 | + end | ||
677 | + | ||
678 | + should 'show description of person' do | ||
679 | + login_as(@profile.identifier) | ||
680 | + @profile.description = 'Person\'s description' | ||
681 | + @profile.save | ||
682 | + get :index, :profile => @profile.identifier | ||
683 | + assert_tag :tag => 'div', :attributes => { :class => 'public-profile-description' }, :content => /Person\'s description/ | ||
684 | + end | ||
685 | + | ||
686 | + | ||
668 | end | 687 | end |