tb_core 1.2.8 → 1.3.0.beta1
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/app/assets/javascripts/admin/core/application.js +1 -2
- data/app/assets/javascripts/admin/core/dashboard.js +1 -1
- data/app/assets/javascripts/admin/core/modal.js +4 -13
- data/app/assets/javascripts/admin/core/users.js +0 -120
- data/app/assets/stylesheets/admin/core/application.css.scss +106 -367
- data/app/assets/stylesheets/admin/core/login.css.scss +3 -29
- data/app/controllers/admin/application_controller.rb +1 -2
- data/app/controllers/admin/user_sessions_controller.rb +0 -3
- data/app/controllers/admin/users_controller.rb +3 -13
- data/app/controllers/password_resets_controller.rb +1 -0
- data/app/controllers/spud/application_controller.rb +8 -14
- data/app/controllers/user_sessions_controller.rb +1 -0
- data/app/helpers/admin/application_helper.rb +11 -15
- data/app/helpers/twice_baked/application_helper.rb +24 -1
- data/app/models/spud/spud_user_model.rb +7 -0
- data/app/views/admin/dashboard/index.html.erb +2 -4
- data/app/views/admin/password_resets/index.html.erb +4 -4
- data/app/views/admin/password_resets/show.html.erb +10 -9
- data/app/views/admin/roles/_form.html.erb +20 -22
- data/app/views/admin/roles/index.html.erb +23 -21
- data/app/views/admin/settings/_form.html.erb +36 -45
- data/app/views/admin/settings/edit.html.erb +1 -1
- data/app/views/admin/setup/new.html.erb +37 -46
- data/app/views/admin/user_sessions/new.html.erb +15 -12
- data/app/views/admin/users/_form.html.erb +16 -86
- data/app/views/admin/users/edit.html.erb +1 -1
- data/app/views/admin/users/index.html.erb +47 -27
- data/app/views/admin/users/new.html.erb +1 -1
- data/app/views/admin/users/show.html.erb +21 -31
- data/app/views/layouts/admin/_flashes.html.erb +19 -0
- data/app/views/layouts/admin/application.html.erb +39 -48
- data/app/views/layouts/admin/detail.html.erb +16 -30
- data/app/views/layouts/admin/error_page.html.erb +2 -1
- data/app/views/layouts/admin/login.html.erb +4 -11
- data/app/views/layouts/user_sessions.html.erb +6 -0
- data/app/views/password_resets/index.html.erb +4 -4
- data/app/views/password_resets/show.html.erb +7 -7
- data/app/views/user_sessions/new.html.erb +6 -6
- data/config/locales/en.yml +10 -0
- data/lib/generators/spud/module_generator.rb +6 -4
- data/lib/generators/spud/setup_generator.rb +7 -39
- data/lib/generators/spud/templates/assets/application.css.scss +5 -0
- data/lib/generators/spud/templates/assets/application.js +1 -0
- data/lib/generators/spud/templates/views/admin/_form.html.erb +7 -18
- data/lib/generators/spud/templates/views/admin/index.html.erb +39 -28
- data/lib/generators/spud/templates/views/admin/show.html.erb +6 -7
- data/lib/generators/spud/templates/views/frontend/index.html.erb +2 -1
- data/lib/generators/spud/templates/views/frontend/show.html.erb +6 -4
- data/lib/generators/spud/templates/views/layouts/application.html.erb +16 -6
- data/lib/spud_core/configuration.rb +1 -1
- data/lib/spud_core/engine.rb +9 -1
- data/lib/spud_core/version.rb +1 -1
- data/lib/tb_core/form_builder.rb +254 -0
- data/spec/helpers/spud/admin/application_helper_spec.rb +5 -5
- metadata +38 -14
- data/app/assets/javascripts/admin/core/split_pane.js +0 -150
- data/app/assets/libs/bootstrap/css/bootstrap-responsive.css +0 -1088
- data/app/assets/libs/bootstrap/css/bootstrap.css.scss +0 -5893
- data/app/assets/libs/bootstrap/img/glyphicons-halflings-white.png +0 -0
- data/app/assets/libs/bootstrap/img/glyphicons-halflings.png +0 -0
- data/app/assets/libs/bootstrap/js/bootstrap.js +0 -2025
- data/app/assets/stylesheets/admin/core/roles.css +0 -4
- data/app/assets/stylesheets/admin/core/split_pane.css.scss +0 -126
- data/app/assets/stylesheets/admin/core/users.css.scss +0 -9
@@ -1,16 +1,8 @@
|
|
1
|
-
#content_wrapper {
|
2
|
-
position: relative;
|
3
|
-
width: 100%;
|
4
|
-
height: 100%;
|
5
|
-
}
|
6
1
|
.login-form {
|
7
|
-
|
8
|
-
margin: 75px auto 0;
|
2
|
+
margin-top: 75px;
|
9
3
|
padding: 0px;
|
10
4
|
color:#000;
|
11
5
|
background: #fff;
|
12
|
-
-webkit-border-radius: 10px;
|
13
|
-
-moz-border-radius: 10px;
|
14
6
|
border-radius:10px;
|
15
7
|
box-shadow: 2px 2px 10px #777;
|
16
8
|
overflow-x: hidden;
|
@@ -19,20 +11,8 @@
|
|
19
11
|
.login-form h1 {
|
20
12
|
font-size: 28px;
|
21
13
|
margin: 0 0 20px;
|
22
|
-
padding: 10px;
|
23
|
-
background
|
24
|
-
background-image: linear-gradient(top, rgb(199,90,0) 5%, rgb(179,72,0) 53%);
|
25
|
-
background-image: -o-linear-gradient(top, rgb(199,90,0) 5%, rgb(179,72,0) 53%);
|
26
|
-
background-image: -moz-linear-gradient(top, rgb(199,90,0) 5%, rgb(179,72,0) 53%);
|
27
|
-
background-image: -webkit-linear-gradient(top, rgb(199,90,0) 5%, rgb(179,72,0) 53%);
|
28
|
-
background-image: -ms-linear-gradient(top, rgb(199,90,0) 5%, rgb(179,72,0) 53%);
|
29
|
-
background-image: -webkit-gradient(
|
30
|
-
linear,
|
31
|
-
left top,
|
32
|
-
left bottom,
|
33
|
-
color-stop(0.05, rgb(199,90,0)),
|
34
|
-
color-stop(0.53, rgb(179,72,0))
|
35
|
-
);
|
14
|
+
padding: 10px 20px;
|
15
|
+
background-color:#333;
|
36
16
|
color: #fff;
|
37
17
|
}
|
38
18
|
.login-form .alert{
|
@@ -41,9 +21,3 @@
|
|
41
21
|
.login-form form {
|
42
22
|
margin: 20px;
|
43
23
|
}
|
44
|
-
.login-form .field-group {
|
45
|
-
margin: 0 0 15px;
|
46
|
-
}
|
47
|
-
.login-form label {
|
48
|
-
margin: 0 0 5px;
|
49
|
-
}
|
@@ -20,8 +20,7 @@ private
|
|
20
20
|
def require_admin_user
|
21
21
|
if current_user.blank?
|
22
22
|
flash[:notice] = "You must be logged in to access the requested page"
|
23
|
-
|
24
|
-
redirect_to admin_login_path
|
23
|
+
redirect_to admin_login_path(:return_to => request.path)
|
25
24
|
return false
|
26
25
|
elsif !current_user.has_admin_rights?
|
27
26
|
raise Spud::AccessDeniedError.new(:item => 'module', :template => '/layouts/admin/error_page')
|
@@ -26,9 +26,6 @@ class Admin::UserSessionsController < Admin::ApplicationController
|
|
26
26
|
def destroy
|
27
27
|
current_user_session.destroy
|
28
28
|
flash[:notice] = "Logout successful!"
|
29
|
-
if !request.referer.blank?
|
30
|
-
session[:return_to] = request.referer
|
31
|
-
end
|
32
29
|
redirect_to admin_login_path
|
33
30
|
end
|
34
31
|
|
@@ -1,26 +1,16 @@
|
|
1
1
|
class Admin::UsersController < Admin::ApplicationController
|
2
2
|
|
3
|
-
layout false
|
4
3
|
belongs_to_spud_app :users
|
5
4
|
add_breadcrumb "Users", :admin_users_path
|
6
5
|
before_action :load_user, :only => [:edit, :update, :show, :destroy]
|
7
6
|
respond_to :html
|
8
7
|
|
9
8
|
def index
|
10
|
-
@
|
9
|
+
@spud_users = SpudUser.ordered.paginate(:page => params[:page], :per_page => 15)
|
11
10
|
if params[:search]
|
12
|
-
@
|
13
|
-
end
|
14
|
-
@users = @users.paginate(:page => params[:page])
|
15
|
-
respond_with @users do |format|
|
16
|
-
format.html{
|
17
|
-
if request.xhr?
|
18
|
-
render :partial => 'index'
|
19
|
-
else
|
20
|
-
render 'index', :layout => 'admin/detail'
|
21
|
-
end
|
22
|
-
}
|
11
|
+
@spud_users = @spud_users.where_name_like(params[:search])
|
23
12
|
end
|
13
|
+
respond_with @spud_users
|
24
14
|
end
|
25
15
|
|
26
16
|
def show
|
@@ -45,9 +45,10 @@ private
|
|
45
45
|
|
46
46
|
def require_user
|
47
47
|
unless current_user
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
respond_to do |format|
|
49
|
+
format.html{ redirect_to login_path(:return_to => request.path) }
|
50
|
+
format.json{ raise Spud::AccessDeniedError.new() }
|
51
|
+
end
|
51
52
|
return false
|
52
53
|
end
|
53
54
|
return true
|
@@ -55,29 +56,22 @@ private
|
|
55
56
|
|
56
57
|
def require_admin_user
|
57
58
|
if current_user.blank? || !current_user.has_admin_rights?
|
58
|
-
store_location()
|
59
59
|
raise Spud::AccessDeniedError.new()
|
60
60
|
return false
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
def store_location
|
65
|
-
if request.format.html? && !request.xhr?
|
66
|
-
session[:return_to] = request.url
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
64
|
def redirect_back_or_default(default)
|
71
65
|
redirect_to(back_or_default(default))
|
72
66
|
end
|
73
67
|
|
74
68
|
def back_or_default(default)
|
69
|
+
binding.pry
|
75
70
|
if params[:return_to]
|
76
|
-
|
77
|
-
|
78
|
-
return session[:return_to]
|
71
|
+
uri = URI.parse(params[:return_to].to_s)
|
72
|
+
return uri.path
|
79
73
|
else
|
80
|
-
return default
|
74
|
+
return default
|
81
75
|
end
|
82
76
|
end
|
83
77
|
|
@@ -23,21 +23,6 @@ module Admin::ApplicationHelper
|
|
23
23
|
return style_str
|
24
24
|
end
|
25
25
|
|
26
|
-
def error_messages_for(object)
|
27
|
-
content = ""
|
28
|
-
if object.errors.any?
|
29
|
-
content += "<div class='spud_admin_form_error_list'>"
|
30
|
-
content += "<h4>#{pluralize(object.errors.count, "error")} prohibited you from saving:</h4>"
|
31
|
-
content +="<ul>"
|
32
|
-
object.errors.full_messages.each do |msg|
|
33
|
-
content+="<li>#{msg}</li>"
|
34
|
-
end
|
35
|
-
content +="</ul></div>"
|
36
|
-
end
|
37
|
-
return content.html_safe
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
26
|
def url_for_admin_dashboard_application(url)
|
42
27
|
if Rails.configuration.relative_url_root.blank?
|
43
28
|
return url
|
@@ -46,6 +31,17 @@ module Admin::ApplicationHelper
|
|
46
31
|
end
|
47
32
|
end
|
48
33
|
|
34
|
+
# Build an icon with left padding to indicate nesting below the previous table row
|
35
|
+
#
|
36
|
+
def table_nesting_indicator(depth)
|
37
|
+
if depth > 0
|
38
|
+
depth.times do
|
39
|
+
concat content_tag(:span, '', :class => 'nesting-spacer')
|
40
|
+
end
|
41
|
+
content_tag(:span, "", :class => 'glyphicon glyphicon-chevron-right')
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
49
45
|
# Build a Bootstrap nav-tabs element
|
50
46
|
#
|
51
47
|
# * url_helper: A symbol representing the url helper method. ie: admin_widgets_path
|
@@ -3,7 +3,7 @@ module TwiceBaked::ApplicationHelper
|
|
3
3
|
def tb_form_errors(record)
|
4
4
|
if record.errors.any?
|
5
5
|
content_tag :div, :class => 'form-errors' do
|
6
|
-
concat(
|
6
|
+
concat(tb_form_error_header(record))
|
7
7
|
concat(raw "<ul>")
|
8
8
|
concat(raw record.errors.full_messages.collect{ |msg| "<li>#{msg}</li>" }.join())
|
9
9
|
concat(raw "</ul>")
|
@@ -11,4 +11,27 @@ module TwiceBaked::ApplicationHelper
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
+
def tb_form_error_header(record)
|
15
|
+
if record.errors.any?
|
16
|
+
message = "Please correct the following #{'error'.pluralize(record.errors.size)}:"
|
17
|
+
return content_tag :h4, message, :class => 'form-field-error'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def tb_form_error_field(record, attribute)
|
22
|
+
message = record.errors[attribute].first
|
23
|
+
if message
|
24
|
+
return content_tag :p, message, :class => 'help-block form-field-error'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def tb_form_field(attribute)
|
29
|
+
content_tag :div, :class => 'form-group' do
|
30
|
+
concat label_tag attribute, attribute, :class => 'col-sm-2 control-label'
|
31
|
+
concat(content_tag(:div, :class => 'col-sm-10') do
|
32
|
+
text_field_tag attribute, :placeholder => attribute, :class => 'form-control'
|
33
|
+
end)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
14
37
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
class Spud::SpudUserModel < ActiveRecord::Base
|
2
2
|
self.table_name = 'spud_users'
|
3
|
+
self.abstract_class = true
|
3
4
|
|
4
5
|
acts_as_authentic do |c|
|
5
6
|
c.transition_from_crypto_providers = Authlogic::CryptoProviders::Sha512
|
@@ -14,6 +15,12 @@ class Spud::SpudUserModel < ActiveRecord::Base
|
|
14
15
|
has_many :spud_user_settings
|
15
16
|
before_validation :set_login_to_email, :if => ->{ Spud::Core.config.use_email_as_login }
|
16
17
|
|
18
|
+
scope :admins, ->{
|
19
|
+
where('super_admin = 1 OR role_id IS NOT NULL')
|
20
|
+
}
|
21
|
+
|
22
|
+
scope :ordered, ->{ order('last_name asc, first_name asc, email asc') }
|
23
|
+
|
17
24
|
def full_name
|
18
25
|
if first_name.blank? && last_name.blank?
|
19
26
|
return self.login
|
@@ -1,11 +1,9 @@
|
|
1
1
|
<div class="sortable">
|
2
2
|
<% @admin_applications.each do |admin_application| %>
|
3
|
-
<div class="
|
3
|
+
<div class="admin-application" id="application_name_<%= admin_application[:key] %>">
|
4
4
|
<%= link_to url_for_admin_dashboard_application(admin_application[:url]) do %>
|
5
|
-
<div class="image_wrapper">
|
6
5
|
<%= image_tag(admin_application[:thumbnail]) %>
|
7
|
-
|
8
|
-
</div>
|
6
|
+
<span class="dash-icon-badge" ></span>
|
9
7
|
<span class="application_name"><%= admin_application[:name] %></span>
|
10
8
|
<% end %>
|
11
9
|
</div>
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<% @login_title = 'Forgot Password' %>
|
2
2
|
<%= form_tag admin_password_resets_path do %>
|
3
|
-
<div class="
|
3
|
+
<div class="form-group">
|
4
4
|
<%= label_tag :email %>
|
5
|
-
<%= text_field_tag :email, params[:email], :placeholder => 'email', :autofocus => 'autofocus' %>
|
5
|
+
<%= text_field_tag :email, params[:email], :class => 'form-control', :placeholder => 'email', :autofocus => 'autofocus' %>
|
6
6
|
</div>
|
7
|
-
<div class="login-
|
8
|
-
<%= submit_tag "Send Reset Instructions", :class => 'btn' %> or <%= link_to 'Cancel', admin_login_path %>
|
7
|
+
<div class="login-group">
|
8
|
+
<%= submit_tag "Send Reset Instructions", :class => 'btn btn-primary' %> or <%= link_to 'Cancel', admin_login_path %>
|
9
9
|
</div>
|
10
10
|
<% end %>
|
@@ -1,15 +1,16 @@
|
|
1
1
|
<% @login_title = 'Password Reset' %>
|
2
|
+
|
2
3
|
<%= form_for @user, url: admin_password_reset_path(:id => @user.perishable_token) do |f| %>
|
3
|
-
<%=
|
4
|
-
<div class="
|
5
|
-
<%= f.label :password %>
|
6
|
-
<%= f.password_field :password, :placeholder => 'password', :autofocus => 'autofocus' %>
|
4
|
+
<%= tb_form_errors(f.object) %>
|
5
|
+
<div class="form-group">
|
6
|
+
<%= f.label :password, :class => 'form-label' %>
|
7
|
+
<%= f.password_field :password, :placeholder => 'password', :autofocus => 'autofocus', :class => 'form-control' %>
|
7
8
|
</div>
|
8
|
-
<div class="
|
9
|
-
<%= f.label :password_confirmation %>
|
10
|
-
<%= f.password_field :password_confirmation %>
|
9
|
+
<div class="form-group">
|
10
|
+
<%= f.label :password_confirmation, :class => 'form-label' %>
|
11
|
+
<%= f.password_field :password_confirmation, :placeholder => 'confirm password', :class => 'form-control' %>
|
11
12
|
</div>
|
12
|
-
<div class="
|
13
|
-
<%= f.submit "Reset Password", :class => 'btn' %>
|
13
|
+
<div class="form-group">
|
14
|
+
<%= f.submit "Reset Password", :class => 'btn btn-primary' %>
|
14
15
|
</div>
|
15
16
|
<% end %>
|
@@ -1,33 +1,31 @@
|
|
1
1
|
<%= form_for @role, :url => path, :html => {:class => 'form-horizontal'} do |f| %>
|
2
|
-
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<%= f.text_field :name %>
|
8
|
-
</div>
|
2
|
+
|
3
|
+
<div class="form-group">
|
4
|
+
<%= f.label :name, :required => true, :class => "col-sm-2 control-label" %>
|
5
|
+
<div class="col-sm-10">
|
6
|
+
<%= f.text_field :name, :title => "", :class => 'form-control'%>
|
9
7
|
</div>
|
10
|
-
</
|
8
|
+
</div>
|
11
9
|
|
12
|
-
<
|
13
|
-
|
14
|
-
<div class="
|
10
|
+
<div class="form-group">
|
11
|
+
<%= label_tag :permissions, 'Permissions', :required => true, :class => "col-sm-2 control-label" %>
|
12
|
+
<div class="col-sm-10">
|
15
13
|
<% SpudPermission.sorted_by_tag.each do |permission| %>
|
16
|
-
<div class="
|
17
|
-
<
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
</label>
|
22
|
-
</div>
|
14
|
+
<div class="checkbox">
|
15
|
+
<label>
|
16
|
+
<%= check_box_tag 'spud_role[permission_tags][]', permission.tag, @role.permissions.include?(permission) %>
|
17
|
+
<%= permission.name %>
|
18
|
+
</label>
|
23
19
|
</div>
|
24
20
|
<% end %>
|
25
21
|
</div>
|
26
|
-
</
|
22
|
+
</div>
|
27
23
|
|
28
|
-
<div class="form-
|
29
|
-
|
30
|
-
|
24
|
+
<div class="form-group">
|
25
|
+
<div class="col-sm-offset-2 col-sm-10">
|
26
|
+
<%= f.submit "Save Role", :class=>"btn btn-primary", "data-loading-text" => "Saving..." %>
|
27
|
+
<%= link_to "Cancel", admin_roles_path, :class => "btn btn-default" %>
|
28
|
+
</div>
|
31
29
|
</div>
|
32
30
|
|
33
31
|
<% end %>
|
@@ -5,27 +5,29 @@
|
|
5
5
|
<% end %>
|
6
6
|
|
7
7
|
<% content_for :detail do %>
|
8
|
-
<
|
9
|
-
<
|
10
|
-
<
|
11
|
-
<th>Name</th>
|
12
|
-
<th># Users</th>
|
13
|
-
<th>Permissions</th>
|
14
|
-
<th></th>
|
15
|
-
</tr>
|
16
|
-
</thead>
|
17
|
-
<tbody>
|
18
|
-
<% @roles.each do |role| %>
|
8
|
+
<div class="table-responsive">
|
9
|
+
<table class="table table-striped table-hover">
|
10
|
+
<thead>
|
19
11
|
<tr>
|
20
|
-
<
|
21
|
-
<
|
22
|
-
<
|
23
|
-
<
|
24
|
-
<%= link_to 'Edit', edit_admin_role_path(role), :class => 'btn btn-mini' %>
|
25
|
-
<%= link_to 'Delete', admin_role_path(role), :method => :delete, :data => {:confirm => 'Are you sure?'}, :class => 'btn btn-mini btn-danger' %>
|
26
|
-
</td>
|
12
|
+
<th>Name</th>
|
13
|
+
<th># Users</th>
|
14
|
+
<th>Permissions</th>
|
15
|
+
<th></th>
|
27
16
|
</tr>
|
28
|
-
|
29
|
-
|
30
|
-
|
17
|
+
</thead>
|
18
|
+
<tbody>
|
19
|
+
<% @roles.each do |role| %>
|
20
|
+
<tr>
|
21
|
+
<td><%= role.name %></td>
|
22
|
+
<td><%= role.users.count %></td>
|
23
|
+
<td><%= role.permissions.collect(&:name).join(', ') %></td>
|
24
|
+
<td align="right">
|
25
|
+
<%= link_to 'Edit', edit_admin_role_path(role), :class => 'btn btn-sm btn-default' %>
|
26
|
+
<%= link_to 'Delete', admin_role_path(role), :method => :delete, :data => {:confirm => 'Are you sure?'}, :class => 'btn btn-sm btn-danger' %>
|
27
|
+
</td>
|
28
|
+
</tr>
|
29
|
+
<% end %>
|
30
|
+
</tbody>
|
31
|
+
</table>
|
32
|
+
</div>
|
31
33
|
<% end %>
|
@@ -1,62 +1,53 @@
|
|
1
|
-
<%=
|
2
|
-
<fieldset>
|
3
|
-
<legend>User Details</legend>
|
1
|
+
<%= tb_form_errors f.object %>
|
4
2
|
|
5
|
-
|
6
|
-
<div class="control-group">
|
7
|
-
<%= f.label :login, :required => true, :class => "control-label" %>
|
8
|
-
<div class="controls">
|
9
|
-
<%= f.text_field :login, :size => 25, :autocomplete => 'username' %>
|
10
|
-
</div>
|
11
|
-
</div>
|
12
|
-
<% end %>
|
3
|
+
<h4>User Details</h4>
|
13
4
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
5
|
+
<% if !Spud::Core.config.use_email_as_login %>
|
6
|
+
<div class="form-group">
|
7
|
+
<%= f.label :login, :required => true, :class => "col-sm-2 control-label" %>
|
8
|
+
<div class="col-sm-10">
|
9
|
+
<%= f.text_field :login, :size => 25, :autocomplete => 'username', :class => 'form-control' %>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
<div class="form-group">
|
14
|
+
<%= f.label :email, :class=>"col-sm-2 control-label" %>
|
15
|
+
<div class="col-sm-10">
|
16
|
+
<%= f.text_field :email, :title => "", :class=>'form-control' %>
|
18
17
|
</div>
|
19
|
-
|
20
18
|
</div>
|
21
|
-
<div class="
|
22
|
-
<%=f.label :first_name
|
23
|
-
<div class="
|
24
|
-
<%=f.text_field :first_name, :title => ""
|
19
|
+
<div class="form-group">
|
20
|
+
<%= f.label :first_name, :class => "col-sm-2 control-label" %>
|
21
|
+
<div class="col-sm-10">
|
22
|
+
<%= f.text_field :first_name, :title => "", :class=>'form-control' %>
|
25
23
|
</div>
|
26
24
|
</div>
|
27
|
-
<div class="
|
28
|
-
<%=f.label :last_name
|
29
|
-
<div class="
|
30
|
-
<%=f.text_field :last_name, :title => ""
|
25
|
+
<div class="form-group">
|
26
|
+
<%= f.label :last_name, :class => "col-sm-2 control-label" %>
|
27
|
+
<div class="col-sm-10">
|
28
|
+
<%= f.text_field :last_name, :title => "", :class=>'form-control' %>
|
31
29
|
</div>
|
32
30
|
</div>
|
33
|
-
<div class="
|
34
|
-
<%=f.label :time_zone
|
35
|
-
<div class="
|
36
|
-
<%=f.time_zone_select :time_zone,ActiveSupport::TimeZone.us_zones
|
31
|
+
<div class="form-group">
|
32
|
+
<%= f.label :time_zone, :class => "col-sm-2 control-label" %>
|
33
|
+
<div class="col-sm-10">
|
34
|
+
<%= f.time_zone_select :time_zone, ActiveSupport::TimeZone.us_zones, {:default => Rails.application.config.time_zone}, {:class=>'form-control'} %>
|
37
35
|
</div>
|
38
36
|
</div>
|
39
37
|
|
38
|
+
<h4>Credentials</h4>
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
<div class="control-group">
|
46
|
-
<%= f.label :password,:class=>"control-label" %>
|
47
|
-
<div class="controls">
|
48
|
-
<%= f.password_field :password, :size => 25, :autocomplete => 'new-password' %>
|
40
|
+
<div class="form-group">
|
41
|
+
<%= f.label :password, :class => "col-sm-2 control-label" %>
|
42
|
+
<div class="col-sm-10">
|
43
|
+
<%= f.password_field :password, :title => "", :class => 'form-control', :autocomplete => 'new-password' %>
|
49
44
|
<p class="help-block">Password must be at least 8 characters</p>
|
50
|
-
</div>
|
51
|
-
|
45
|
+
</div>
|
52
46
|
</div>
|
53
|
-
<div class="
|
54
|
-
<%= f.label :password_confirmation,"Confirm"
|
55
|
-
<div class="
|
56
|
-
<%= f.password_field :password_confirmation, :
|
47
|
+
<div class="form-group">
|
48
|
+
<%= f.label :password_confirmation, "Confirm", :class => "col-sm-2 control-label" %>
|
49
|
+
<div class="col-sm-10">
|
50
|
+
<%= f.password_field :password_confirmation, :title => "", :class => 'form-control', :autocomplete => 'new-password' %>
|
57
51
|
<p class="help-block">Retype your password here.</p>
|
58
52
|
</div>
|
59
|
-
|
60
53
|
</div>
|
61
|
-
|
62
|
-
</fieldset>
|
@@ -9,6 +9,6 @@
|
|
9
9
|
<%= render :partial => "form", :locals => {:f => f} %>
|
10
10
|
<div class="form-actions">
|
11
11
|
<%= f.submit "Save Settings", :class=>"btn btn-primary"%> or
|
12
|
-
<%=link_to "cancel", (@current_user.has_admin_rights? ? admin_root_path : root_path), :class => "btn" %>
|
12
|
+
<%=link_to "cancel", (@current_user.has_admin_rights? ? admin_root_path : root_path), :class => "btn btn-default" %>
|
13
13
|
</div>
|
14
14
|
<% end %>
|
@@ -5,54 +5,45 @@
|
|
5
5
|
|
6
6
|
<% content_for :detail do %>
|
7
7
|
<% form_for @spud_user, :url => admin_setup_path, :html => {:class => "form-horizontal"} do |f| %>
|
8
|
-
<%=
|
9
|
-
<fieldset>
|
10
|
-
<legend>New Admin Account</legend>
|
11
|
-
<% if !Spud::Core.config.use_email_as_login %>
|
12
|
-
<div class="control-group">
|
13
|
-
<%= f.label :login, "Login", :class => "control-label" %>
|
14
|
-
<div class="controls">
|
15
|
-
<%= f.text_field :login %>
|
16
|
-
</div>
|
17
|
-
</div>
|
18
|
-
<% end %>
|
19
|
-
<div class="control-group">
|
20
|
-
<%= f.label :email, "Email", :class => "control-label" %>
|
21
|
-
<div class="controls">
|
22
|
-
<%= f.text_field :email %>
|
23
|
-
</div>
|
24
|
-
</div>
|
25
|
-
<div class="control-group">
|
26
|
-
<%= f.label :first_name, :class => "control-label" %>
|
27
|
-
<div class="controls">
|
28
|
-
<%= f.text_field :first_name %>
|
29
|
-
</div>
|
30
|
-
</div>
|
31
|
-
<div class="control-group">
|
32
|
-
<%= f.label :last_name, :class => "control-label" %>
|
33
|
-
<div class="controls">
|
34
|
-
<%= f.text_field :last_name %>
|
35
|
-
</div>
|
36
|
-
</div>
|
37
|
-
<div class="control-group">
|
38
|
-
<%= f.label :password, "Password", :class => "control-label" %>
|
39
|
-
<div class="controls">
|
40
|
-
<%= f.password_field :password %>
|
41
|
-
<p class="help-block">Password must be at least 8 characters</p>
|
42
|
-
</div>
|
43
|
-
</div>
|
44
|
-
<div class="control-group">
|
45
|
-
<%= f.label :password_confirmation, "Confirm", :class => "control-label" %>
|
46
|
-
<div class="controls">
|
47
|
-
<%= f.password_field :password_confirmation %>
|
48
|
-
<p class="help-block">Retype your password here.</p>
|
49
|
-
</div>
|
50
|
-
</div>
|
51
|
-
</fieldset>
|
8
|
+
<%= tb_form_errors f.object %>
|
52
9
|
|
53
|
-
|
54
|
-
|
10
|
+
<% if !Spud::Core.config.use_email_as_login %>
|
11
|
+
<div class="form-group">
|
12
|
+
<%= f.label :login, "Login", :class => "col-sm-2 control-label" %>
|
13
|
+
<div class="col-sm-10">
|
14
|
+
<%= f.text_field :login, :class=>'form-control' %>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<div class="form-group">
|
20
|
+
<%= f.label :email, "Email", :class => "col-sm-2 control-label" %>
|
21
|
+
<div class="col-sm-10">
|
22
|
+
<%= f.text_field :email, :class=>'form-control' %>
|
23
|
+
</div>
|
55
24
|
</div>
|
56
25
|
|
26
|
+
<div class="form-group">
|
27
|
+
<%= f.label :password, "Password", :class => "col-sm-2 control-label" %>
|
28
|
+
<div class="col-sm-10">
|
29
|
+
<%= f.password_field :password, :class => 'form-control' %>
|
30
|
+
<p class="help-block">Password must be at least 8 characters</p>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<div class="form-group">
|
35
|
+
<%= f.label :password_confirmation, "Confirm", :class => "col-sm-2 control-label" %>
|
36
|
+
<div class="col-sm-10">
|
37
|
+
<%= f.password_field :password_confirmation, :class => 'form-control' %>
|
38
|
+
<p class="help-block">Retype your password here.</p>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<div class="form-group">
|
43
|
+
<div class="col-sm-offset-2 col-sm-10">
|
44
|
+
<%= submit_tag "Create Admin Account", :class => "btn btn-primary"%>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
|
57
48
|
<% end %>
|
58
49
|
<% end %>
|