casein 4.0.0 → 5.0.0.0
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.
- checksums.yaml +4 -4
- data/LICENSE +246 -0
- data/PUBLIC_VERSION.yml +2 -2
- data/README.rdoc +73 -49
- data/Rakefile +7 -5
- data/app/assets/fonts/casein/glyphiconshalflings-regular.eot +0 -0
- data/app/assets/fonts/casein/glyphiconshalflings-regular.otf +0 -0
- data/app/assets/fonts/casein/glyphiconshalflings-regular.svg +175 -0
- data/app/assets/fonts/casein/glyphiconshalflings-regular.ttf +0 -0
- data/app/assets/fonts/casein/glyphiconshalflings-regular.woff +0 -0
- data/app/assets/images/casein/casein.png +0 -0
- data/app/assets/javascripts/casein/bootstrap.js +1966 -0
- data/app/assets/javascripts/casein/casein.js +34 -19
- data/app/assets/javascripts/casein/html5shiv.js +8 -0
- data/app/assets/stylesheets/casein/bootstrap-glyphicons.css.scss +2 -0
- data/app/assets/stylesheets/casein/bootstrap.css +4692 -0
- data/app/assets/stylesheets/casein/casein-bootstrap-overrides.css.scss +76 -0
- data/app/assets/stylesheets/casein/casein.css.scss +258 -3
- data/app/assets/stylesheets/casein/login.css.scss +48 -109
- data/app/controllers/casein/{user_sessions_controller.rb → admin_user_sessions_controller.rb} +6 -10
- data/app/controllers/casein/admin_users_controller.rb +124 -0
- data/app/controllers/casein/casein_controller.rb +11 -9
- data/app/controllers/casein/password_resets_controller.rb +8 -10
- data/app/helpers/casein/casein_helper.rb +94 -31
- data/app/mailers/casein/casein_notification.rb +13 -13
- data/app/models/casein/{user.rb → admin_user.rb} +2 -2
- data/app/models/casein/{user_session.rb → admin_user_session.rb} +1 -1
- data/app/views/casein/admin_user_sessions/new.html.erb +56 -0
- data/app/views/casein/admin_users/index.html.erb +39 -0
- data/app/views/casein/admin_users/new.html.erb +57 -0
- data/app/views/casein/admin_users/show.html.erb +104 -0
- data/app/views/casein/casein/blank.html.erb +12 -1
- data/app/views/casein/casein_notification/generate_new_password.erb +1 -1
- data/app/views/casein/casein_notification/new_user_information.erb +1 -1
- data/app/views/casein/casein_notification/password_reset_instructions.erb +1 -1
- data/app/views/casein/password_resets/edit.html.erb +21 -33
- data/app/views/layouts/casein_auth.html.erb +34 -22
- data/app/views/layouts/casein_main.html.erb +111 -64
- data/config/initializers/will_paginate.rb +40 -0
- data/config/routes.rb +2 -2
- data/lib/casein.rb +9 -3
- data/lib/casein/engine.rb +5 -1
- data/lib/generators/casein/install/install_generator.rb +3 -3
- data/lib/generators/casein/install/templates/app/helpers/casein/config_helper.rb +10 -11
- data/lib/generators/casein/install/templates/app/views/casein/layouts/{_left_navigation.html.erb → _tab_navigation.html.erb} +0 -0
- data/lib/generators/casein/install/templates/app/views/casein/layouts/_top_navigation.html.erb +4 -0
- data/lib/generators/casein/install/templates/db/migrate/{casein_create_users.rb → casein_create_admin_users.rb} +3 -3
- data/lib/generators/casein/scaffold/scaffold_generator.rb +20 -8
- data/lib/generators/casein/scaffold/templates/controller.rb +6 -6
- data/lib/generators/casein/scaffold/templates/views/_form.html.erb +11 -8
- data/lib/generators/casein/scaffold/templates/views/_table.html.erb +12 -10
- data/lib/generators/casein/scaffold/templates/views/index.html.erb +7 -3
- data/lib/generators/casein/scaffold/templates/views/new.html.erb +3 -3
- data/lib/generators/casein/scaffold/templates/views/show.html.erb +5 -5
- data/lib/railties/tasks.rake +15 -13
- metadata +67 -46
- data/MIT-LICENSE +0 -21
- data/app/assets/images/casein/header.png +0 -0
- data/app/assets/images/casein/icons/add.png +0 -0
- data/app/assets/images/casein/icons/delete.png +0 -0
- data/app/assets/images/casein/icons/table.png +0 -0
- data/app/assets/images/casein/login/alertBg.png +0 -0
- data/app/assets/images/casein/login/background.png +0 -0
- data/app/assets/images/casein/login/bottom.png +0 -0
- data/app/assets/images/casein/login/loginBoxBg.png +0 -0
- data/app/assets/images/casein/login/loginBoxBottom.png +0 -0
- data/app/assets/images/casein/login/loginBoxTop.png +0 -0
- data/app/assets/images/casein/login/loginSubmit.png +0 -0
- data/app/assets/images/casein/login/recoverSubmit.png +0 -0
- data/app/assets/images/casein/login/top.png +0 -0
- data/app/assets/images/casein/nav.png +0 -0
- data/app/assets/images/casein/rightNav.png +0 -0
- data/app/assets/images/casein/rightNavButton.png +0 -0
- data/app/assets/images/casein/visitSiteNav.png +0 -0
- data/app/assets/javascripts/casein/login.js +0 -27
- data/app/assets/stylesheets/casein/elements.css.scss +0 -307
- data/app/assets/stylesheets/casein/screen.css.scss +0 -224
- data/app/controllers/casein/users_controller.rb +0 -108
- data/app/views/casein/user_sessions/new.html.erb +0 -66
- data/app/views/casein/users/index.html.erb +0 -35
- data/app/views/casein/users/new.html.erb +0 -46
- data/app/views/casein/users/show.html.erb +0 -94
- data/lib/generators/casein/install/templates/app/views/casein/layouts/_right_navigation.html.erb +0 -1
|
@@ -4,35 +4,35 @@ module Casein
|
|
|
4
4
|
|
|
5
5
|
self.prepend_view_path File.join(File.dirname(__FILE__), '..', 'views', 'casein')
|
|
6
6
|
|
|
7
|
-
def generate_new_password from,
|
|
8
|
-
@name =
|
|
7
|
+
def generate_new_password from, casein_admin_user, host, pass
|
|
8
|
+
@name = casein_admin_user.name
|
|
9
9
|
@host = host
|
|
10
|
-
@login =
|
|
10
|
+
@login = casein_admin_user.login
|
|
11
11
|
@pass = pass
|
|
12
12
|
@from_text = casein_config_website_name
|
|
13
13
|
|
|
14
|
-
mail(:to =>
|
|
14
|
+
mail(:to => casein_admin_user.email, :from => from, :subject => "[#{casein_config_website_name}] New password")
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
def new_user_information from,
|
|
18
|
-
@name =
|
|
17
|
+
def new_user_information from, casein_admin_user, host, pass
|
|
18
|
+
@name = casein_admin_user.name
|
|
19
19
|
@host = host
|
|
20
|
-
@login =
|
|
20
|
+
@login = casein_admin_user.login
|
|
21
21
|
@pass = pass
|
|
22
22
|
@from_text = casein_config_website_name
|
|
23
23
|
|
|
24
|
-
mail(:to =>
|
|
24
|
+
mail(:to => casein_admin_user.email, :from => from, :subject => "[#{casein_config_website_name}] New user account")
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
-
def password_reset_instructions from,
|
|
27
|
+
def password_reset_instructions from, casein_admin_user, host
|
|
28
28
|
ActionMailer::Base.default_url_options[:host] = host.gsub("http://", "")
|
|
29
|
-
@name =
|
|
29
|
+
@name = casein_admin_user.name
|
|
30
30
|
@host = host
|
|
31
|
-
@login =
|
|
32
|
-
@reset_password_url = edit_casein_password_reset_url + "/?token=#{
|
|
31
|
+
@login = casein_admin_user.login
|
|
32
|
+
@reset_password_url = edit_casein_password_reset_url + "/?token=#{casein_admin_user.perishable_token}"
|
|
33
33
|
@from_text = casein_config_website_name
|
|
34
34
|
|
|
35
|
-
mail(:to =>
|
|
35
|
+
mail(:to => casein_admin_user.email, :from => from, :subject => "[#{casein_config_website_name}] Password reset instructions")
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
end
|
|
@@ -4,7 +4,7 @@ $CASEIN_USER_ACCESS_LEVEL_ADMIN = 0
|
|
|
4
4
|
$CASEIN_USER_ACCESS_LEVEL_USER = 10
|
|
5
5
|
|
|
6
6
|
module Casein
|
|
7
|
-
class
|
|
7
|
+
class AdminUser < ActiveRecord::Base
|
|
8
8
|
|
|
9
9
|
def self.table_name
|
|
10
10
|
self.to_s.gsub("::", "_").tableize
|
|
@@ -24,7 +24,7 @@ module Casein
|
|
|
24
24
|
validates_presence_of :time_zone
|
|
25
25
|
|
|
26
26
|
def self.has_more_than_one_admin
|
|
27
|
-
Casein::
|
|
27
|
+
Casein::AdminUser.where(:access_level => $CASEIN_USER_ACCESS_LEVEL_ADMIN).count > 1
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def send_create_notification
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<%= form_for @admin_user_session, :url => casein_admin_user_session_path do |f| %>
|
|
2
|
+
<% if @admin_user_session.errors.any? %>
|
|
3
|
+
<div id="error_messages" class="alert alert-danger">
|
|
4
|
+
<% @admin_user_session.errors.keys.each do |key| %>
|
|
5
|
+
<%= (key.to_s.humanize + " ") unless key == :base %>
|
|
6
|
+
<%= @admin_user_session.errors[key].first %>
|
|
7
|
+
<% end %>
|
|
8
|
+
</div>
|
|
9
|
+
<% end %>
|
|
10
|
+
|
|
11
|
+
<% if flash[:warning] %>
|
|
12
|
+
<div id="error" class="alert alert-danger">
|
|
13
|
+
<%= flash[:warning] %>
|
|
14
|
+
</div>
|
|
15
|
+
<% end %>
|
|
16
|
+
<% if flash[:notice] %>
|
|
17
|
+
<div id="notice" class="alert alert-success">
|
|
18
|
+
<%= flash[:notice] %>
|
|
19
|
+
</div>
|
|
20
|
+
<% end %>
|
|
21
|
+
|
|
22
|
+
<div class="form-group">
|
|
23
|
+
<%= f.text_field :login, :placeholder => "Username", :class => "form-control input-large" %>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="form-group">
|
|
26
|
+
<%= f.password_field :password, :placeholder => "Password", :class => "form-control input-large" %>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div class="form-group">
|
|
30
|
+
<div class="checkbox-inline">
|
|
31
|
+
<label>
|
|
32
|
+
<%= f.check_box :remember_me %> Remember me
|
|
33
|
+
</label>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div class="form-group">
|
|
38
|
+
<%= f.submit "Sign in", :class => "btn btn-success btn-large btn-block" %>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div class="form-group">
|
|
42
|
+
<input type="button" value="Forgotten password?" class="btn btn-link" onclick="toggleDiv('recover');" />
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<% end %>
|
|
46
|
+
|
|
47
|
+
<%= form_tag casein_password_reset_url do %>
|
|
48
|
+
<div id="recover" style="display:none;">
|
|
49
|
+
<div class="form-group">
|
|
50
|
+
<%= text_field_tag :recover_email, params[:recover_email], :placeholder => "Your email address", :class => "form-control input-large" %>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="form-group">
|
|
53
|
+
<%= submit_tag "Reset password", :class => "btn btn-primary btn-large btn-block" %>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<% end %>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<h2>Users<%= casein_pagination_details @users %></h2>
|
|
2
|
+
|
|
3
|
+
<table class="table table-striped table-hover table-condensed">
|
|
4
|
+
<thead>
|
|
5
|
+
<tr>
|
|
6
|
+
<th><%= casein_sort_link 'Username', :login %></th>
|
|
7
|
+
<th><%= casein_sort_link 'Name', :name %></th>
|
|
8
|
+
<th><%= casein_sort_link 'Role', :access_level %></th>
|
|
9
|
+
<th> </th>
|
|
10
|
+
</tr>
|
|
11
|
+
</thead>
|
|
12
|
+
|
|
13
|
+
<% @users.each do |user| %>
|
|
14
|
+
<tr>
|
|
15
|
+
<td><%= casein_table_cell_link user.login, casein_admin_user_path(user) %></td>
|
|
16
|
+
<td><%= casein_table_cell_link user.name, casein_admin_user_path(user) %></td>
|
|
17
|
+
<td><%= casein_table_cell_link casein_get_access_level_text(user.access_level), casein_admin_user_path(user) %></td>
|
|
18
|
+
<td class="delete">
|
|
19
|
+
<% if user.is_admin? == false || Casein::AdminUser.has_more_than_one_admin %>
|
|
20
|
+
<% confirm_message = "Are you sure you want to delete #{user.name}?" %>
|
|
21
|
+
|
|
22
|
+
<% if user.id == @session_user.id %>
|
|
23
|
+
<% confirm_message += "\n\nWARNING: This is your user account. You will be signed out if you proceed." %>
|
|
24
|
+
<% end %>
|
|
25
|
+
|
|
26
|
+
<%= link_to(casein_show_row_icon("trash"), casein_admin_user_path(user), :method => :delete, :data => { :confirm => confirm_message }) %>
|
|
27
|
+
<% end %>
|
|
28
|
+
</td>
|
|
29
|
+
</tr>
|
|
30
|
+
<% end %>
|
|
31
|
+
</table>
|
|
32
|
+
|
|
33
|
+
<div class="text-center">
|
|
34
|
+
<%= will_paginate @users %>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<%= content_for :sidebar do %>
|
|
38
|
+
<li><%= link_to "#{casein_show_icon('plus-sign')}Add a new user".html_safe, new_casein_admin_user_path %></li>
|
|
39
|
+
<% end %>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<h2>Add a new user</h2>
|
|
2
|
+
|
|
3
|
+
<%= form_for @casein_admin_user do |form| %>
|
|
4
|
+
|
|
5
|
+
<div class="row">
|
|
6
|
+
<div class="col-lg-6">
|
|
7
|
+
<%= casein_text_field form, @casein_admin_user, :login, {:size => 30, :casein_label => "Username"} %>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="col-lg-6">
|
|
10
|
+
<%= casein_text_field form, @casein_admin_user, :name %>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div class="row">
|
|
15
|
+
<div class="col-lg-6">
|
|
16
|
+
<%= casein_text_field form, @casein_admin_user, :email %>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="col-lg-6">
|
|
19
|
+
<%= casein_time_zone_select form, @casein_admin_user, :time_zone, ActiveSupport::TimeZone.us_zones %>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<div class="row">
|
|
25
|
+
<div class="col-lg-6">
|
|
26
|
+
<%= casein_select form, @casein_admin_user, :access_level, casein_get_access_level_array, {:casein_label => "Role"} %>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="col-lg-6">
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="row">
|
|
33
|
+
<div class="col-lg-6">
|
|
34
|
+
<%= casein_password_field form, @casein_admin_user, :password, {:casein_label => "Password"} %>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="col-lg-6">
|
|
37
|
+
<%= casein_password_field form, @casein_admin_user, :password_confirmation, {:casein_label => "Repeat password"} %>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="col-lg-12 password-checkbox">
|
|
40
|
+
<div class="checkbox">
|
|
41
|
+
<label>
|
|
42
|
+
<%= check_box_tag :generate_random_password, "1", false, {:id => 'generate-random-password-checkbox'} %> Generate random password
|
|
43
|
+
</label>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<p class="submits">
|
|
49
|
+
<%= link_to 'Cancel', casein_admin_users_path, :class => 'btn btn-mini btn-danger' %>
|
|
50
|
+
<%= form.submit "Add new user", :class => "btn btn-mini btn-primary" %>
|
|
51
|
+
</p>
|
|
52
|
+
|
|
53
|
+
<% end %>
|
|
54
|
+
|
|
55
|
+
<%= content_for :sidebar do %>
|
|
56
|
+
<li><%= link_to "#{casein_show_icon('th-list')}Back to list".html_safe, casein_admin_users_path %></li>
|
|
57
|
+
<% end %>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<h2>View user</h2>
|
|
2
|
+
|
|
3
|
+
<%= form_for @casein_admin_user do |f| %>
|
|
4
|
+
|
|
5
|
+
<div class="row">
|
|
6
|
+
<div class="col-lg-6">
|
|
7
|
+
<%= casein_text_field f, f.object, :login, {:size => 30, :casein_label => "Username"} %>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="col-lg-6">
|
|
10
|
+
<%= casein_text_field f, f.object, :name %>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<div class="row">
|
|
15
|
+
<div class="col-lg-6">
|
|
16
|
+
<%= casein_text_field f, f.object, :email %>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="col-lg-6">
|
|
19
|
+
<%= casein_time_zone_select f, f.object, :time_zone, ActiveSupport::TimeZone.us_zones %>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<% if @session_user.is_admin? && (@casein_admin_user.is_admin? == false || Casein::AdminUser.has_more_than_one_admin) %>
|
|
24
|
+
<div class="row">
|
|
25
|
+
<div class="col-lg-6">
|
|
26
|
+
<%= casein_select f, f.object, :access_level, casein_get_access_level_array, {:casein_label => "Role"} %>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="col-lg-6">
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<% end %>
|
|
32
|
+
|
|
33
|
+
<p class="submits">
|
|
34
|
+
<%= link_to 'Cancel', casein_admin_users_path, :class => 'btn btn-mini btn-danger' %>
|
|
35
|
+
<%= f.submit "Save changes", :class => "btn btn-mini btn-primary" %>
|
|
36
|
+
</p>
|
|
37
|
+
<% end %>
|
|
38
|
+
|
|
39
|
+
<% if @session_user.is_admin? %>
|
|
40
|
+
|
|
41
|
+
<h2>Reset password <small>(admin action — use carefully)</small></h2>
|
|
42
|
+
|
|
43
|
+
<%= form_for @casein_admin_user, :url => reset_password_casein_admin_user_path(@casein_admin_user) do |f| %>
|
|
44
|
+
|
|
45
|
+
<div class="row">
|
|
46
|
+
<div class="col-lg-6">
|
|
47
|
+
<%= casein_password_field f, f.object, :password, {:casein_label => "New password"} %>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="col-lg-6">
|
|
50
|
+
<%= casein_password_field f, f.object, :password_confirmation, {:casein_label => "Repeat new password"} %>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="col-lg-12 password-checkbox">
|
|
53
|
+
<div class="checkbox">
|
|
54
|
+
<label>
|
|
55
|
+
<%= check_box_tag :generate_random_password, "1", false, {:id => 'generate-random-password-checkbox'} %> Generate random password
|
|
56
|
+
</label>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<p class="submits">
|
|
62
|
+
<%= f.submit "Reset", :class => "btn btn-mini btn-warning" %>
|
|
63
|
+
</p>
|
|
64
|
+
|
|
65
|
+
<% end %>
|
|
66
|
+
|
|
67
|
+
<% elsif @session_user.id == @casein_admin_user.id %>
|
|
68
|
+
|
|
69
|
+
<h2>Change password</h2>
|
|
70
|
+
|
|
71
|
+
<%= form_for @casein_admin_user, :url => update_password_casein_admin_user_path(@casein_admin_user) do |f| %>
|
|
72
|
+
|
|
73
|
+
<div class="row">
|
|
74
|
+
<div class="col-lg-6">
|
|
75
|
+
<div class="form-group">
|
|
76
|
+
<%= label_tag :form_current_password, "Current password" %>
|
|
77
|
+
<%= password_field_tag :form_current_password, "", {:class => 'form-control'} %>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
<div class="col-lg-6">
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<div class="row">
|
|
85
|
+
<div class="col-lg-6">
|
|
86
|
+
<%= casein_password_field f, f.object, :password, {:casein_label => "New password"} %>
|
|
87
|
+
</div>
|
|
88
|
+
<div class="col-lg-6">
|
|
89
|
+
<%= casein_password_field f, f.object, :password_confirmation, {:casein_label => "Repeat new password"} %>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<p class="submits">
|
|
94
|
+
<%= f.submit "Change", :class => "btn btn-mini btn-primary" %>
|
|
95
|
+
</p>
|
|
96
|
+
|
|
97
|
+
<% end %>
|
|
98
|
+
<% end %>
|
|
99
|
+
|
|
100
|
+
<%= content_for :sidebar do %>
|
|
101
|
+
<% if @session_user.is_admin? %>
|
|
102
|
+
<li><%= link_to "#{casein_show_icon('th-list')}Back to list".html_safe, casein_admin_users_path %></li>
|
|
103
|
+
<% end %>
|
|
104
|
+
<% end %>
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
<
|
|
1
|
+
<br />
|
|
2
|
+
<br />
|
|
3
|
+
<div class="container">
|
|
4
|
+
<div class="jumbotron" style="text-align: center;">
|
|
5
|
+
<h1>Welcome to Casein</h1>
|
|
6
|
+
<br />
|
|
7
|
+
<p>You’re ready to begin scaffolding and customizing!</p>
|
|
8
|
+
<p><small style="font-size: 0.7em;">To remove this screen, set <code>casein_config_dashboard_url</code></small></p>
|
|
9
|
+
<br />
|
|
10
|
+
<p><a href="https://github.com/russellquinn/casein/blob/master/README.rdoc" class="btn btn-primary btn-large">View README on GitHub</a></p>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Dear <%= @name %>,<br />
|
|
2
2
|
<br />
|
|
3
|
-
A request to reset the password for
|
|
3
|
+
A request to reset the password for username '<%= @login %>' has been made.<br />
|
|
4
4
|
If you did not make this request, simply ignore this email.<br />
|
|
5
5
|
Otherwise, click the link below to proceed:<br />
|
|
6
6
|
<br />
|
|
@@ -1,48 +1,36 @@
|
|
|
1
1
|
<%= form_for @reset_user, :url => casein_password_reset_path do |f| %>
|
|
2
2
|
|
|
3
3
|
<% if @reset_user.errors.any? %>
|
|
4
|
-
<div class="
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<% end %>
|
|
10
|
-
</p>
|
|
4
|
+
<div id="error_messages" class="alert alert-danger">
|
|
5
|
+
<% @reset_user.errors.keys.each do |key| %>
|
|
6
|
+
<%= (key.to_s.humanize + " ") unless key == :base %>
|
|
7
|
+
<%= @reset_user.errors[key].first %>
|
|
8
|
+
<% end %>
|
|
11
9
|
</div>
|
|
12
10
|
<% end %>
|
|
13
11
|
|
|
14
12
|
<% if flash[:warning] %>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<% end %>
|
|
13
|
+
<div id="error" class="alert alert-danger">
|
|
14
|
+
<%= flash[:warning] %>
|
|
15
|
+
</div>
|
|
16
|
+
<% end %>
|
|
17
|
+
<% if flash[:notice] %>
|
|
18
|
+
<div id="notice" class="alert alert-success">
|
|
19
|
+
<%= flash[:notice] %>
|
|
20
|
+
</div>
|
|
21
|
+
<% end %>
|
|
25
22
|
|
|
26
23
|
<%= hidden_field_tag :token, params[:token] %>
|
|
27
24
|
|
|
28
|
-
<div class="
|
|
29
|
-
|
|
30
|
-
<%= f.label :password, "Password:" %>
|
|
31
|
-
<%= f.password_field :password, :class => "caseinTextField" %>
|
|
32
|
-
</p>
|
|
25
|
+
<div class="form-group">
|
|
26
|
+
<%= f.password_field :password, :autocomplete => :off, :placeholder => "New password", :class => "form-control input-large" %>
|
|
33
27
|
</div>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<p>
|
|
37
|
-
<%= f.label :password_confirmation, "Confirm password:" %>
|
|
38
|
-
<%= f.password_field :password_confirmation, :class => "caseinTextField" %>
|
|
39
|
-
</p>
|
|
28
|
+
<div class="form-group">
|
|
29
|
+
<%= f.password_field :password_confirmation, :autocomplete => :off, :placeholder => "Confirm password", :class => "form-control input-large" %>
|
|
40
30
|
</div>
|
|
41
|
-
|
|
42
|
-
<div class="
|
|
43
|
-
|
|
44
|
-
<%= f.submit "Reset password", :class => "caseinSubmit" %>
|
|
45
|
-
</p>
|
|
31
|
+
|
|
32
|
+
<div class="form-group">
|
|
33
|
+
<%= f.submit "Change password", :class => "btn btn-success btn-large btn-block" %>
|
|
46
34
|
</div>
|
|
47
35
|
|
|
48
36
|
<% end %>
|