rules_engine_users 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/rules_engine/controller_users.rb +3 -3
- data/rails_generators/manifests/rules_engine_users.rb +15 -3
- data/rails_generators/manifests/rules_engine_users.yml +4 -3
- data/rails_generators/templates/app/controllers/admin/users_controller.rb +2 -0
- data/rails_generators/templates/app/controllers/users_controller.rb +81 -5
- data/rails_generators/templates/app/models/user_mailer.rb +1 -1
- data/rails_generators/templates/app/models/user_observer.rb +1 -0
- data/rails_generators/templates/app/views/users/_login_form.html.erb +24 -0
- data/rails_generators/templates/app/views/users/_pswd_forgot_form.html.erb +22 -0
- data/rails_generators/templates/app/views/users/_signup_form.html.erb +26 -0
- data/rails_generators/templates/app/views/users/change_form.html.erb +5 -9
- data/rails_generators/templates/app/views/users/details.html.erb +1 -0
- data/rails_generators/templates/app/views/users/login_form.html.erb +8 -22
- data/rails_generators/templates/app/views/users/login_form.js.erb +37 -0
- data/rails_generators/templates/app/views/users/pswd_change_form.html.erb +5 -8
- data/rails_generators/templates/app/views/users/pswd_forgot_form.html.erb +13 -18
- data/rails_generators/templates/app/views/users/pswd_forgot_form.js.erb +29 -0
- data/rails_generators/templates/app/views/users/pswd_reset_form.html.erb +3 -8
- data/rails_generators/templates/app/views/users/signup_form.html.erb +13 -0
- data/rails_generators/templates/app/views/users/signup_form.js.erb +29 -0
- data/rails_generators/templates/app/views/users/welcome_form.html.erb +3 -7
- data/rails_generators/templates/config/initializers/rules_engine_users.rb +4 -0
- data/rails_generators/templates/db/migrate/20100104014507_create_users.rb +1 -1
- data/rails_generators/templates/doc/README.rules_engine_users +83 -76
- data/rails_generators/templates/spec/controllers/users_controller_spec.rb +312 -183
- data/rails_generators/templates/spec/models/user_mailer_spec.rb +1 -1
- data/rails_generators/templates/{features/support/blueprint_users.rb → spec/support/rules_engine_users_blueprints.rb} +0 -0
- data/rails_generators/templates/spec/support/rules_engine_users_macros.rb +16 -0
- data/spec/rules_engine/controller_users_spec.rb +3 -3
- metadata +17 -13
- data/.document +0 -5
- data/.gitignore +0 -22
- data/Rakefile +0 -47
- data/rails_generators/templates/spec/support/rules_engine_macros.rb +0 -16
- data/rules_engine_users.gemspec +0 -141
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
@@ -76,13 +76,13 @@ module RulesEngine
|
|
76
76
|
USER_ACCESS_LEVEL << [name.to_s.titleize, access_level]
|
77
77
|
end
|
78
78
|
|
79
|
-
(class <<
|
79
|
+
(class << self; self end).instance_eval do
|
80
80
|
define_method "#{name}_access_level" do
|
81
81
|
access_level
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
|
-
define_method "
|
85
|
+
define_method "#{name}?" do
|
86
86
|
logged_in? && current_user.access_level >= access_level
|
87
87
|
end
|
88
88
|
|
@@ -95,7 +95,7 @@ module RulesEngine
|
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
98
|
-
self.send :helper_method, "
|
98
|
+
self.send :helper_method, "#{name}?"
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
@@ -8,11 +8,11 @@ class RulesEngineUsersManifest
|
|
8
8
|
app/views/admin/users
|
9
9
|
app/views/user_mailer
|
10
10
|
app/views/users
|
11
|
+
config/initializers
|
11
12
|
db/migrate
|
12
13
|
doc
|
13
14
|
features/admin/user
|
14
15
|
features/admin/user/step_definitions
|
15
|
-
features/support
|
16
16
|
features/user
|
17
17
|
features/user/step_definitions
|
18
18
|
spec/controllers
|
@@ -36,13 +36,21 @@ class RulesEngineUsersManifest
|
|
36
36
|
app/views/admin/users/show.html.erb
|
37
37
|
app/views/user_mailer/forgot_password.html.erb
|
38
38
|
app/views/user_mailer/welcome_message.html.erb
|
39
|
+
app/views/users/_login_form.html.erb
|
40
|
+
app/views/users/_pswd_forgot_form.html.erb
|
41
|
+
app/views/users/_signup_form.html.erb
|
39
42
|
app/views/users/change_form.html.erb
|
40
43
|
app/views/users/details.html.erb
|
41
44
|
app/views/users/login_form.html.erb
|
45
|
+
app/views/users/login_form.js.erb
|
42
46
|
app/views/users/pswd_change_form.html.erb
|
43
47
|
app/views/users/pswd_forgot_form.html.erb
|
48
|
+
app/views/users/pswd_forgot_form.js.erb
|
44
49
|
app/views/users/pswd_reset_form.html.erb
|
50
|
+
app/views/users/signup_form.html.erb
|
51
|
+
app/views/users/signup_form.js.erb
|
45
52
|
app/views/users/welcome_form.html.erb
|
53
|
+
config/initializers/rules_engine_users.rb
|
46
54
|
db/migrate/20100104014507_create_users.rb
|
47
55
|
doc/README.rules_engine_users
|
48
56
|
doc/README.rules_engine_users_paths
|
@@ -53,7 +61,6 @@ class RulesEngineUsersManifest
|
|
53
61
|
features/admin/user/step_definitions/edit_steps.rb
|
54
62
|
features/admin/user/step_definitions/index_steps.rb
|
55
63
|
features/admin/user/step_definitions/show_steps.rb
|
56
|
-
features/support/blueprint_users.rb
|
57
64
|
features/user/change.feature
|
58
65
|
features/user/details.feature
|
59
66
|
features/user/login.feature
|
@@ -69,11 +76,16 @@ class RulesEngineUsersManifest
|
|
69
76
|
spec/models/user_mailer_spec.rb
|
70
77
|
spec/models/user_observer_spec.rb
|
71
78
|
spec/models/user_spec.rb
|
72
|
-
spec/support/
|
79
|
+
spec/support/rules_engine_users_blueprints.rb
|
80
|
+
spec/support/rules_engine_users_macros.rb
|
73
81
|
).each do |filename|
|
74
82
|
m.file filename, filename
|
75
83
|
end
|
76
84
|
|
77
85
|
|
78
86
|
end
|
87
|
+
|
88
|
+
def self.after_generate()
|
89
|
+
end
|
90
|
+
|
79
91
|
end
|
@@ -18,6 +18,8 @@ files :
|
|
18
18
|
- app/models/user_mailer.rb
|
19
19
|
- app/models/user_observer.rb
|
20
20
|
|
21
|
+
- config/initializers/rules_engine_users.rb
|
22
|
+
|
21
23
|
- db/migrate/20100104014507_create_users.rb
|
22
24
|
|
23
25
|
- spec/controllers/users_controller_spec.rb
|
@@ -27,6 +29,5 @@ files :
|
|
27
29
|
- spec/models/user_mailer_spec.rb
|
28
30
|
- spec/models/user_observer_spec.rb
|
29
31
|
|
30
|
-
- spec/support/
|
31
|
-
|
32
|
-
- features/support/blueprint_users.rb
|
32
|
+
- spec/support/rules_engine_users_macros.rb
|
33
|
+
- spec/support/rules_engine_users_blueprints.rb
|
@@ -1,4 +1,6 @@
|
|
1
1
|
class UsersController < ApplicationController
|
2
|
+
helper :rules_engine
|
3
|
+
layout 'rules_engine'
|
2
4
|
|
3
5
|
skip_before_filter :verify_authenticity_token, :only => [:login_form, :login] # allow login from anywhere
|
4
6
|
before_filter :login_required, :only=>[:details, :change_form, :change, :pswd_change_form, :pswd_change]
|
@@ -6,17 +8,32 @@ class UsersController < ApplicationController
|
|
6
8
|
def login_form
|
7
9
|
if logged_in?
|
8
10
|
flash[:success] = "User already logged in"
|
9
|
-
|
11
|
+
respond_to do |format|
|
12
|
+
format.html do
|
13
|
+
redirect_to(root_path)
|
14
|
+
end
|
15
|
+
format.js do
|
16
|
+
render :inline => "window.location.href = '#{root_path}';"
|
17
|
+
end
|
18
|
+
end
|
10
19
|
end
|
11
20
|
end
|
12
21
|
|
13
22
|
def login
|
14
23
|
user_params = params[:user] || {}
|
15
24
|
user = User.authenticate_by_email(user_params[:name], user_params[:password]) || User.authenticate_by_login(user_params[:name], user_params[:password])
|
25
|
+
|
16
26
|
unless user.nil?
|
17
27
|
if (user.access_level == User::ACCESS_LEVEL_DISABLED)
|
18
28
|
flash[:error] = "User access disabled"
|
19
|
-
|
29
|
+
respond_to do |format|
|
30
|
+
format.html do
|
31
|
+
redirect_to(root_path)
|
32
|
+
end
|
33
|
+
format.js do
|
34
|
+
render :inline => "window.location.href = '#{root_path}';"
|
35
|
+
end
|
36
|
+
end
|
20
37
|
else
|
21
38
|
self.current_user = user
|
22
39
|
|
@@ -25,7 +42,15 @@ class UsersController < ApplicationController
|
|
25
42
|
cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at }
|
26
43
|
end
|
27
44
|
|
28
|
-
|
45
|
+
respond_to do |format|
|
46
|
+
format.html do
|
47
|
+
redirect_to(session[:return_to] || root_path)
|
48
|
+
end
|
49
|
+
format.js do
|
50
|
+
render :inline => "window.location.href = '#{session[:return_to] || root_path}';"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
29
54
|
end
|
30
55
|
else
|
31
56
|
flash.now[:error] = "Unable to login user"
|
@@ -33,11 +58,44 @@ class UsersController < ApplicationController
|
|
33
58
|
end
|
34
59
|
end
|
35
60
|
|
61
|
+
def signup_form
|
62
|
+
@user = User.new(:time_zone => 'Eastern Time (US & Canada)', :access_level => UsersController.traveller_access_level)
|
63
|
+
|
64
|
+
if logged_in?
|
65
|
+
flash[:success] = "User already logged in"
|
66
|
+
respond_to do |format|
|
67
|
+
format.html do
|
68
|
+
redirect_to(root_path)
|
69
|
+
end
|
70
|
+
format.js do
|
71
|
+
render :inline => "window.location.href = '#{root_path}';"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def signup
|
78
|
+
@user = User.new(params[:user].merge(:access_level => UsersController.traveller_access_level))
|
79
|
+
if @user.save
|
80
|
+
flash[:success] = "A welcome email has been sent to confirm login details"
|
81
|
+
respond_to do |format|
|
82
|
+
format.html do
|
83
|
+
redirect_to(root_path)
|
84
|
+
end
|
85
|
+
format.js do
|
86
|
+
render :inline => "window.location.href = '#{root_path}';"
|
87
|
+
end
|
88
|
+
end
|
89
|
+
else
|
90
|
+
render :action => 'signup_form'
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
36
94
|
def logout
|
37
95
|
self.current_user.reset_remember_token if logged_in?
|
38
96
|
cookies.delete :auth_token
|
39
97
|
reset_session
|
40
|
-
redirect_to(
|
98
|
+
redirect_to(root_path)
|
41
99
|
end
|
42
100
|
|
43
101
|
def details
|
@@ -83,6 +141,17 @@ class UsersController < ApplicationController
|
|
83
141
|
end
|
84
142
|
|
85
143
|
def pswd_forgot_form
|
144
|
+
if logged_in?
|
145
|
+
flash[:success] = "User already logged in"
|
146
|
+
respond_to do |format|
|
147
|
+
format.html do
|
148
|
+
redirect_to(root_path)
|
149
|
+
end
|
150
|
+
format.js do
|
151
|
+
render :inline => "window.location.href = '#{root_path}';"
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
86
155
|
end
|
87
156
|
|
88
157
|
def pswd_forgot
|
@@ -90,7 +159,14 @@ class UsersController < ApplicationController
|
|
90
159
|
user = User.set_reset_token(user_params[:email])
|
91
160
|
if user
|
92
161
|
flash[:success] = "An email has been sent with the password reset details."
|
93
|
-
|
162
|
+
respond_to do |format|
|
163
|
+
format.html do
|
164
|
+
redirect_to(user_login_path)
|
165
|
+
end
|
166
|
+
format.js do
|
167
|
+
render :inline => "window.location.href = '#{user_login_path}';"
|
168
|
+
end
|
169
|
+
end
|
94
170
|
else
|
95
171
|
flash.now[:error] = "Could not reset password"
|
96
172
|
render :action => 'pswd_forgot_form'
|
@@ -8,7 +8,7 @@ class UserMailer < ActionMailer::Base
|
|
8
8
|
@subject = "#{RulesEngine::ControllerUserMail.prefix} Account Created"
|
9
9
|
|
10
10
|
@body[:to_name] = options[:to_name]
|
11
|
-
@body[:to_url] = "http://#{RulesEngine::ControllerUserMail.host}#{
|
11
|
+
@body[:to_url] = "http://#{RulesEngine::ControllerUserMail.host}#{user_welcome_path(:token => options[:token])}"
|
12
12
|
|
13
13
|
@sent_on = Time.current
|
14
14
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<div class="span-15">
|
2
|
+
<h2>User Login</h2>
|
3
|
+
<div class="clear top-5"></div>
|
4
|
+
<div class="error hide" id="login_error"></div>
|
5
|
+
<% re_form_for(:user, :url => user_login_path, :html => {:id => 'user_login_form'}, :span => "5x9") do |f|%>
|
6
|
+
<% re_whitebox do %>
|
7
|
+
<%= f.text_field :name, :size => 38, :required => true, :label => "Email or Login Name" %>
|
8
|
+
<%= f.password_field :password, :size => 25, :required => true%>
|
9
|
+
<%= re_check_box "Remember Me", :remember_me, false, false, :span => "5x9" %>
|
10
|
+
|
11
|
+
<div class="span-8">
|
12
|
+
<div class="float-left">
|
13
|
+
<%= re_button_link_blue("Signup ?", user_signup_path, :class => "fancybox-link") %>
|
14
|
+
<%= re_button_link_blue("Forgot Password ?", user_pswd_forgot_path, :class => "fancybox-link") %>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
<%= re_button_submit("Login", "green", :span => "3", :id => "user_login_submit") %>
|
18
|
+
<div class="hide" id = "user_login_cancel_wrapper">
|
19
|
+
<%= re_button_link_orange('Cancel', root_path, :id => "user_login_cancel") %>
|
20
|
+
</div>
|
21
|
+
<div class="clear"></div>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
</div>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<div class="span-15">
|
2
|
+
<h2>Forgot Your Password?</h2>
|
3
|
+
<div class="clear top-5"></div>
|
4
|
+
<div class="error hide" id="pswd_forgot_error"></div>
|
5
|
+
<% re_form_for(:user, :url => user_pswd_forgot_path, :html => {:id => 'user_pswd_forgot_form'}, :span => "4x10") do |f| %>
|
6
|
+
<% re_whitebox do %>
|
7
|
+
<%= f.text_field :email, :required => true, :size => 40, :label => 'Your Email' %>
|
8
|
+
|
9
|
+
<div class="span-8">
|
10
|
+
<div class="float-left">
|
11
|
+
<%= re_button_link_blue("Login ?", user_login_path, :class => "fancybox-link") %>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<%= re_button_submit("Reset Password", "green", :span => "4", :id => "user_pswd_forgot_submit") %>
|
16
|
+
<div class="hide" id = "user_pswd_forgot_cancel_wrapper">
|
17
|
+
<%= re_button_link_orange('Cancel', root_path, :id => "user_pswd_forgot_cancel") %>
|
18
|
+
</div>
|
19
|
+
<div class="clear"></div>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<div class="span-15">
|
2
|
+
<h2>User Signup</h2>
|
3
|
+
<div class="clear top-5"></div>
|
4
|
+
<div class="error hide" id="signup_error"></div>
|
5
|
+
<% re_form_for(:user, :url => user_signup_path, :html => {:id => 'user_signup_form'}, :span => "5x9") do |f|%>
|
6
|
+
<% re_whitebox do %>
|
7
|
+
<%= f.text_field :full_name, :size => 30, :required => true %>
|
8
|
+
<%= f.text_field :login, :size => 20, :required => true, :label => "Login Name" %>
|
9
|
+
<%= f.text_field :email, :size => 40, :required => true %>
|
10
|
+
<%= f.time_zone_select :time_zone, :required => true %>
|
11
|
+
|
12
|
+
<div class="span-8">
|
13
|
+
<div class="float-left">
|
14
|
+
<%= re_button_link_blue("Login ?", user_login_path, :class => "fancybox-link") %>
|
15
|
+
<%= re_button_link_blue("Forgot Password ?", user_pswd_forgot_path, :class => "fancybox-link") %>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<%= re_button_submit("Signup", "green", :span => "3", :id => "user_signup_submit") %>
|
20
|
+
<div class="hide" id = "user_signup_cancel_wrapper">
|
21
|
+
<%= re_button_link_orange('Cancel', root_path, :id => "user_signup_cancel") %>
|
22
|
+
</div>
|
23
|
+
<div class="clear"></div>
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
26
|
+
</div>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<div class="prepend-1 prepend-top span-15">
|
2
2
|
<h2>Change Your Details</h2>
|
3
|
+
<div class="clear top-5"></div>
|
3
4
|
<% re_form_for(@user, :url=> user_change_path, :method => "post", :html => {:id => 'user_change'}, :span => "3x11") do |f| %>
|
4
5
|
<%= f.error_messages :message => "Unable to Change User Details" %>
|
5
6
|
<% re_whitebox do %>
|
@@ -7,15 +8,10 @@
|
|
7
8
|
<%= f.text_field :login, :size=>20, :required => true, :label => "Login Name"%>
|
8
9
|
<%= f.text_field :email, :size=>40, :required => true%>
|
9
10
|
<%= f.time_zone_select :time_zone, :required => true %>
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<div class="span-10" style="text-align:right;">
|
15
|
-
<%= re_button_submit("Update", "green") %>
|
16
|
-
<%= re_button_link("Cancel", user_details_path, "red") %>
|
17
|
-
<div class="clear"></div>
|
18
|
-
</div>
|
11
|
+
|
12
|
+
<%= link_to("Change Your Password", user_pswd_change_path) %>
|
13
|
+
<%= re_button_submit("Update", "green") %>
|
14
|
+
<%= re_button_link("Cancel", user_details_path, "red") %>
|
19
15
|
<% end %>
|
20
16
|
<% end %>
|
21
17
|
</div>
|
@@ -1,11 +1,13 @@
|
|
1
1
|
<% javascript_tag do %>
|
2
2
|
|
3
3
|
$(document).ready(function() {
|
4
|
-
|
4
|
+
|
5
|
+
$('#user_name').focus();
|
6
|
+
|
5
7
|
$('#user_password').bind('keypress', function(e) {
|
6
8
|
var code = (e.keyCode ? e.keyCode : e.which);
|
7
9
|
if (code == 13) { //Enter keycode
|
8
|
-
$('#
|
10
|
+
$('#user_login_form').submit();
|
9
11
|
return false;
|
10
12
|
}
|
11
13
|
});
|
@@ -13,23 +15,7 @@
|
|
13
15
|
});
|
14
16
|
<% end %>
|
15
17
|
|
16
|
-
|
17
|
-
<div class="
|
18
|
-
|
19
|
-
|
20
|
-
<% re_whitebox do %>
|
21
|
-
<%= f.text_field :name, :size => 38, :required => true, :label => "Email or Login Name" %>
|
22
|
-
<%= f.password_field :password, :size => 25, :required => true%>
|
23
|
-
<%= re_check_box "Remember Me", :remember_me, false, false, :span => "5x11" %>
|
24
|
-
|
25
|
-
<div class="span-11">
|
26
|
-
<%= link_to("Forgot Password?", user_pswd_forgot_path) %>
|
27
|
-
</div>
|
28
|
-
<div class="span-3">
|
29
|
-
<%= re_button_submit("Login", "green", :span => "3") %>
|
30
|
-
</div>
|
31
|
-
<div class="clear"></div>
|
32
|
-
<% end %>
|
33
|
-
<% end %>
|
34
|
-
</div>
|
35
|
-
<div class="clear"></div>
|
18
|
+
<div class="span-16 prepend-1">
|
19
|
+
<div class="clear top-5"></div>
|
20
|
+
<%= render :partial => '/users/login_form' %>
|
21
|
+
</div>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
$('#re_content').html('<%=escape_javascript(render('/users/login_form'))%>');
|
2
|
+
|
3
|
+
$('#user_login_submit').closest('div.re-form-button').re_form_button();
|
4
|
+
|
5
|
+
$("#user_login_cancel_wrapper").show();
|
6
|
+
$("#user_login_form").submit(function() { return false; });
|
7
|
+
|
8
|
+
$("#user_login_cancel").live('click', function() {
|
9
|
+
$.fancybox.close();
|
10
|
+
return false;
|
11
|
+
});
|
12
|
+
|
13
|
+
$("#user_login_submit").live('click', function() {
|
14
|
+
$.re_block();
|
15
|
+
$.post($('#user_login_form').attr('action'), $('#user_login_form').serialize(), null, 'script');
|
16
|
+
return false;
|
17
|
+
});
|
18
|
+
|
19
|
+
jQuery.re_error_message = function(message) {
|
20
|
+
$('#login_error').html(message);
|
21
|
+
$('#login_error').show();
|
22
|
+
}
|
23
|
+
|
24
|
+
<%= re_alert_js %>
|
25
|
+
|
26
|
+
$.re_unblock();
|
27
|
+
$.fancybox({ href: '#re_content'});
|
28
|
+
|
29
|
+
$('#user_name').focus();
|
30
|
+
$('#user_password').bind('keypress', function(e) {
|
31
|
+
var code = (e.keyCode ? e.keyCode : e.which);
|
32
|
+
if (code == 13) { //Enter keycode
|
33
|
+
$.re_block();
|
34
|
+
$.post($('#user_login_form').attr('action'), $('#user_login_form').serialize(), null, 'script');
|
35
|
+
return false;
|
36
|
+
}
|
37
|
+
});
|
@@ -1,18 +1,15 @@
|
|
1
1
|
<div class="prepend-1 prepend-top span-15">
|
2
2
|
<h2>Change Your Password</h2>
|
3
|
-
|
3
|
+
<div class="clear top-5"></div>
|
4
|
+
<% re_form_for(:user, :url => user_pswd_change_path, :html => {:id => 'user_pswd_change'}, :span => "5x9") do |f|%>
|
4
5
|
<% re_whitebox do %>
|
5
6
|
<%= f.password_field :old_password, :label => 'Old Password', :size=>25, :required => true%>
|
6
7
|
<%= f.password_field :password, :label => 'New Password', :size=>25, :required => true%>
|
7
8
|
<%= f.password_field :password_confirmation, :label => 'Confirm New Password', :size=>25, :required => true%>
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
<div class="span-10" style="text-align:right;">
|
13
|
-
<%= re_button_submit("Update", "green") %>
|
14
|
-
<%= re_button_link("Cancel", user_details_path, "red") %>
|
15
|
-
</div>
|
10
|
+
<%= link_to("Change Your Details", user_change_path) %>
|
11
|
+
<%= re_button_submit("Update", "green") %>
|
12
|
+
<%= re_button_link("Cancel", user_details_path, "red") %>
|
16
13
|
<div class="clear"></div>
|
17
14
|
<% end %>
|
18
15
|
<% end %>
|
@@ -1,18 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
<div class="clear"></div>
|
15
|
-
<% end %>
|
16
|
-
<% end %>
|
17
|
-
</div>
|
18
|
-
<div class="clear"></div>
|
1
|
+
<% javascript_tag do %>
|
2
|
+
|
3
|
+
$(document).ready(function() {
|
4
|
+
|
5
|
+
$('#user_email').focus();
|
6
|
+
|
7
|
+
});
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<div class="span-16 prepend-1">
|
11
|
+
<div class="clear top-5"></div>
|
12
|
+
<%= render :partial => '/users/pswd_forgot_form' %>
|
13
|
+
</div>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
$('#re_content').html('<%=escape_javascript(render('/users/pswd_forgot_form'))%>');
|
2
|
+
|
3
|
+
$('#user_pswd_forgot_submit').closest('div.re-form-button').re_form_button();
|
4
|
+
|
5
|
+
$("#user_pswd_forgot_cancel_wrapper").show();
|
6
|
+
$("#user_pswd_forgot_form").submit(function() { return false; });
|
7
|
+
|
8
|
+
$("#user_pswd_forgot_cancel").live('click', function() {
|
9
|
+
$.fancybox.close();
|
10
|
+
return false;
|
11
|
+
});
|
12
|
+
|
13
|
+
$("#user_pswd_forgot_submit").live('click', function() {
|
14
|
+
$.re_block();
|
15
|
+
$.post($('#user_pswd_forgot_form').attr('action'), $('#user_pswd_forgot_form').serialize(), null, 'script');
|
16
|
+
return false;
|
17
|
+
});
|
18
|
+
|
19
|
+
jQuery.re_error_message = function(message) {
|
20
|
+
$('#pswd_forgot_error').html(message);
|
21
|
+
$('#pswd_forgot_error').show();
|
22
|
+
}
|
23
|
+
|
24
|
+
<%= re_alert_js %>
|
25
|
+
|
26
|
+
$.re_unblock();
|
27
|
+
$.fancybox({ href: '#re_content'});
|
28
|
+
|
29
|
+
$('#user_email').focus();
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<div class="prepend-1 prepend-top span-16">
|
2
2
|
<h2>Reset Your Password</h2>
|
3
|
+
<div class="clear top-5"></div>
|
3
4
|
<% re_form_for(:user, :url => user_pswd_reset_path, :html => {:id => "user_pswd_reset"}, :span => "5x11") do |f| %>
|
4
5
|
<% re_whitebox do %>
|
5
6
|
<%= hidden_field_tag :token, @token%>
|
@@ -8,14 +9,8 @@
|
|
8
9
|
<%= f.password_field :password, :label => 'New Password', :size=>25, :required => true%>
|
9
10
|
<%= f.password_field :password_confirmation, :label => 'Confirm New Password', :size=>25, :required => true%>
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
</div>
|
14
|
-
<div class="span-5">
|
15
|
-
<%= re_button_submit("Reset Password", "green", :span => "4") %>
|
16
|
-
</div>
|
17
|
-
<div class="clear"></div>
|
18
|
-
|
12
|
+
<%= re_button_submit("Reset Password", "green", :span => "4") %>
|
13
|
+
<%= re_button_link_orange('Cancel', root_path) %>
|
19
14
|
<% end %>
|
20
15
|
<% end %>
|
21
16
|
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<% javascript_tag do %>
|
2
|
+
|
3
|
+
$(document).ready(function() {
|
4
|
+
|
5
|
+
$('#user_full_name').focus();
|
6
|
+
|
7
|
+
});
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<div class="prepend-1 prepend-top span-16">
|
11
|
+
<div class="clear top-5"></div>
|
12
|
+
<%= render :partial => '/users/signup_form' %>
|
13
|
+
</div>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
$('#re_content').html('<%=escape_javascript(render('/users/signup_form'))%>');
|
2
|
+
|
3
|
+
$('#user_signup_submit').closest('div.re-form-button').re_form_button();
|
4
|
+
|
5
|
+
$("#user_signup_cancel_wrapper").show();
|
6
|
+
$("#user_signup_form").submit(function() { return false; });
|
7
|
+
|
8
|
+
$("#user_signup_cancel").live('click', function() {
|
9
|
+
$.fancybox.close();
|
10
|
+
return false;
|
11
|
+
});
|
12
|
+
|
13
|
+
$("#user_signup_submit").live('click', function() {
|
14
|
+
$.re_block();
|
15
|
+
$.post($('#user_signup_form').attr('action'), $('#user_signup_form').serialize(), null, 'script');
|
16
|
+
return false;
|
17
|
+
});
|
18
|
+
|
19
|
+
jQuery.re_error_message = function(message) {
|
20
|
+
$('#signup_error').html(message);
|
21
|
+
$('#signup_error').show();
|
22
|
+
}
|
23
|
+
|
24
|
+
<%= re_alert_js %>
|
25
|
+
|
26
|
+
$.re_unblock();
|
27
|
+
$.fancybox({ href: '#re_content'});
|
28
|
+
|
29
|
+
$('#user_full_name').focus();
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<div class="prepend-1 prepend-top span-16">
|
2
2
|
<h2>Set Your Password</h2>
|
3
|
+
<div class="clear top-5"></div>
|
3
4
|
<% re_form_for(:user, :url => user_welcome_path, :html => {:id => "user_welcome"}, :span => "5x11") do |f| %>
|
4
5
|
<% re_whitebox do %>
|
5
6
|
<%= hidden_field_tag :token, @token%>
|
@@ -8,13 +9,8 @@
|
|
8
9
|
<%= f.password_field :password, :label => 'New Password', :size=>25, :required => true%>
|
9
10
|
<%= f.password_field :password_confirmation, :label => 'Confirm New Password', :size=>25, :required => true%>
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
</div>
|
14
|
-
<div class="span-5">
|
15
|
-
<%= re_button_submit("Set Password", "green", :span => "4") %>
|
16
|
-
</div>
|
17
|
-
<div class="clear"></div>
|
12
|
+
<%= re_button_submit("Set Password", "green", :span => "4") %>
|
13
|
+
<%= re_button_link_orange('Cancel', root_path) %>
|
18
14
|
<% end %>
|
19
15
|
<% end %>
|
20
16
|
</div>
|