tb_core 1.2.8 → 1.3.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/admin/core/application.js +1 -2
  3. data/app/assets/javascripts/admin/core/dashboard.js +1 -1
  4. data/app/assets/javascripts/admin/core/modal.js +4 -13
  5. data/app/assets/javascripts/admin/core/users.js +0 -120
  6. data/app/assets/stylesheets/admin/core/application.css.scss +106 -367
  7. data/app/assets/stylesheets/admin/core/login.css.scss +3 -29
  8. data/app/controllers/admin/application_controller.rb +1 -2
  9. data/app/controllers/admin/user_sessions_controller.rb +0 -3
  10. data/app/controllers/admin/users_controller.rb +3 -13
  11. data/app/controllers/password_resets_controller.rb +1 -0
  12. data/app/controllers/spud/application_controller.rb +8 -14
  13. data/app/controllers/user_sessions_controller.rb +1 -0
  14. data/app/helpers/admin/application_helper.rb +11 -15
  15. data/app/helpers/twice_baked/application_helper.rb +24 -1
  16. data/app/models/spud/spud_user_model.rb +7 -0
  17. data/app/views/admin/dashboard/index.html.erb +2 -4
  18. data/app/views/admin/password_resets/index.html.erb +4 -4
  19. data/app/views/admin/password_resets/show.html.erb +10 -9
  20. data/app/views/admin/roles/_form.html.erb +20 -22
  21. data/app/views/admin/roles/index.html.erb +23 -21
  22. data/app/views/admin/settings/_form.html.erb +36 -45
  23. data/app/views/admin/settings/edit.html.erb +1 -1
  24. data/app/views/admin/setup/new.html.erb +37 -46
  25. data/app/views/admin/user_sessions/new.html.erb +15 -12
  26. data/app/views/admin/users/_form.html.erb +16 -86
  27. data/app/views/admin/users/edit.html.erb +1 -1
  28. data/app/views/admin/users/index.html.erb +47 -27
  29. data/app/views/admin/users/new.html.erb +1 -1
  30. data/app/views/admin/users/show.html.erb +21 -31
  31. data/app/views/layouts/admin/_flashes.html.erb +19 -0
  32. data/app/views/layouts/admin/application.html.erb +39 -48
  33. data/app/views/layouts/admin/detail.html.erb +16 -30
  34. data/app/views/layouts/admin/error_page.html.erb +2 -1
  35. data/app/views/layouts/admin/login.html.erb +4 -11
  36. data/app/views/layouts/user_sessions.html.erb +6 -0
  37. data/app/views/password_resets/index.html.erb +4 -4
  38. data/app/views/password_resets/show.html.erb +7 -7
  39. data/app/views/user_sessions/new.html.erb +6 -6
  40. data/config/locales/en.yml +10 -0
  41. data/lib/generators/spud/module_generator.rb +6 -4
  42. data/lib/generators/spud/setup_generator.rb +7 -39
  43. data/lib/generators/spud/templates/assets/application.css.scss +5 -0
  44. data/lib/generators/spud/templates/assets/application.js +1 -0
  45. data/lib/generators/spud/templates/views/admin/_form.html.erb +7 -18
  46. data/lib/generators/spud/templates/views/admin/index.html.erb +39 -28
  47. data/lib/generators/spud/templates/views/admin/show.html.erb +6 -7
  48. data/lib/generators/spud/templates/views/frontend/index.html.erb +2 -1
  49. data/lib/generators/spud/templates/views/frontend/show.html.erb +6 -4
  50. data/lib/generators/spud/templates/views/layouts/application.html.erb +16 -6
  51. data/lib/spud_core/configuration.rb +1 -1
  52. data/lib/spud_core/engine.rb +9 -1
  53. data/lib/spud_core/version.rb +1 -1
  54. data/lib/tb_core/form_builder.rb +254 -0
  55. data/spec/helpers/spud/admin/application_helper_spec.rb +5 -5
  56. metadata +38 -14
  57. data/app/assets/javascripts/admin/core/split_pane.js +0 -150
  58. data/app/assets/libs/bootstrap/css/bootstrap-responsive.css +0 -1088
  59. data/app/assets/libs/bootstrap/css/bootstrap.css.scss +0 -5893
  60. data/app/assets/libs/bootstrap/img/glyphicons-halflings-white.png +0 -0
  61. data/app/assets/libs/bootstrap/img/glyphicons-halflings.png +0 -0
  62. data/app/assets/libs/bootstrap/js/bootstrap.js +0 -2025
  63. data/app/assets/stylesheets/admin/core/roles.css +0 -4
  64. data/app/assets/stylesheets/admin/core/split_pane.css.scss +0 -126
  65. data/app/assets/stylesheets/admin/core/users.css.scss +0 -9
