Commit 3b9ee2908d792bab2f4177d24b102f6bc88a9ea3
1 parent
d8964fab
Exists in
staging
and in
42 other branches
ActionItem183: embelezamento de profile list
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1492 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
4 changed files
with
79 additions
and
9 deletions
Show diff stats
app/helpers/application_helper.rb
| ... | ... | @@ -356,7 +356,7 @@ module ApplicationHelper |
| 356 | 356 | # |
| 357 | 357 | # If the profile has no image set yet, then a default image is used. |
| 358 | 358 | def profile_image(profile) |
| 359 | - image_tag(profile_icon(profile)) | |
| 359 | + image_tag(profile_icon(profile), :alt => profile.name(), :title => '' ) | |
| 360 | 360 | end |
| 361 | 361 | |
| 362 | 362 | def profile_icon(profile) |
| ... | ... | @@ -379,7 +379,8 @@ module ApplicationHelper |
| 379 | 379 | # displays a link to the profile homepage with its image (as generated by |
| 380 | 380 | # #profile_image) and its name below it. |
| 381 | 381 | def profile_image_link(profile) |
| 382 | - link_to(profile_image(profile) + tag('br') + profile.name, profile.url) | |
| 382 | + link_to( '<div>'+ profile_image(profile) +'</div><span>'+ profile.name() +'</span>', profile.url, | |
| 383 | + :help => _('Click on this icon to go to the <b>%s</b>\'s home page') % profile.name ) | |
| 383 | 384 | end |
| 384 | 385 | |
| 385 | 386 | end | ... | ... |
app/models/profile_list_block.rb
| ... | ... | @@ -58,12 +58,17 @@ class ProfileListBlock < Block |
| 58 | 58 | def content |
| 59 | 59 | profiles = self.profiles |
| 60 | 60 | title = self.title |
| 61 | + nl = "\n" | |
| 61 | 62 | lambda do |
| 62 | - block_title(title) + | |
| 63 | - content_tag( | |
| 64 | - 'ul', | |
| 65 | - profiles.map {|item| content_tag('li', profile_image_link(item)) }.join("\n") | |
| 66 | - ) | |
| 63 | + list = profiles.map {|item| content_tag( 'li', profile_image_link(item) ) }.join("\n ") | |
| 64 | + if list.empty? | |
| 65 | + list = '<i>'+ _('None') +'</i>' | |
| 66 | + else | |
| 67 | + list = content_tag( 'ul', nl +' '+ list + nl ) | |
| 68 | + end | |
| 69 | + '<div class="common-profile-list-block">' + | |
| 70 | + nl + block_title(title) + nl + list + nl + | |
| 71 | + '</div>' | |
| 67 | 72 | end |
| 68 | 73 | end |
| 69 | 74 | ... | ... |
public/stylesheets/blocks/profile-list-block.css
| 1 | -/* nothing yet */ | |
| 1 | +.common-profile-list-block { | |
| 2 | + text-align: center; | |
| 3 | + color: #B8CFE7; | |
| 4 | +} | |
| 5 | + | |
| 6 | +#content .common-profile-list-block .block-title { | |
| 7 | + font-size: 14px; | |
| 8 | +} | |
| 9 | + | |
| 10 | +.common-profile-list-block ul { | |
| 11 | + margin: 0px; | |
| 12 | + padding: 0px; | |
| 13 | +} | |
| 14 | + | |
| 15 | +.common-profile-list-block li { | |
| 16 | + list-style: none; | |
| 17 | + margin: 0px; | |
| 18 | + padding: 0px; | |
| 19 | + float: left; | |
| 20 | +} | |
| 21 | + | |
| 22 | +.common-profile-list-block li a { | |
| 23 | + border: 2px solid #FFF; | |
| 24 | + display: block; | |
| 25 | + height: 100px; | |
| 26 | + padding-top: 2px; | |
| 27 | + width: 96px; | |
| 28 | + overflow: hidden; | |
| 29 | + text-decoration: none; | |
| 30 | + font-size: 9px; | |
| 31 | +} | |
| 32 | +.msie .common-profile-list-block li a { | |
| 33 | + width: 100px; | |
| 34 | + line-height: 10px; | |
| 35 | + cursor: pointer; | |
| 36 | +} | |
| 37 | + | |
| 38 | +.common-profile-list-block li a:hover { | |
| 39 | + border: 2px solid #2A5896; | |
| 40 | + background: #B8CFE7; | |
| 41 | + color: #035; | |
| 42 | +} | |
| 43 | + | |
| 44 | +.common-profile-list-block li div { | |
| 45 | + width: 96px; | |
| 46 | + height: 64px; | |
| 47 | +} | |
| 48 | + | |
| 49 | +.common-profile-list-block li span { | |
| 50 | + display: block; | |
| 51 | + width: 92px; | |
| 52 | +} | |
| 53 | + | |
| 54 | +.common-profile-list-block li img { | |
| 55 | + border: none; | |
| 56 | +} | |
| 57 | + | |
| 58 | +.enterprises-block .block-footer-content, | |
| 59 | +.communities-block .block-footer-content { | |
| 60 | + text-align: center; | |
| 61 | + font-size: 80%; | |
| 62 | + padding: 10px 0px 0px 0px; | |
| 63 | +} | |
| 64 | + | ... | ... |
public/stylesheets/common.css
| ... | ... | @@ -332,7 +332,8 @@ body.category4 #content h1, body.category4 #content h2, body.category4 #content |
| 332 | 332 | body.category4 #content h4, body.category4 #content h5, body.category4 #content h6 |
| 333 | 333 | { color: #B80000 } |
| 334 | 334 | |
| 335 | -#content .block-title { | |
| 335 | +.block-title { | |
| 336 | + color: red; | |
| 336 | 337 | margin: 0px 0px 10px 0px; |
| 337 | 338 | } |
| 338 | 339 | ... | ... |