public
Description: Yet another GTD next action management tool. Written in Ruby, using Merb and DataMapper.
Homepage: http://elevate.cubicphuse.nl
Clone URL: git://github.com/ludo/to-elevate.git
Enable Gravatar support
ludo (author)
Mon Jul 21 02:33:52 -0700 2008
commit  eae02e398186a6a71a392b39f9addf7d5097130b
tree    e1ffd32d321dbae4ea82ffc3dc3b02b2f9901e40
parent  fef5bc4c44ed8ad41cf03530364c384992e24f8d
...
 
 
1
2
 
3
4
5
...
48
49
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
52
53
...
149
150
151
152
 
 
153
...
1
2
3
4
5
6
7
8
...
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
...
168
169
170
 
171
172
173
0
@@ -1,5 +1,8 @@
0
+require 'digest/md5'
0
+
0
 module Merb
0
   module GlobalHelpers
0
+
0
     # Retrieve the number of active tasks
0
     #
0
     # TODO Do not include tasks that in hidden contexts.
0
@@ -48,6 +51,22 @@ module Merb
0
       end
0
     end
0
     
0
+ # Display a Gravatar avatar
0
+ #
0
+ # TODO Allow options, like different sizes
0
+ #
0
+ # ==== Parameters
0
+ # email<String>:: E-mail address to show Gravatar for
0
+ #
0
+ # ==== Returns
0
+ # String:: An URL to a Gravatar
0
+ #
0
+ # --
0
+ # @api public
0
+ def gravatar(email)
0
+ str = "http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(email)}.jpg?s=40"
0
+ end
0
+
0
     # Little helper for selecting which menu will be active
0
     #
0
     # ==== Parameters
0
@@ -149,4 +168,5 @@ module Merb
0
       }
0
     end
0
   end
0
-end
0
+
0
+end
0
\ No newline at end of file
...
17
18
19
20
 
21
22
23
...
17
18
19
 
20
21
22
23
0
@@ -17,7 +17,7 @@
0
       #header
0
         - if logged_in?
0
           #user.right= current_user.login
0
- /%img.right.avatar{:src => "https://secure.gravatar.com/avatar/64082d83db14dd06252607325df8679c?s=40"}
0
+ = image_tag gravatar(current_user.email), :class => "right avatar"
0
         %h1
0
           to
0
           = link_to "elevate", url(:root)

Comments

    No one has commented yet.