@@ -1,22 +1,25 @@
1
1
  <%= form_for @user_session, :url => admin_login_path do |f| %>
2
2
 
3
- <%= error_messages_for(f.object) %>
3
+ <%= tb_form_errors(f.object) %>
4
4
 
5
- <div class="login-form-row">
5
+ <% if params[:return_to] %>
6
+ <%= hidden_field_tag :return_to, params[:return_to] %>
7
+ <% end %>
8
+ <div class="form-group">
6
9
  <% if Spud::Core.config.use_email_as_login %>
7
- <%= f.label :email %>
8
- <%= f.text_field :email, :placeholder => 'Email', :autofocus => 'autofocus', :autocomplete => 'username' %>
10
+ <%= f.label :email, :class => 'form-label' %>
11
+ <%= f.text_field :email, :placeholder => 'Email', :autofocus => 'autofocus', :autocomplete => 'username', :class => 'form-control' %>
9
12
  <% else %>
10
- <%= f.label :login %>
11
- <%= f.text_field :login, :placeholder => 'Username', :autofocus => 'autofocus', :autocomplete => 'username' %>
13
+ <%= f.label :login, :class => 'form-label' %>
14
+ <%= f.text_field :login, :placeholder => 'Username', :autofocus => 'autofocus', :autocomplete => 'username', :class => 'form-control' %>
12
15
  <% end %>
13
16
  </div>
14
- <div class="login-form-row">
15
- <%= f.label :password %>
16
- <%= f.password_field :password, :placeholder => 'Password', :autocomplete => 'current-password' %>
17
+ <div class="form-group">
18
+ <%= f.label :password, :class => 'form-label' %>
19
+ <%= f.password_field :password, :placeholder => 'Password', :autocomplete => 'current-password', :class => 'form-control' %>
17
20
  </div>
18
- <div class="login-form-row">
19
- <%= f.submit "Login", :class => 'btn' %> or <%=link_to "Forgot Password?", admin_password_resets_path %>
21
+ <div class="form-group">
22
+ <%= f.submit "Login", :class => 'btn btn-primary' %> or <%=link_to "Forgot Password?", admin_password_resets_path %>
20
23
  </div>
21
24
 
22
- <% end %>
25
+ <% end %>
@@ -1,95 +1,25 @@
1
- <%= error_messages_for(f.object) %>
1
+ <%= tb_form_error_header(f.object) %>
2
2
 
3
- <fieldset>
4
- <legend>User Details</legend>
3
+ <h4>User Details</h4>
5
4
 
6
- <% if !Spud::Core.config.use_email_as_login %>
7
- <div class="control-group">
8
- <%=f.label :login, :required=>true,:class=> "control-label"%>
9
- <div class="controls">
10
- <%=f.text_field :login,:title => "",:size=>25%>
11
- <p class="help-block">This is the username used to login to the account.</p>
12
- </div>
13
- </div>
14
- <% end %>
15
-
16
- <div class="control-group">
17
- <%=f.label :email,:class=> "control-label"%>
18
- <div class="controls">
19
- <%=f.text_field :email, :title => "",:size => 25%>
20
- <p class="help-block">The email address must be a valid email address.</p>
21
- </div>
22
-
23
- </div>
24
- <div class="control-group">
25
- <%=f.label :first_name,:class=> "control-label"%>
26
- <div class="controls">
27
- <%=f.text_field :first_name, :title => "",:size => 25%>
28
- </div>
29
-
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, :title => "",:size => 25%>
35
- </div>
36
-
37
- </div>
38
- <div class="control-group">
39
- <%=f.label :time_zone,:class => "control-label"%>
40
- <div class="controls">
41
- <%=f.time_zone_select :time_zone,ActiveSupport::TimeZone.us_zones,:default => Rails.application.config.time_zone%>
42
- </div>
43
- </div>
44
-
45
- </fieldset>
5
+ <% if !Spud::Core.config.use_email_as_login %>
6
+ <%= f.tb_text_field :login %>
7
+ <% end %>
8
+ <%= f.tb_text_field :email %>
9
+ <%= f.tb_text_field :first_name %>
10
+ <%= f.tb_text_field :last_name %>
11
+ <%= f.tb_time_zone_select :time_zone, ActiveSupport::TimeZone.us_zones, {:default => Rails.application.config.time_zone} %>
46
12
 
