public
Description: This plugin provides a taglib for displaying avatars. At the moment we only support gravatars (globally-recognized avatars).
Homepage: http://grails.org/Avatar+Plugin
Clone URL: git://github.com/domix/avatarplugin.git
name age message
file .gitignore Wed Sep 03 10:31:09 -0700 2008 addes ignores svn and binaries [domix]
file AvatarGrailsPlugin.groovy Mon Sep 01 11:35:04 -0700 2008 naming improvements [domix]
file README Wed Sep 03 11:29:13 -0700 2008 documentation improvements and prepared next re... [domix]
file application.properties Fri Sep 12 11:25:09 -0700 2008 prepared next release [domix]
file avatarPlugin.launch Mon Sep 01 11:35:04 -0700 2008 naming improvements [domix]
file avatarPlugin.tmproj Mon Aug 25 19:45:39 -0700 2008 initial push [domix]
file build.xml Mon Sep 01 11:35:04 -0700 2008 naming improvements [domix]
directory grails-app/ Mon Sep 01 19:51:33 -0700 2008 minor improvements [domix]
file plugin.xml Mon Sep 01 11:35:04 -0700 2008 naming improvements [domix]
directory src/ Mon Aug 25 19:45:39 -0700 2008 initial push [domix]
README
Note:

The official documentation is locate at: http://www.grails.org/Avatar+Plugin

This plugin provides a taglib for displaying avatars. At the moment we only support gravatars (globally-recognized 
avatars).

Gravatars allow users to configure an avatar to go with their email address at a central location: gravatar.com. 
Gravatar-aware websites can then look up and display each user‘s preferred avatar, without having to handle avatar ma
nagement. The user gets the benefit of not having to set up an avatar for each site that they post on.


==Code==
Plugin code is located at GitHub http://github.com/domix/avatarplugin/tree/master


==Installation==
'grails install-plugin avatar'


==Usage==

The plugin usage is quite simple.

Example: <avatar:gravatar email="${user.email}"/>

The tagLib will generate the following HTML code: 
<img alt="Gravatar" class="avatar" height="20" src="https://secure.gravatar.com/avatar/f2f68f9b5281cd7c2eb7eecba1" 
width="20" />

As you can see, the taglib will generate some html default attributes like:

 * heigth & width
 * CSS class
 * alt


You can customize this default values as follows: 
<avatar:gravatar email="${user.email}" alt="My Avatar" cssClass="myCss" size="50"/>

Output:
<img alt="My Avatar" class="myCss" height="50" src="https://secure.gravatar.com/avatar/f2f68f9b2814cd7c2eb7eecb9c" 
width="50" />


Alternatively you can customize default avatar to users who don't have a Gravatar Account:
<avatar:gravatar email="${user.email}" 
defaultGravatarUrl="${'http://mydomain.com/images/default-gravatar-80.png'.encodeAsURL()}" />

Also can be set the Gravatar rating:
<avatar:gravatar email="${user.email}" gravatarRating="G" />


==Configuration==

To avoid expensive configuration each time plugin usage, you can configure global settings as follows:

In Config.groovy

avatarPlugin {
  defaultGravatarUrl="""http://yourdomain.com/images/default-gravatar-80.png"""
  gravatarRating="G"
}