Permalink
Browse files

Upgrade openid-selector, improve login from proposal form

  • Loading branch information...
reidab committed Sep 6, 2013
1 parent 8728140 commit 5764e8943ac5e76b9e8c3fc6cd311a630e9d7d46
@@ -112,12 +112,6 @@ def edit
# POST /proposals
# POST /proposals.xml
def create
if params[:commit] == "Login" && params[:openid_url]
store_location(new_proposal_path)
#return render_component(:controller => "sessions", :action => "create", :openid_url => params[:openid_url])
return redirect_to(url_for(:controller => "sessions", :action => "create", :openid_url => params[:openid_url]))
end
@proposal = Proposal.new(params[:proposal])
@proposal.event = @event
@proposal.user = current_user if logged_in?
@@ -11,6 +11,7 @@ def admin
# Process login
def create
store_location(params[:return_to]) if params[:return_to]
if using_open_id?
open_id_authentication
else
@@ -5,6 +5,11 @@
<% end %>
</p>
<% if !logged_in? && @proposal.new_record? %>
<p><%= snippet_for :proposals_openid_text %></p>
<%= render :partial => 'sessions/openid_form', :locals => {:return_to => new_event_proposal_path(@event)} %>
<% end %>
<div id="proposal-form" class="standard-form">
<% form_for([@event, @proposal]) do |f| %>
<table>
@@ -18,34 +23,6 @@
</thead>
<% end %>
<tbody>
<% if !logged_in? && @proposal.new_record? %>
<tr>
<td colspan="2">
<h4>Login with OpenID</h4>
<p><%= snippet_for :proposals_openid_text %></p>
</td>
</tr>
<tr>
<td class="label-cell">
<%= image_tag "openid-icon.gif" %>
OpenID
</td>
<td>
<%= text_field_tag :openid_url, "" %>
<%= submit_tag "Login", :id => "openid_login" %>
<!-- BEGIN ID SELECTOR -->
<script type="text/javascript">
<!--
// Tell ID Selector which controls to affect
var idselector_input_id = "openid_url";
var idselector_target_id = "openid_login_wtf";
-->
</script>
<%= javascript_include_tag "idselector" %>
<!-- END ID SELECTOR -->
</td>
</tr>
<% end %>
<tr>
<td colspan="2">
<h4>About you</h4>
@@ -0,0 +1,38 @@
<% return_to ||= nil %>
<% form_tag(session_path, :id => "openid_form", :class => "standard-form") do %>
<% if return_to %>
<%= hidden_field_tag :return_to, return_to %>
<% end %>
<fieldset>
<div id="openid_choice">
<p>Please click your account provider:</p>
<div id="openid_btns"></div>
</div>
<div id="openid_input_area">
<%= text_field_tag "openid_url", "http://", :id => "openid_url" %>
<%= submit_tag 'Log in' %>
</div>
<noscript>
<p>OpenID is service that allows you to log-on to many different websites using a single indentity.
Find out <a href="http://openid.net/what/">more about OpenID</a> and <a href="http://openid.net/get/">how to get an OpenID enabled account</a>.</p>
</noscript>
</fieldset>
<p>
<span class="rightish">
&nbsp;
</span>
&nbsp;
<!-- BEGIN ID SELECTOR -->
<%= stylesheet_link_tag "openid" %>
<%= javascript_include_tag "jquery-1.2.6.min" %>
<%= javascript_include_tag "openid-jquery" %>
<%= javascript_include_tag "openid-en" %>
<script type="text/javascript">
$(document).ready(function() {
openid.img_path = '/images/';
openid.init('openid_url');
});
</script>
<!-- END ID SELECTOR -->
</p>
<% end %>
@@ -1,34 +0,0 @@
<% page_title "Login" %>
<p><%= snippet_for :login_openid_text %></p>
<% form_tag(session_path, :id => "session_form", :class => "standard-form") do %>
<p>
<label for="openid_url" class="rightish">
<%= image_tag "openid-icon.gif" %>
OpenID
</label>
<%= text_field_tag "openid_url" %>
</p>
<p>
<span class="rightish">
&nbsp;
</span>
<%= submit_tag 'Log in' %>
&nbsp;
<!--
<%= check_box_tag 'remember_me', 1, true %>
<label for="remember_me">Remember me</label>
-->
<!-- BEGIN ID SELECTOR -->
<script type="text/javascript">
<!--
// Tell ID Selector which controls to affect
var idselector_input_id = "openid_url";
var idselector_target_id = "openid_login_wtf";
-->
</script>
<%= javascript_include_tag "idselector" %>
<!-- END ID SELECTOR -->
</p>
<% end %>
Binary file not shown.
Binary file not shown.
Oops, something went wrong.

0 comments on commit 5764e89

Please sign in to comment.