47
13
  <%= render :partial => 'form_additions', :locals => {:f => f} %>
48
14
 
49
- <fieldset>
50
- <legend>Credentials</legend>
51
-
52
- <div class="control-group">
53
- <%=f.label :password,:class=> "control-label"%>
54
- <div class="controls">
55
- <%=f.password_field :password, :title => "",:size => 25%>
56
- <p class="help-block">Password must be at least 8 characters</p>
57
- </div>
58
-
59
- </div>
60
- <div class="control-group">
61
- <%=f.label :password_confirmation,"Confirm",:class=> "control-label"%>
62
- <div class="controls">
63
- <%=f.password_field :password_confirmation, :title => "",:size => 25%>
64
- <p class="help-block">Retype your password here.</p>
65
- </div>
66
-
67
- </div>
68
-
69
- </fieldset>
70
- <fieldset>
71
- <legend>Permissions</legend>
15
+ <h4>Credentials</h4>
72
16
 
73
- <div class="control-group">
74
- <%= f.label :super_admin, "Super Admin", :class=> "control-label" %>
75
- <div class="controls">
76
- <label class="checkbox inline">
77
- <%= f.check_box :super_admin, :title => "" %>
78
- The super administrator bypasses all permissions and roles.
79
- </label>
80
- </div>
81
- </div>
17
+ <%= f.tb_password_field :password %>
18
+ <%= f.tb_password_field :password_confirmation %>
82
19
 
83
- <div class="control-group">
84
- <%= f.label :role, 'Role', :class => 'control-label' %>
85
- <div class="controls">
86
- <%= f.select :spud_role_id, options_from_collection_for_select(SpudRole.all, :id, :name, f.object.spud_role_id), :include_blank => 'No Role' %>
87
- </div>
88
- </div>
20
+ <h4>Permissions</h4>
89
21
 
90
- </fieldset>
22
+ <%= f.tb_check_box :super_admin, :help_block => 'The super administrator bypasses all permissions and roles.' %>
23
+ <%= f.tb_select :spud_role_id, options_from_collection_for_select(SpudRole.all, :id, :name, f.object.spud_role_id), {:include_blank => 'No Role'} %>
91
24
 
92
- <div class="form-actions">
93
- <%= f.submit "Save User", :class=>"btn btn-primary", "data-loading-text" => "Saving..." %>
94
- or <%= link_to "Cancel", '#', :class => "btn admin-user-edit-cancel-btn" %>
95
- </div>
25
+ <%= f.tb_save_buttons('User', @user.new_record? ? admin_users_path : admin_user_path(@user)) %>
@@ -1,3 +1,3 @@
1
- <%= form_for @user, :url => admin_user_path(@user), :html=> {:class => "form-horizontal admin-user-form"} do |f| %>
1
+ <%= form_for @user, :url => admin_user_path(@user), :builder => TbCore::FormBuilder, :html => {:class => "form-horizontal"} do |f| %>
2
2
  <%= render :partial => "form", :locals => {:f => f} %>
3
3
  <% end %>
@@ -1,34 +1,54 @@
1
1
  <%= content_for :data_controls do %>
