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
app/views/profile/_person.rhtml
1 | 1 | <tr> |
2 | 2 | <th colspan='2'><%= _('Basic information')%></th> |
3 | 3 | </tr> |
4 | -<%= display_field(_('About:'), profile, :description) if !@action %> | |
5 | 4 | <%= display_field(_('Sex:'), profile, :sex) { |gender| { 'male' => _('Male'), 'female' => _('Female') }[gender] } %> |
6 | 5 | <%= display_field(_('Date of birth:'), profile, :birth_date) { |date| show_date(date) }%> |
7 | 6 | <%= display_field(_('Location:'), profile, :location, true) %> | ... | ... |
app/views/profile/index.rhtml
... | ... | @@ -6,6 +6,12 @@ |
6 | 6 | <%= render :partial => 'private_profile' %> |
7 | 7 | <% end %> |
8 | 8 | |
9 | +<% if !@action %> | |
10 | + <div class='public-profile-description'> | |
11 | + <%= profile.description %> | |
12 | + </div> | |
13 | +<% end %> | |
14 | + | |
9 | 15 | <table class='profile'> |
10 | 16 | <%= render :partial => partial_for_class(profile.class) %> |
11 | 17 | ... | ... |
public/stylesheets/application.css
... | ... | @@ -3038,6 +3038,10 @@ h1#agenda-title { |
3038 | 3038 | padding: 10px; |
3039 | 3039 | } |
3040 | 3040 | |
3041 | +.controller-profile .public-profile-description { | |
3042 | + font-weight: bold; | |
3043 | +} | |
3044 | + | |
3041 | 3045 | .controller-profile .private-profile-message, |
3042 | 3046 | .controller-profile .private-profile-description { |
3043 | 3047 | margin: 5px 0px 5px 160px; | ... | ... |
test/functional/profile_controller_test.rb
... | ... | @@ -665,4 +665,23 @@ class ProfileControllerTest < Test::Unit::TestCase |
665 | 665 | get :index, :profile => profile.identifier |
666 | 666 | assert_tag :tag => 'a', :content => 'One picture', :attributes => { :href => /\/testuser\/gallery/ } |
667 | 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 | 687 | end | ... | ... |