-
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
Showing
11 changed files
with
76 additions
and
16 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
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
Loading
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,3 +1,7 @@ | |||
// Place all the styles related to the dashboard controller here. | // Place all the styles related to the dashboard controller here. | ||
// They will automatically be included in application.css. | // They will automatically be included in application.css. | ||
// You can use Sass (SCSS) here: http://sass-lang.com/ | // You can use Sass (SCSS) here: http://sass-lang.com/ | ||
|
|||
p.pull-right{ | |||
color: #E6E6E6 !important; | |||
} |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,14 @@ | |||
class OmniauthCallbacksController < Devise::OmniauthCallbacksController | |||
def facebook | |||
@user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user) | |||
|
|||
if @user.persisted? | |||
flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook" | |||
sign_in_and_redirect @user, :event => :authentication | |||
else | |||
session["devise.facebook_data"] = request.env["omniauth.auth"] | |||
redirect_to new_user_registration_url | |||
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
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,22 +1,34 @@ | |||
<fieldset> | <fieldset> | ||
<legend><%= resource_name.to_s.titleize %> login</legend> | <legend><%= resource_name.to_s.titleize %> login</legend> | ||
|
|
||
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> | <div class="row"> | ||
<div class="clearfix"><%= f.label :email %><br /> | <div class="span8"> | ||
<div class = "input"><%= f.email_field :email %></div> | <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> | ||
</div> | <div class="clearfix"><%= f.label :email %><br /> | ||
<div class = "input"><%= f.email_field :email %></div> | |||
</div> | |||
|
|
||
<div class="clearfix"><%= f.label :password %><br /> | <div class="clearfix"><%= f.label :password %><br /> | ||
<div class = "input"><%= f.password_field :password %></div> | <div class = "input"><%= f.password_field :password %></div> | ||
</div> | </div> | ||
|
|
||
<% if devise_mapping.rememberable? -%> | <% if devise_mapping.rememberable? -%> | ||
<div class="input"> | <div class="input"> | ||
<div class="clearfix"><%= f.check_box :remember_me %> <span>Remember me</span></div> | <div class="clearfix"><%= f.check_box :remember_me %> <span>Remember me</span></div> | ||
</div> | |||
<% end -%> | |||
</div> | </div> | ||
<% end -%> | |||
|
|
||
<% if resource.class != Organization -%> | |||
<div class"span8"> | |||
<p>Or sign-in with Facebook</p> | |||
<%= link_to(image_tag("/assets/btn-fb-connect.png"), user_omniauth_authorize_path(:facebook)) %> | |||
</div> | |||
<% end -%> | |||
|
|||
</div> | |||
<div class="actions"><%= f.submit "Sign in", :class => 'btn primary' %></div> | <div class="actions"><%= f.submit "Sign in", :class => 'btn primary' %></div> | ||
<% end %> | <% end %> | ||
</fieldset> | </fieldset> | ||
|
|||
<%= render :partial => "devise/shared/links" %> | <%= render :partial => "devise/shared/links" %> |
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