2
- <%= link_to raw('<i class="icon-refresh"></i>'), '#', :class => 'btn split-pane-refresh-btn' %>
3
- <%= link_to 'Roles', admin_roles_path, :class => 'btn admin-role-btn' %>
4
- <%= link_to "New User", new_admin_user_path, :class => "btn btn-primary admin-user-add-btn", :title => "New User" %>
2
+ <%= form_tag admin_users_path, :method => :get, :class => 'form-inline' do %>
3
+ <div class="form-group">
4
+ <div class="input-group">
5
+ <div class="input-group-addon"><span class="glyphicon glyphicon-search"></span></div>
6
+ <%= search_field_tag :search, params[:search], :placeholder => 'Search', :class => 'form-control' %>
7
+ <% if params[:search] %>
8
+ <div class="input-group-addon">
9
+ <%= link_to raw('<span class="glyphicon glyphicon-remove"></span>'), admin_users_path %>
10
+ </div>
11
+ <% end %>
12
+ </div>
13
+ </div>
14
+ <div class="form-group">
15
+ <%= link_to 'Roles', admin_roles_path, :class => 'btn btn-default admin-role-btn' %>
16
+ <%= link_to "New User", new_admin_user_path, :class => "btn btn-primary admin-user-add-btn", :title => "New User" %>
17
+ </div>
18
+ <% end %>
5
19
  <% end %>
6
20
 
7
21
  <%= content_for :detail do %>
22
+ <div class="table-responsive">
23
+ <table class="table table-striped table-hover">
24
+ <thead>
25
+ <th>Name</th>
26
+ <th>Email</th>
27
+ <th>Last Login</th>
28
+ <th>&nbsp;</th>
29
+ </thead>
30
+ <tbody>
31
+ <% cache [:admin, @spud_users] do %>
32
+ <% @spud_users.each do |spud_user| %>
33
+ <tr>
34
+ <td><%= spud_user.full_name %></td>
35
+ <td><%= mail_to spud_user.email %></td>
36
+ <td><%= timestamp(spud_user.last_login_at) %></td>
37
+ <td class="table-actions">
38
+ <%= link_to 'Details', admin_user_path(spud_user), :class => 'btn btn-default btn-sm' %>
39
+ <%= link_to 'Edit', edit_admin_user_path(spud_user), :class => 'btn btn-default btn-sm' %>
40
+ <%= link_to 'Delete', admin_user_path(spud_user), :method => :delete, :data => {:confirm => 'Are you sure you want to delete this Comic book?'}, :class => 'btn btn-danger btn-sm' %>
41
+ </td>
42
+ </tr>
43
+ <% end %>
44
+ <% end %>
45
+ </tbody>
46
+ </table>
47
+ </div>
8
48
 
9
- <div class="split-pane admin-users-split-pane">
10
- <div class="split-pane-toolbar">
11
- <div class="split-pane-toolbar-left">
12
- <%= form_tag admin_users_path, :method => :get, :class => 'split-pane-search-form' do %>
13
- <input type="search" name="search" id="search" results="5" autosave="spud-admin-user-search" value="<%= params[:search] %>"/>
14
- <% end %>
15
- <%= link_to 'X', admin_users_path, :class => 'btn btn-small split-pane-search-clear-btn' %>
16
- </div>
17
- <div class="split-pane-toolbar-right">
18
- <span class="split-pane-toolbar-title"></span>
19
- </div>
20
- </div>
21
- <div class="split-pane-left">
22
- <%= render 'index' %>
23
- </div>
24
- <div class="split-pane-right">
25
- <div class="split-pane-right-content">
26
- </div>
27
- </div>
28
- </div>
29
-
30
- <script>
31
- $(document).ready(spud.admin.users.index);
32
- </script>
49
+ <%= will_paginate @spud_users, :renderer => BootstrapPagination::Rails %>
33
50
 
51
+ <script>
52
+ $(document).ready(spud.admin.users.index);
53
+ </script>
34
54
  <% end %>
@@ -1,3 +1,3 @@
1
- <%= form_for @user, :url => admin_users_path, :html=> {:class => "form-horizontal admin-user-form"} do |f| %>
1
+ <%= form_for @user, :url => admin_users_path, :builder => TbCore::FormBuilder, :html=> {:class => "form-horizontal admin-user-form"} do |f| %>
2
2
  <%= render :partial => "form", :locals => {:f => f} %>
