Skip to content

Commit

Permalink
use icons for service links
Browse files Browse the repository at this point in the history
  • Loading branch information
fujimura committed Jan 5, 2011
1 parent b70d6b8 commit feae669
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions app/helpers/accounts_helper.rb
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
Binary file added public/images/facebook_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/friendfeed_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/github_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/mixi_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/twitter_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit feae669

Please sign in to comment.