Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 4 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
6 knitkit/app/widgets/signup/base.rb
@@ -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
View
42 knitkit/app/widgets/signup/views/_signup_form.html.erb
@@ -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>
+
View
79 knitkit/app/widgets/signup/views/_signup_form_block.html.erb
@@ -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 %>
+

No commit comments for this range

Something went wrong with that request. Please try again.