3
3
  <% end %>
@@ -1,31 +1,21 @@
1
- <div class="admin-user-show" data-id="<%= @user.id %>">
2
- <div class="admin-user-show-controls">
3
- <%= link_to 'Edit', edit_admin_user_path(@user), :class => 'btn btn-small admin-user-edit-btn', :title => "Edit User - #{@user.full_name}" %>
4
- <div class="btn-group">
5
- <a class="btn dropdown-toggle btn-small btn-danger" data-toggle="dropdown" href="#">
6
- Delete
7
- </a>
8
- <ul class="dropdown-menu pull-right">
9
- <li><%= link_to 'Confirm', admin_user_path(@user), :class => 'admin-user-delete-btn' %></li>
10
- </ul>
11
- </div>
12
- </div>
13
- <h2><%= @user.full_name %></h2>
14
- <dl>
15
- <% if !Spud::Core.config.use_email_as_login %>
16
- <dt>Login</dt>
17
- <dd><%= @user.login %></dd>
18
- <% end %>
19
- <dt>Email</dt>
20
- <dd><%= mail_to @user.email %></dd>
21
- <dt>Last Login</dt>
22
- <dd><%= timestamp @user.last_login_at %></dd>
23
- <dt>Created At</dt>
24
- <dd><%= timestamp @user.created_at %></dd>
25
- <dt>Role:</dt>
26
- <dd><%= @user.role.blank? ? 'None' : @user.role.name %></dd>
27
- <dt>Super Admin?<dt>
28
- <dd><%= @user.super_admin? ? 'Yes' : 'No' %></dd>
29
- <%= render 'show_additions' %>
30
- </dl>
31
- </div>
1
+ <%= content_for :data_controls do %>
2
+ <%= link_to 'Edit', edit_admin_user_path(@user), :class => 'btn btn-primary admin-user-edit-btn', :title => "Edit" %>
3
+ <% end %>
4
+
5
+ <dl class="dl-horizontal">
6
+ <% if !Spud::Core.config.use_email_as_login %>
7
+ <dt>Login</dt>
8
+ <dd><%= @user.login %></dd>
9
+ <% end %>
10
+ <dt>Email</dt>
11
+ <dd><%= mail_to @user.email %></dd>
12
+ <dt>Last Login</dt>
13
+ <dd><%= timestamp @user.last_login_at %></dd>
14
+ <dt>Created At</dt>
15
+ <dd><%= timestamp @user.created_at %></dd>
16
+ <dt>Role:</dt>
17
+ <dd><%= @user.role.blank? ? 'None' : @user.role.name %></dd>
18
+ <dt>Super Admin?<dt>
19
+ <dd><%= @user.super_admin? ? 'Yes' : 'No' %></dd>
20
+ <%= render 'show_additions' %>
21
+ </dl>
@@ -0,0 +1,19 @@
1
+ <% if flash[:notice] %>
2
+ <div class="alert alert-success">
3
+ <a class="close" data-dismiss="alert">×</a>
4
+ <%= flash[:notice] %>
5
+ </div>
6
+ <% end %>
7
+ <% if flash[:warning] %>
8
+ <div class="alert alert-warning">
9
+ <a class="close" data-dismiss="alert">×</a>
10
+ <%= flash[:warning] %>
11
+ </div>
12
+ <% end %>
13
+ <% if flash[:error]%>
14
+ <div class="alert alert-error">
15
+ <a class="close" data-dismiss="alert">×</a>
16
+ <%= flash[:error] %>
17
+ </div>
18
+ <% end %>
19
+
@@ -1,10 +1,12 @@
1
1
  <!DOCTYPE html>
2
- <html>
2
+ <html lang="en">
3
3
  <head>
4
4
  <title><%= Spud::Core.config.site_name %> Admin</title>
5
5
  <%= stylesheet_link_tag *Spud::Core.config.admin_stylesheets %>
6
6
  <%= javascript_include_tag *Spud::Core.config.admin_javascripts %>
7
7
  <%= csrf_meta_tags %>
