Commit 35a5443db7416fb628414ae489975400ccc3d503
1 parent
27bfd2f0
Exists in
master
and in
28 other branches
ActionItem41: generating faces with link to profile
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1332 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
10 additions
and
1 deletions
Show diff stats
app/helpers/application_helper.rb
| ... | ... | @@ -363,10 +363,19 @@ module ApplicationHelper |
| 363 | 363 | 'default' |
| 364 | 364 | end |
| 365 | 365 | |
| 366 | + # generates a image tag for the profile. | |
| 367 | + # | |
| 368 | + # If the profile has no image set yet, then a default image is used. | |
| 366 | 369 | def profile_image(profile) |
| 367 | - image_tag(profile.image.public_filename(:thumb)) if profile.image | |
| 370 | + if profile.image | |
| 371 | + image_tag(profile.image.public_filename(:thumb)) | |
| 372 | + else | |
| 373 | + image_tag('peopleblock.png') | |
| 374 | + end | |
| 368 | 375 | end |
| 369 | 376 | |
| 377 | + # displays a link to the profile homepage with its image (as generated by | |
| 378 | + # #profile_image) and its name below it. | |
| 370 | 379 | def profile_image_link(profile) |
| 371 | 380 | link_to(profile_image(profile) + tag('br') + profile.name, profile.url) |
| 372 | 381 | end | ... | ... |