This repository has been archived by the owner on Apr 15, 2020. It is now read-only.
forked from issueapp/omnisocial
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the more standard "Sign in with Twitter/Facebook" buttons, includ…
…ing helpers to insert them. Encapsulate the twitter and facebook auth URLs in an auth_request_path helper.
- Loading branch information
Showing
6 changed files
with
23 additions
and
9 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,11 +1,23 @@ | ||
module Omnisocial | ||
module AuthHelper | ||
def twitter_login_button | ||
content_tag(:a, content_tag(:span, 'Sign in with Twitter'), :class => 'twitter', :href => '/auth/twitter') | ||
def auth_request_path(options = {}) | ||
"/auth/#{options[:service]}" | ||
end | ||
|
||
def big_twitter_login_button | ||
content_tag(:a, content_tag(:span, 'Sign in with Twitter'), :class => 'twitter', :href => auth_request_path(:service => 'twitter')) | ||
end | ||
|
||
def big_facebook_login_button | ||
content_tag(:a, content_tag(:span, 'Sign in with Facebook'), :class => 'facebook', :href => auth_request_path(:service => 'facebook')) | ||
end | ||
|
||
def twitter_login_button | ||
content_tag(:a, content_tag(:img, :src => '/images/omnisocial/signin_twitter.png', :alt => 'Sign in with Twitter'), :href => auth_request_path(:service => 'twitter')) | ||
end | ||
|
||
def facebook_login_button | ||
content_tag(:a, content_tag(:span, 'Sign in with Facebook'), :class => 'facebook', :href => '/auth/facebook') | ||
content_tag(:a, content_tag(:img, :src => '/images/omnisocial/signin_facebook.png', :alt => 'Sign in with Facebook'), :href => auth_request_path(:service => 'facebook')) | ||
end | ||
end | ||
end |
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
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
Binary file added
BIN
+5.48 KB
lib/generators/omnisocial/templates/assets/images/signin_facebook.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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