8
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
9
+ <meta name="viewport" content="width=device-width"/>
8
10
  <%= yield :head %>
9
11
  </head>
10
12
  <body>
@@ -14,60 +16,49 @@
14
16
  </div>
15
17
  <% end %>
16
18
  <div id="header" style="<%=header_style%>">
17
- <%= link_to '/' do %>
18
- <h1><%= Spud::Core.config.site_name %></h1>
19
- <% end %>
20
- <% if current_user %>
21
- <div id="user_meta">
22
- <span class="greeting">Hello <%= current_user.full_name %></span> |
23
- <%=link_to "Settings", admin_settings_path%> |
24
- <%=link_to "Logout",admin_logout_path %>
25
- </div>
26
- <% if Spud::Core.multisite_mode_enabled == true %>
27
- <div id="multisite_switcher" class="right_floated">
28
- <%=form_tag admin_switch_path do%>
29
- <%=select_tag :multisite_select,options_for_select([[Spud::Core.site_name,nil]] + Spud::Core.multisite_config.collect{|c| [c[:site_name],c[:site_id]]},session[:admin_site])%>
30
- <% end %>
31
- </div>
19
+ <div class="container">
20
+ <%= link_to '/' do %>
21
+ <h1><%= Spud::Core.config.site_name %></h1>
22
+ <% end %>
23
+ <% if current_user %>
24
+ <div class="pull-right">
25
+ Hello <%= current_user.full_name %> |
26
+ <%= link_to "Settings", admin_settings_path %> |
27
+ <%= link_to "Logout", admin_logout_path %>
28
+ </div>
32
29
  <% end %>
33
- <% end %>
34
- </div>
35
- <div id="breadcrumbs">
36
- <%= render_breadcrumbs :separator => ' / ' %>
37
- </div>
38
- <div id="content">
39
- <% if flash[:notice] %>
40
- <div class="alert alert-success">
41
- <a class="close" data-dismiss="alert">×</a>
42
- <%= flash[:notice] %>
43
- </div>
44
- <% end %>
45
- <% if flash[:warning] %>
46
- <div class="alert alert-warning">
47
- <a class="close" data-dismiss="alert">×</a>
48
- <%= flash[:warning] %>
49
- </div>
50
- <% end %>
51
- <% if flash[:error]%>
52
- <div class="alert alert-error">
53
- <a class="close" data-dismiss="alert">×</a>
54
- <%= flash[:error] %>
55
30
  </div>
56
- <% end %>
31
+ </div>
32
+
33
+ <div class="container">
34
+
35
+ <ol class="breadcrumb">
36
+ <%= render_breadcrumbs :tag => :li, :separator => "" %>
37
+ </ol>
38
+
39
+ <%= render :partial => '/layouts/admin/flashes' %>
40
+
57
41
  <%= content_for?(:content) ? yield(:content) : yield %>
58
42
  </div>
59
43
 
60
- <div id="modal_window" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
61
- <div class="modal-header">
62
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
63
- <h3 class="modal-title"></h3>
64
- </div>
65
- <div class="modal-body"></div>
66
- <div class="modal-footer modal-footer-default">
67
- <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
68
- <button class="btn btn-primary form-submit">Save changes</button>
44
+ <div class="modal fade" id="modal_window">
45
+ <div class="modal-dialog">
46
+ <div class="modal-content">
47
+ <div class="modal-header">
48
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
49
+ <h4 class="modal-title"></h4>
50
+ </div>
51
+ <div class="modal-body">
52
+ <p>One fine body&hellip;</p>
53
+ </div>
54
+ <div class="modal-footer modal-footer-default">
55
+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
56
+ <button type="button" class="btn btn-primary form-submit">Save changes</button>
57
+ </div>
58
+ </div>
69
59
  </div>
70
60
  </div>
71
61
 
62
+
72
63
  </body>
73
64
  </html>
