Commit 720d5c2a1e8fcf2baade9f21c97edbc24a97af9c
1 parent
232ef450
Exists in
staging
and in
42 other branches
ActionItem489: gender in profile info block
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2114 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
6 changed files
with
114 additions
and
68 deletions
Show diff stats
app/helpers/application_helper.rb
| @@ -328,9 +328,7 @@ module ApplicationHelper | @@ -328,9 +328,7 @@ module ApplicationHelper | ||
| 328 | 328 | ||
| 329 | end | 329 | end |
| 330 | 330 | ||
| 331 | - # displays a link to the profile homepage with its image (as generated by | ||
| 332 | - # #profile_image) and its name below it. | ||
| 333 | - def profile_image_link( profile, size=:portrait, tag='li' ) | 331 | + def profile_sex_icon( profile ) |
| 334 | if profile.class == Person | 332 | if profile.class == Person |
| 335 | sex = ( profile.sex ? profile.sex.to_s() : 'undef' ) | 333 | sex = ( profile.sex ? profile.sex.to_s() : 'undef' ) |
| 336 | title = ( sex == 'undef' ? _('non registered gender') : ( sex == 'male' ? _('Male') : _('Female') ) ) | 334 | title = ( sex == 'undef' ? _('non registered gender') : ( sex == 'male' ? _('Male') : _('Female') ) ) |
| @@ -341,6 +339,12 @@ module ApplicationHelper | @@ -341,6 +339,12 @@ module ApplicationHelper | ||
| 341 | else | 339 | else |
| 342 | sex = '' | 340 | sex = '' |
| 343 | end | 341 | end |
| 342 | + sex | ||
| 343 | + end | ||
| 344 | + | ||
| 345 | + # displays a link to the profile homepage with its image (as generated by | ||
| 346 | + # #profile_image) and its name below it. | ||
| 347 | + def profile_image_link( profile, size=:portrait, tag='li' ) | ||
| 344 | if profile.class == Person | 348 | if profile.class == Person |
| 345 | name = profile.first_name | 349 | name = profile.first_name |
| 346 | city = content_tag 'span', content_tag( 'span', profile.city, :class => 'locality' ), :class => 'adr' | 350 | city = content_tag 'span', content_tag( 'span', profile.city, :class => 'locality' ), :class => 'adr' |
| @@ -352,7 +356,7 @@ module ApplicationHelper | @@ -352,7 +356,7 @@ module ApplicationHelper | ||
| 352 | link_to( | 356 | link_to( |
| 353 | content_tag( 'span', profile_image( profile, size ), :class => 'profile-image' ) + | 357 | content_tag( 'span', profile_image( profile, size ), :class => 'profile-image' ) + |
| 354 | content_tag( 'span', name, :class => ( profile.class == Person ? 'fn' : 'org' ) ) + | 358 | content_tag( 'span', name, :class => ( profile.class == Person ? 'fn' : 'org' ) ) + |
| 355 | - city + sex, | 359 | + city + profile_sex_icon( profile ), |
| 356 | profile.url, | 360 | profile.url, |
| 357 | :class => 'profile_link url', | 361 | :class => 'profile_link url', |
| 358 | :help => _('Click on this icon to go to the <b>%s</b>\'s home page') % profile.name ), | 362 | :help => _('Click on this icon to go to the <b>%s</b>\'s home page') % profile.name ), |
app/views/blocks/profile_info.rhtml
| 1 | <h2><%= block.owner.name %></h2> | 1 | <h2><%= block.owner.name %></h2> |
| 2 | 2 | ||
| 3 | -<div class="profile-info-picture"><%= profile_image(block.owner, :thumb) %></div> | 3 | +<div class="profile-info-picture"> |
| 4 | + <div class="profile-info-picture-inner1"> | ||
| 5 | + <span class="profile-info-picture-inner2"> | ||
| 6 | + <%= | ||
| 7 | + profile_image(block.owner, :thumb) +"\n"+ | ||
| 8 | + profile_sex_icon( profile ) | ||
| 9 | + %> | ||
| 10 | + </span> | ||
| 11 | + </div> | ||
| 12 | +</div> | ||
| 4 | 13 | ||
| 5 | <ul class="profile-info-data"> | 14 | <ul class="profile-info-data"> |
| 6 | <li><%= _('Since %{year}/%{month}') % { :year => block.owner.created_at.year, :month => block.owner.created_at.month } %></li> | 15 | <li><%= _('Since %{year}/%{month}') % { :year => block.owner.created_at.year, :month => block.owner.created_at.month } %></li> |
public/designs/themes/ecosol/stylesheets/blocks/profile-info-block.css
No preview for this file type
public/designs/themes/zen3/stylesheets/blocks/profile-info-block.css
| 1 | -.profile-info-block h2 { | ||
| 2 | - text-align: center; | ||
| 3 | -} | ||
| 4 | 1 | ||
| 5 | -.profile-info-picture { | ||
| 6 | - border: 2px solid #A40000; | ||
| 7 | - padding: 1px; | 2 | +.profile-info-picture img { |
| 3 | + border: 1px solid #A40000; | ||
| 4 | + padding: 2px; | ||
| 8 | background: #FFF; | 5 | background: #FFF; |
| 9 | - margin-right: 40px; | ||
| 10 | -} | ||
| 11 | -.msie6 .profile-info-picture { | ||
| 12 | - margin-right: 20px; | ||
| 13 | -} | ||
| 14 | - | ||
| 15 | -.profile-info-data { | ||
| 16 | - width: 110px; | ||
| 17 | - font-size: 10px; | ||
| 18 | - text-align: right; | ||
| 19 | - position: relative; | ||
| 20 | - top: 20px; | ||
| 21 | } | 6 | } |
| 22 | 7 | ||
| 23 | -.profile-info-options { | ||
| 24 | - clear: both; | ||
| 25 | -} | ||
| 26 | - | ||
| 27 | -.profile-info-options { | ||
| 28 | - padding-top: 20px; | ||
| 29 | - text-align: right; | ||
| 30 | - padding-right: 5px; | ||
| 31 | -} |
public/stylesheets/blocks/profile-info-block.css
| 1 | 1 | ||
| 2 | +.profile-info-block h2 { | ||
| 3 | + text-align: center; | ||
| 4 | +} | ||
| 5 | + | ||
| 2 | .profile-info-picture { | 6 | .profile-info-picture { |
| 7 | + position: relative; | ||
| 3 | float: right; | 8 | float: right; |
| 9 | + display: table; | ||
| 10 | + margin-right: 40px; | ||
| 11 | + width: 106px; | ||
| 12 | + height: 106px; | ||
| 13 | +} | ||
| 14 | +.msie6 .profile-info-picture { | ||
| 15 | + margin-right: 20px; | ||
| 16 | +} | ||
| 17 | + | ||
| 18 | +.profile-info-picture-inner1 { | ||
| 19 | + display: table-cell; | ||
| 20 | + text-align: center; | ||
| 21 | + vertical-align: middle; | ||
| 22 | +} | ||
| 23 | +.profile-info-picture-inner2 { | ||
| 24 | + position: relative; | ||
| 25 | + left: 0px; | ||
| 26 | + display: block; | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +.profile-info-picture img { | ||
| 30 | + border: 1px solid #204A87; | ||
| 31 | + padding: 2px; | ||
| 32 | + background: #FFF; | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | +.profile-info-picture .sex-male, | ||
| 36 | +.profile-info-picture .sex-female, | ||
| 37 | +.profile-info-picture .sex-undef { | ||
| 38 | + position: absolute; | ||
| 39 | + top: 4px; | ||
| 40 | + right: 4px; | ||
| 41 | + display: block; | ||
| 42 | + width: 15px; | ||
| 43 | + height: 15px; | ||
| 44 | +} | ||
| 45 | + | ||
| 46 | +.profile-info-picture .sex-male { | ||
| 47 | + background: url(/images/icons-app/ico-male.png); | ||
| 48 | +} | ||
| 49 | +.profile-info-picture .sex-female { | ||
| 50 | + background: url(/images/icons-app/ico-female.png); | ||
| 51 | +} | ||
| 52 | +.profile-info-picture .sex-undef { | ||
| 53 | + background: url(/images/icons-app/ico-sex-undef.png); | ||
| 54 | +} | ||
| 55 | +.msie6 .profile-info-picture .sex-male { | ||
| 56 | + background: none; | ||
| 57 | + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/icons-app/ico-male.png',sizingMethod='scale'); | ||
| 58 | +} | ||
| 59 | +.msie6 .profile-info-picture .sex-female { | ||
| 60 | + background: none; | ||
| 61 | + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/icons-app/ico-female.png',sizingMethod='scale'); | ||
| 62 | +} | ||
| 63 | +.msie6 .profile-info-picture .sex-undef { | ||
| 64 | + background: none; | ||
| 65 | + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/icons-app/ico-sex-undef.png',sizingMethod='scale'); | ||
| 66 | +} | ||
| 67 | + | ||
| 68 | +#content .profile-info-picture .sex-male span, | ||
| 69 | +#content .profile-info-picture .sex-female span, | ||
| 70 | +#content .profile-info-picture .sex-undef span { | ||
| 71 | + display: none; | ||
| 72 | +} | ||
| 73 | + | ||
| 74 | + | ||
| 75 | +.profile-info-data { | ||
| 76 | + width: 110px; | ||
| 77 | + font-size: 10px; | ||
| 78 | + text-align: right; | ||
| 79 | + position: relative; | ||
| 80 | + top: 20px; | ||
| 81 | +} | ||
| 82 | + | ||
| 83 | +.profile-info-options { | ||
| 84 | + clear: both; | ||
| 85 | +} | ||
| 86 | + | ||
| 87 | +.profile-info-options { | ||
| 88 | + padding-top: 20px; | ||
| 89 | + text-align: right; | ||
| 90 | + padding-right: 5px; | ||
| 4 | } | 91 | } |
| 5 | 92 | ||
| 6 | .profile-info-block { | 93 | .profile-info-block { |
public/stylesheets/blocks/profile-list-block.css
| @@ -47,6 +47,12 @@ | @@ -47,6 +47,12 @@ | ||
| 47 | border: none; | 47 | border: none; |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | +.common-profile-list-block .locality { | ||
| 51 | + font-size: 9px; | ||
| 52 | + opacity: 0.5; | ||
| 53 | + filter: alpha(opacity=50); | ||
| 54 | +} | ||
| 55 | + | ||
| 50 | .common-profile-list-block .sex-male, | 56 | .common-profile-list-block .sex-male, |
| 51 | .common-profile-list-block .sex-female, | 57 | .common-profile-list-block .sex-female, |
| 52 | .common-profile-list-block .sex-undef { | 58 | .common-profile-list-block .sex-undef { |
| @@ -58,12 +64,6 @@ | @@ -58,12 +64,6 @@ | ||
| 58 | height: 15px; | 64 | height: 15px; |
| 59 | } | 65 | } |
| 60 | 66 | ||
| 61 | -.common-profile-list-block .locality { | ||
| 62 | - font-size: 9px; | ||
| 63 | - opacity: 0.5; | ||
| 64 | - filter: alpha(opacity=50); | ||
| 65 | -} | ||
| 66 | - | ||
| 67 | .common-profile-list-block .sex-male { | 67 | .common-profile-list-block .sex-male { |
| 68 | background: url(/images/icons-app/ico-male.png); | 68 | background: url(/images/icons-app/ico-male.png); |
| 69 | } | 69 | } |