forked from tenderlove/rubycommitters.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
fujimura
committed
Jan 5, 2011
1 parent
b70d6b8
commit feae669
Showing
6 changed files
with
27 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,31 @@ | ||
module AccountsHelper | ||
def link_to_service name, service | ||
case service.name | ||
when 'twitter' | ||
link_to name, 'http://twitter.com/' + service.key | ||
when 'friendfeed' | ||
link_to name, 'http://friendfeed.com/' + service.key | ||
when 'mixi' | ||
link_to name, 'http://mixi.jp/show_friend.pl?id=' + service.key | ||
when 'github' | ||
link_to name, 'http://github.com/' + service.key | ||
when 'facebook' | ||
if service.key =~ /^\sd+$/ | ||
link_to name, 'http://www.facebook.com/profile.php?id=' + service.key | ||
else | ||
link_to name, 'http://www.facebook.com/' + service.key | ||
end | ||
when 'iddy' | ||
link_to name, 'http://iddy.jp/profile/' + service.key | ||
end | ||
|
||
base_uri = case service.name | ||
when 'twitter' | ||
'http://twitter.com/' | ||
when 'friendfeed' | ||
'http://friendfeed.com/' | ||
when 'mixi' | ||
'http://mixi.jp/show_friend.pl?id=' | ||
when 'github' | ||
'http://github.com/' | ||
when 'facebook' | ||
if service.key =~ /^\sd+$/ | ||
'http://www.facebook.com/profile.php?id=' | ||
else | ||
'http://www.facebook.com/' | ||
end | ||
when 'iddy' | ||
'http://iddy.jp/profile/' | ||
end | ||
|
||
text = if %w(mixi twitter friendfeed github facebook).include? service.name | ||
image_tag("/images/#{service.name}_32.png") | ||
else | ||
name | ||
end | ||
|
||
link_to text, base_uri + service.key | ||
end | ||
end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.