@@ -1,31 +1,17 @@
1
- <%=content_for :content do %>
2
- <div class="detail_wrapper">
3
- <span class="data_controls">
4
- <%=yield :data_controls%>
5
- </span>
6
- <h2>
7
- <%if @page_thumbnail%>
8
- <span class="thumb_wrapper"><%=image_tag(@page_thumbnail)%></span>
9
- <%end%>
10
- <%=@page_name%>
11
- </h2>
12
-
13
- <div id="details">
14
- <%if content_for?(:detail_nav)%>
15
- <div id="detail_nav_wrapper">
16
- <div id="detail_nav">
17
- <%= yield(:detail_nav)%>
18
- </div>
19
- </div>
20
- <div id="detail_main_wrapper">
21
- <div id="detail_main">
22
- <%= content_for?(:detail) ? yield(:detail) : yield %></div>
23
- </div>
24
- <br style="clear:both;"/>
25
- <%else%>
26
- <%= content_for?(:detail) ? yield(:detail) : yield %>
27
- <%end%>
28
- </div>
29
- </div>
30
- <%end%>
1
+ <%= content_for :content do %>
2
+ <div class="detail-wrapper">
3
+ <div class="data-controls">
4
+ <%= yield :data_controls %>
5
+ </div>
6
+ <h2 class="detail-title">
7
+ <% if @page_thumbnail %>
8
+ <%= image_tag(@page_thumbnail, :class => 'app-thumbnail') %>
9
+ <% end%>
10
+ <%= @page_name %>
11
+ </h2>
12
+ <div class="details">
13
+ <%= content_for?(:detail) ? yield(:detail) : yield %>
14
+ </div>
15
+ </div>
16
+ <% end %>
31
17
  <%= render :template => 'layouts/admin/application' %>
@@ -1,10 +1,11 @@
1
1
  <%= content_for :content do %>
2
- <div class="detail_wrapper">
2
+ <div class="detail-wrapper">
3
3
  <h2>
4
4
  <%= @error.code %>: <%= @error.title %>!
5
5
  </h2>
6
6
  <div id="details">
7
7
  <p><%= @error.message %></p>
8
+ <p>Your user might not have admin rights, or you might be trying to access a module that you have not been granted permission to.</p>
8
9
  <p>Requested URL: <%= @error.request_url %></p>
9
10
  </div>
10
11
  </div>
@@ -4,21 +4,14 @@
4
4
  <title><%= Spud::Core.config.site_name %> Admin: Login</title>
5
5
  <%= stylesheet_link_tag 'admin/core/application' %>
6
6
  <%= csrf_meta_tags %>
7
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
8
+ <meta name="viewport" content="width=device-width"/>
7
9
  </head>
8
10
  <body>
9
11
 
10
- <div class="login-container">
11
- <div class="login-form">
12
+ <div class="container">
13
+ <div class="login-form col-md-6 col-md-offset-3">
12
14
  <h1><%= @login_title || 'Login' %></h1>
13
- <% if flash[:notice] %>
14
- <div class="alert">
15
- <%= flash[:notice] %>
16
- </div>
17
- <% elsif flash[:error] %>
18
- <div class="alert alert-error">
19
- <%= flash[:error] %>
20
- </div>
21
- <% end %>
22
15
  <%= yield %>
23
16
  </div>
24
17
  </div>
@@ -0,0 +1,6 @@
1
+ <%= content_for :body do %>
2
+ <div class="login-container">
3
+ <%= yield %>
4
+ </div>
5
+ <% end %>
6
+ <%= render :template => 'layouts/application' %>
@@ -3,11 +3,11 @@
3
3
  <h1>Password Reset</h1>
4
4
 
5
5
  <%= form_tag password_resets_path, :class => 'password-reset-form' do %>
6
- <div class="form-row">
7
- <%= label_tag :email %>
8
- <%= text_field_tag :email, params[:email], :placeholder => 'email', :autofocus => 'autofocus' %>
6
+ <div class="form-group">
7
+ <%= label_tag :email, 'Email', :class => 'form-label' %>
8
+ <%= text_field_tag :email, params[:email], :placeholder => 'email', :autofocus => 'autofocus', :class => 'form-control' %>
9
9
  </div>
10
- <div class="form-row form-row-actions">
10
+ <div class="form-group form-row-actions">
11
11
  <%= submit_tag 'Submit', :class => 'btn btn-primary' %> or <%= link_to 'Cancel', login_path %>
