Permalink
Browse files

Merge branch 'master' of github.com:portablemind/compass_agile_enterp…

…rise
  • Loading branch information...
2 parents f063bbb + 63e8520 commit 1dbffa86bf35ee88704ec03dd0f1386eb42dcd0a @russ1985 russ1985 committed Jun 21, 2012
@@ -45,7 +45,7 @@ def reset_password
success = false
end
else
- message = "Invalid email address."
+ message = "Invalid user name or email address."
success = false
end
render :json => {:success => success,:message => message}
@@ -4,7 +4,9 @@ module Signup
class Base < ErpApp::Widgets::Base
def index
@login_url = params[:login_url]
+ @user = User.new
render
+
end
def new
@@ -32,8 +34,10 @@ def new
@user.party = individual.party
@user.save
render :update => {:id => "#{@uuid}_result", :view => :success}
+ render :update => {:id => "#{@uuid}_result_form", :view => :success}
else
- render :update => {:id => "#{@uuid}_result", :view => :error}
+ render :update => {:id => "#{@uuid}_result_form", :view => :error}
+
end
rescue Exception=>ex
logger.error ex.message
@@ -1,36 +1,8 @@
<div id="<%=widget_result_id%>"></div>
-<div>
- <%= form_remote_tag build_widget_url(:new) do %>
- <div class="form_settings">
- <p>
- <span>First Name</span>
- <%= text_field_tag :first_name %>
- </p>
- <p>
- <span>Last Name</span>
- <%= text_field_tag :last_name %>
- </p>
- <p>
- <span>Email</span>
- <%= text_field_tag :email %>
- </p>
- <p>
- <span>Username</span>
- <%= text_field_tag :username %>
- </p>
- <p>
- <span>Password</span>
- <%= password_field_tag :password %>
- </p>
- <p>
- <span>Confirm Password</span>
- <%= password_field_tag :password_confirmation %>
- </p>
- <p style="padding-top: 15px">
- <span>&nbsp;</span>
- <%= submit_tag "Sign Up", :disable_with => "Please wait...", :class => "submit", :style => 'margin: 0 0 0 0px;' %>
- </p>
- </div>
- <input type="hidden" value="<%=@login_url%>" name="login_url" />
- <% end %>
-</div>
+
+<div id="<%=widget_result_id%>_form">
+
+ <%= render "/signup_form_block" %>
+
+</div>
+
@@ -0,0 +1,79 @@
+
+<% @first_name_class=""
+ @last_name_class =""
+ @email_class =""
+ @username_class =""
+ @password_class = ""
+%>
+
+
+
+ <% @user.errors.each do |attribute,error| %>
+
+ <%
+
+ case attribute
+
+ when :first_name
+
+ @first_name_class = "input_error"
+
+ when :last_name
+
+ @last_name_class = "input_error"
+
+ when :email
+
+ @email_class= "input_error"
+
+ when :username
+
+ @username_class = "input_error"
+
+ when :password
+
+
+ @password_class = "input_error"
+
+ end
+
+
+ %>
+
+
+<% end %>
+
+ <%= form_remote_tag build_widget_url(:new), :success => "call_success" do %>
+ <div class="form_settings">
+ <p>
+ <span> <%= label_tag :first_name ,'First Name' %> </span>
+ <%= text_field_tag :first_name, nil, :class => @first_name_class %>
+ </p>
+ <p>
+ <span> <%= label_tag :last_name , 'Last Name' %> </span>
+ <%= text_field_tag :last_name , nil, :class => @last_name_class%>
+ </p>
+ <p>
+ <span> <%= label_tag :email , 'Email' %> </span>
+ <%= text_field_tag :email , @user.email , :class => @email_class %>
+ </p>
+ <p>
+ <span> <%= label_tag :username , 'Username' %> </span>
+ <%= text_field_tag :username , @user.username, :class => @username_class %>
+ </p>
+ <p>
+ <span> <%= label_tag :password , 'Password' %> </span>
+ <%= password_field_tag :password , nil, :class => @password_class%>
+ </p>
+ <p>
+ <span> <%= label_tag :password_confirmation , 'Confirm Password' %> </span>
+ <%= password_field_tag :password_confirmation ,nil , :class => @password_class %>
+ </p>
+ <p style="padding-top: 15px">
+ <span>&nbsp;</span>
+ <%= submit_tag "Sign Up", :disable_with => "Please wait...", :class => "submit", :style => 'margin: 0 0 0 0px;' %>
+ </p>
+ </div>
+ <input type="hidden" value="<%=@login_url%>" name="login_url" />
+ <% end %>
+
@@ -1,11 +1,25 @@
+
+
+
+
<div class="sexyerror">
<h2>There was an error.</h2>
<%if !@user.errors.empty?%>
<h3>Please address the following issues</h3>
+
+<hr>
+
<ul>
- <% @user.errors.messages.collect{|k,v| v}.flatten.each do |msg| %>
- <li><%=msg%></li>
- <% end %>
+ <% @user.errors.each do |attribute,error| %>
+ <li class="error_text"><%= attribute.to_s.capitalize %> : <%= error %> </li>
+ <%end%>
</ul>
- <%end%>
-</div>
+
+<%end%>
+</div>
+
+<div id="<%=widget_result_id%>_form">
+
+ <%= render "/signup_form_block" %>
+
+</div>

0 comments on commit 1dbffa8

Please sign in to comment.