12
12
  </div>
13
13
  <% end %>
@@ -7,15 +7,15 @@
7
7
  <% if params[:return_to] %>
8
8
  <%= hidden_field_tag :return_to, params[:return_to] %>
9
9
  <% end %>
10
- <div class="form-row">
11
- <%= f.label :password %>
12
- <%= f.password_field :password, :placeholder => 'password', :autofocus => 'autofocus' %>
10
+ <div class="form-group">
11
+ <%= f.label :password, :class => 'form-label' %>
12
+ <%= f.password_field :password, :placeholder => 'password', :autofocus => 'autofocus', :class => 'form-control' %>
13
13
  </div>
14
- <div class="form-row">
15
- <%= f.label :password_confirmation, 'Confirm password' %>
16
- <%= f.password_field :password_confirmation, 'placeholder' => 'confirm password' %>
14
+ <div class="form-group">
15
+ <%= f.label :password_confirmation, 'Confirm password', :class=>'form-label' %>
16
+ <%= f.password_field :password_confirmation, 'placeholder' => 'confirm password', :class=>'form-control' %>
17
17
  </div>
18
- <div class="form-row form-row-actions">
18
+ <div class="form-group form-group-actions">
19
19
  <%= f.submit "Reset Password", :class => 'btn btn-primary' %>
20
20
  </div>
21
21
  <% end %>
@@ -7,20 +7,20 @@
7
7
  <% if params[:return_to] %>
8
8
  <%= hidden_field_tag :return_to, params[:return_to] %>
9
9
  <% end %>
10
- <div class="form-row">
10
+ <div class="form-group">
11
11
  <% if Spud::Core.config.use_email_as_login %>
12
12
  <%= f.label :email %>
13
- <%= f.text_field :email, :placeholder => 'Email', :autofocus => 'autofocus', :autocomplete => 'username' %>
13
+ <%= f.text_field :email, :placeholder => 'Email', :autofocus => 'autofocus', :autocomplete => 'username', :class => 'form-control' %>
14
14
  <% else %>
15
15
  <%= f.label :login %>
16
- <%= f.text_field :login, :placeholder => 'Username', :autofocus => 'autofocus', :autocomplete => 'username' %>
16
+ <%= f.text_field :login, :placeholder => 'Username', :autofocus => 'autofocus', :autocomplete => 'username', :class => 'form-control' %>
17
17
  <% end %>
18
18
  </div>
19
- <div class="form-row">
19
+ <div class="form-group">
20
20
  <%= f.label :password %>
21
- <%= f.password_field :password, :placeholder => 'Password', :autocomplete => 'current-password' %>
21
+ <%= f.password_field :password, :placeholder => 'Password', :autocomplete => 'current-password', :class => 'form-control' %>
22
22
  </div>
23
- <div class="form-row">
23
+ <div class="form-group">
24
24
  <%= f.submit "Login", :class => 'btn btn-primary' %> <span>or</span> <%=link_to "Forgot Password?", password_resets_path %>
25
25
  </div>
26
26
  <% end %>
@@ -0,0 +1,10 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
6
+ activerecord:
7
+ attributes:
8
+ spud_user:
9
+ spud_role_id: 'Role'
10
+ password_confirmation: 'Confirm Password'
@@ -48,13 +48,15 @@ EOF
48
48
  def field_for_attribute(type, name)
49
49
  case type
50
50
  when 'integer'
51
- "<%= f.number_field :#{name} %>"
51
+ "<%= f.tb_number_field :#{name} %>"
52
52
  when 'text'
53
- "<%= f.text_area :#{name}, :rows => 4 %>"
53
+ "<%= f.tb_text_area :#{name}, :rows => 4 %>"
54
54
  when 'boolean'
55
- "<%= f.check_box :#{name} %>"
55
+ "<%= f.tb_check_box :#{name} %>"
56
+ when 'date'
57
+ "<%= f.tb_date_select :#{name} %>"
56
58
  else
57
- "<%= f.text_field :#{name} %>"
59
+ "<%= f.tb_text_field :#{name} %>"
58
60
  end
59
61
  end
60
62