tb_core 1.0.2 → 1.1.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 +8 -8
- data/README.md +89 -0
- data/app/assets/javascripts/{spud/admin → admin}/application.js +1 -7
- data/app/assets/javascripts/admin/dashboard.js +9 -0
- data/app/assets/javascripts/admin/split_pane.js +138 -0
- data/app/assets/javascripts/admin/users.js +84 -0
- data/app/assets/stylesheets/{spud/admin/application.css → admin/application.css.scss} +14 -104
- data/app/assets/stylesheets/admin/login.css.scss +49 -0
- data/app/assets/stylesheets/admin/split_pane.css.scss +126 -0
- data/app/assets/stylesheets/admin/users.css.scss +9 -0
- data/app/controllers/{spud/admin → admin}/application_controller.rb +29 -30
- data/app/controllers/admin/dashboard_controller.rb +23 -0
- data/app/controllers/admin/password_resets_controller.rb +51 -0
- data/app/controllers/admin/roles_controller.rb +58 -0
- data/app/controllers/admin/settings_controller.rb +19 -0
- data/app/controllers/admin/setup_controller.rb +24 -0
- data/app/controllers/{spud/admin → admin}/user_sessions_controller.rb +8 -8
- data/app/controllers/admin/users_controller.rb +69 -0
- data/app/controllers/password_resets_controller.rb +52 -0
- data/app/controllers/sitemaps_controller.rb +8 -0
- data/app/controllers/spud/application_controller.rb +6 -20
- data/app/controllers/user_sessions_controller.rb +26 -0
- data/app/helpers/{spud/admin → admin}/application_helper.rb +1 -1
- data/app/helpers/admin/roles_helper.rb +2 -0
- data/app/helpers/spud/application_helper.rb +0 -7
- data/app/mailers/core_mailer.rb +9 -0
- data/app/models/spud_permission.rb +33 -0
- data/app/models/spud_role.rb +32 -0
- data/app/models/spud_role_permission.rb +9 -0
- data/app/models/spud_user.rb +79 -24
- data/app/models/spud_user_setting.rb +3 -3
- data/app/views/{spud/admin → admin}/dashboard/index.html.erb +1 -4
- data/app/views/admin/password_resets/index.html.erb +10 -0
- data/app/views/admin/password_resets/show.html.erb +15 -0
- data/app/views/admin/roles/_form.html.erb +33 -0
- data/app/views/admin/roles/edit.html.erb +2 -0
- data/app/views/admin/roles/index.html.erb +29 -0
- data/app/views/admin/roles/new.html.erb +2 -0
- data/app/views/{spud/admin → admin}/settings/edit.html.erb +6 -1
- data/app/views/admin/setup/new.html.erb +44 -0
- data/app/views/admin/user_sessions/new.html.erb +17 -0
- data/app/views/{spud/admin → admin}/users/_form.html.erb +20 -20
- data/app/views/admin/users/_index.html.erb +15 -0
- data/app/views/admin/users/edit.html.erb +3 -0
- data/app/views/admin/users/index.html.erb +34 -0
- data/app/views/admin/users/new.html.erb +3 -0
- data/app/views/admin/users/show.html.erb +28 -0
- data/app/views/layouts/admin/application.html.erb +68 -0
- data/app/views/layouts/{spud/admin → admin}/detail.html.erb +2 -2
- data/app/views/layouts/admin/login.html.erb +27 -0
- data/app/views/password_resets/index.html.erb +11 -0
- data/app/views/password_resets/show.html.erb +26 -0
- data/app/views/user_sessions/new.html.erb +25 -0
- data/config/routes.rb +22 -15
- data/db/migrate/20130620143010_create_spud_roles.rb +10 -0
- data/db/migrate/20130620143941_create_spud_permissions.rb +10 -0
- data/db/migrate/20130620151132_create_spud_role_permissions.rb +11 -0
- data/db/migrate/20130620163144_drop_spud_admin_permissions.rb +15 -0
- data/db/seeds.rb +3 -0
- data/lib/spud_core/belongs_to_app.rb +35 -48
- data/lib/spud_core/configuration.rb +5 -10
- data/lib/spud_core/engine.rb +31 -6
- data/lib/spud_core/exceptions.rb +7 -0
- data/lib/spud_core/searchable.rb +9 -9
- data/lib/spud_core/version.rb +3 -3
- data/spec/controllers/{spud/admin → admin}/application_controller_spec.rb +10 -6
- data/spec/controllers/{spud/admin → admin}/dashboard_controller_spec.rb +17 -29
- data/spec/controllers/{spud/admin → admin}/password_reset_controller_spec.rb +5 -5
- data/spec/controllers/admin/settings_controller_spec.rb +30 -0
- data/spec/controllers/admin/setup_controller_spec.rb +39 -0
- data/spec/controllers/admin/user_sessions_controller_spec.rb +52 -0
- data/spec/controllers/{spud/admin → admin}/users_controller_spec.rb +19 -35
- data/spec/controllers/{spud/sitemap_controllers_spec.rb → sitemap_controllers_spec.rb} +1 -1
- data/spec/dummy/config/database.yml +2 -2
- data/spec/dummy/db/schema.rb +23 -5
- data/spec/dummy/log/test.log +36118 -0
- data/spec/helpers/spud/admin/application_helper_spec.rb +1 -1
- data/spec/models/spud_role_spec.rb +46 -0
- data/spec/models/spud_user_spec.rb +0 -1
- metadata +101 -97
- data/README.markdown +0 -60
- data/app/assets/images/back_disabled.jpg +0 -0
- data/app/assets/images/back_enabled.jpg +0 -0
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/images/forward_disabled.jpg +0 -0
- data/app/assets/images/forward_enabled.jpg +0 -0
- data/app/assets/images/sort_asc.png +0 -0
- data/app/assets/images/sort_asc_disabled.png +0 -0
- data/app/assets/images/sort_both.png +0 -0
- data/app/assets/images/sort_desc.png +0 -0
- data/app/assets/images/sort_desc_disabled.png +0 -0
- data/app/assets/images/spud/admin/flick/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/spud/admin/flick/ui-bg_flat_0_eeeeee_40x100.png +0 -0
- data/app/assets/images/spud/admin/flick/ui-bg_flat_55_ffffff_40x100.png +0 -0
- data/app/assets/images/spud/admin/flick/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/images/spud/admin/flick/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/images/spud/admin/flick/ui-bg_highlight-soft_100_f6f6f6_1x100.png +0 -0
- data/app/assets/images/spud/admin/flick/ui-bg_highlight-soft_25_0073ea_1x100.png +0 -0
- data/app/assets/images/spud/admin/flick/ui-bg_highlight-soft_50_dddddd_1x100.png +0 -0
- data/app/assets/images/spud/admin/flick/ui-icons_0073ea_256x240.png +0 -0
- data/app/assets/images/spud/admin/flick/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/spud/admin/flick/ui-icons_666666_256x240.png +0 -0
- data/app/assets/images/spud/admin/flick/ui-icons_ff0084_256x240.png +0 -0
- data/app/assets/images/spud/admin/flick/ui-icons_ffffff_256x240.png +0 -0
- data/app/assets/images/spud/admin/spud_logo.png +0 -0
- data/app/assets/images/spud/admin/spud_logo@2x.png +0 -0
- data/app/assets/javascripts/spud/admin/dashboard.js +0 -80
- data/app/assets/javascripts/spud/admin/jquery.dataTables.min.js +0 -151
- data/app/assets/stylesheets/spud/forms.css +0 -108
- data/app/assets/stylesheets/spud/login/application.css +0 -302
- data/app/assets/stylesheets/spud/login.css +0 -58
- data/app/assets/stylesheets/spud/setup.css +0 -4
- data/app/assets/stylesheets/spud/sitemaps.css +0 -4
- data/app/assets/stylesheets/spud/user_sessions.css +0 -4
- data/app/assets/stylesheets/spud/users.css +0 -4
- data/app/controllers/spud/admin/dashboard_controller.rb +0 -34
- data/app/controllers/spud/admin/password_resets_controller.rb +0 -52
- data/app/controllers/spud/admin/settings_controller.rb +0 -27
- data/app/controllers/spud/admin/users_controller.rb +0 -109
- data/app/controllers/spud/setup_controller.rb +0 -21
- data/app/controllers/spud/sitemaps_controller.rb +0 -8
- data/app/helpers/spud/password_resets_helper.rb +0 -2
- data/app/mailers/spud/core_mailer.rb +0 -12
- data/app/models/spud_admin_permission.rb +0 -5
- data/app/views/layouts/spud/admin/application.html.erb +0 -73
- data/app/views/layouts/spud/login/application.html.erb +0 -17
- data/app/views/layouts/spud/setup.html.erb +0 -47
- data/app/views/spud/admin/password_resets/index.html.erb +0 -14
- data/app/views/spud/admin/password_resets/show.html.erb +0 -25
- data/app/views/spud/admin/user_sessions/new.html.erb +0 -27
- data/app/views/spud/admin/users/_edit.html.erb +0 -14
- data/app/views/spud/admin/users/_new.html.erb +0 -15
- data/app/views/spud/admin/users/edit.html.erb +0 -3
- data/app/views/spud/admin/users/index.html.erb +0 -42
- data/app/views/spud/admin/users/new.html.erb +0 -3
- data/app/views/spud/admin/users/show.html.erb +0 -12
- data/app/views/spud/setup/index.html.erb +0 -43
- data/spec/controllers/spud/admin/settings_controller_spec.rb +0 -55
- data/spec/controllers/spud/admin/user_sessions_controller_spec.rb +0 -51
- data/spec/controllers/spud/setup_controller_spec.rb +0 -56
- /data/app/assets/images/{spud/admin → admin}/down_arrow.gif +0 -0
- /data/app/assets/images/{spud/admin → admin}/up_arrow.gif +0 -0
- /data/app/assets/images/{spud/admin → admin}/users_thumb.png +0 -0
- /data/app/assets/javascripts/{spud/admin → admin}/date_picker.js +0 -0
- /data/app/assets/javascripts/{spud/admin → admin}/editor.js +0 -0
- /data/app/assets/javascripts/{spud/admin → admin}/preinit.js +0 -0
- /data/app/assets/javascripts/{spud/password_resets.js → admin/roles.js} +0 -0
- /data/app/assets/stylesheets/{spud/admin → admin}/jquery-ui.css +0 -0
- /data/app/assets/stylesheets/{spud/password_resets.css → admin/roles.css} +0 -0
- /data/app/views/{spud/admin → admin}/settings/_form.html.erb +0 -0
- /data/app/views/{spud/core_mailer → core_mailer}/forgot_password_notification.html.erb +0 -0
- /data/app/views/{spud/core_mailer → core_mailer}/forgot_password_notification.text.erb +0 -0
- /data/app/views/{spud/sitemaps → sitemaps}/show.xml.builder +0 -0
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>Spud Admin</title>
|
|
5
|
-
<%= stylesheet_link_tag *Spud::Core.config.admin_stylesheets %>
|
|
6
|
-
<%= javascript_include_tag *Spud::Core.config.admin_javascripts %>
|
|
7
|
-
<%= csrf_meta_tags %>
|
|
8
|
-
<%=yield :head%>
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
<div id="header" style="<%=header_style%>">
|
|
12
|
-
<%=link_to spud_admin_root_url do%>
|
|
13
|
-
<h1><%= Spud::Core.config.site_name %> Admin</h1>
|
|
14
|
-
<%end%>
|
|
15
|
-
<div id="user_meta">
|
|
16
|
-
<span class="greeting">Hello <%= @current_user.full_name %></span> |
|
|
17
|
-
<%=link_to "Settings", spud_admin_settings_path%> |
|
|
18
|
-
<%=link_to "Logout",spud_admin_logout_path %>
|
|
19
|
-
</div>
|
|
20
|
-
<%if Spud::Core.multisite_mode_enabled == true%>
|
|
21
|
-
<div id="multisite_switcher" class="right_floated">
|
|
22
|
-
<%=form_tag spud_admin_switch_url do%>
|
|
23
|
-
<%=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])%>
|
|
24
|
-
<%end%>
|
|
25
|
-
</div>
|
|
26
|
-
<%end%>
|
|
27
|
-
</div>
|
|
28
|
-
<div id="breadcrumbs">
|
|
29
|
-
<%= render_breadcrumbs :separator => ' / ' %>
|
|
30
|
-
</div>
|
|
31
|
-
<div id="content">
|
|
32
|
-
<% if flash[:notice] %>
|
|
33
|
-
<div class="alert alert-success">
|
|
34
|
-
<a class="close" data-dismiss="alert">×</a>
|
|
35
|
-
<%= flash[:notice] %>
|
|
36
|
-
</div>
|
|
37
|
-
<% end %>
|
|
38
|
-
<% if flash[:warning] %>
|
|
39
|
-
|
|
40
|
-
<div class="alert alert-warning">
|
|
41
|
-
<a class="close" data-dismiss="alert">×</a>
|
|
42
|
-
<%= flash[:warning] %>
|
|
43
|
-
</div>
|
|
44
|
-
<% end %>
|
|
45
|
-
<% if flash[:error]%>
|
|
46
|
-
|
|
47
|
-
<div class="alert alert-error">
|
|
48
|
-
<a class="close" data-dismiss="alert">×</a>
|
|
49
|
-
<%= flash[:error] %>
|
|
50
|
-
</div>
|
|
51
|
-
<%-end%>
|
|
52
|
-
<%= content_for?(:content) ? yield(:content) : yield %>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<div id="modal_window" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
59
|
-
<div class="modal-header">
|
|
60
|
-
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
61
|
-
<h3 class="modal-title"></h3>
|
|
62
|
-
</div>
|
|
63
|
-
<div class="modal-body">
|
|
64
|
-
|
|
65
|
-
</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>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
|
|
72
|
-
</body>
|
|
73
|
-
</html>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>Spud Admin</title>
|
|
5
|
-
<%= stylesheet_link_tag("spud/login/application") %>
|
|
6
|
-
|
|
7
|
-
<%= csrf_meta_tags %>
|
|
8
|
-
<%=content_for :head%>
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
|
|
12
|
-
<div id="content_wrapper">
|
|
13
|
-
<div id="content"><%=yield%></div>
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
</body>
|
|
17
|
-
</html>
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>Spud Admin</title>
|
|
5
|
-
<%= stylesheet_link_tag "spud/admin/application" %>
|
|
6
|
-
<%= javascript_include_tag "spud/admin/application" %>
|
|
7
|
-
<%= csrf_meta_tags %>
|
|
8
|
-
<%=content_for :head%>
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
<div id="header">
|
|
12
|
-
<h1>Spud First Time Setup</h1>
|
|
13
|
-
|
|
14
|
-
</div>
|
|
15
|
-
<div id="breadcrumbs">
|
|
16
|
-
<%= render_breadcrumbs :separator => ' / ' %>
|
|
17
|
-
</div>
|
|
18
|
-
<div id="content">
|
|
19
|
-
<div id="detail_wrapper">
|
|
20
|
-
<h2>
|
|
21
|
-
<%if @page_thumbnail%>
|
|
22
|
-
<span class="thumb_wrapper"><%=image_tag(@page_thumbnail)%></span>
|
|
23
|
-
<%end%>
|
|
24
|
-
<%=@page_name%>
|
|
25
|
-
</h2>
|
|
26
|
-
|
|
27
|
-
<div id="details">
|
|
28
|
-
<%if content_for?(:detail_nav)%>
|
|
29
|
-
<div id="detail_nav_wrapper">
|
|
30
|
-
<div id="detail_nav">
|
|
31
|
-
<%= yield(:detail_nav)%></div>
|
|
32
|
-
|
|
33
|
-
</div>
|
|
34
|
-
<div id="detail_main_wrapper">
|
|
35
|
-
<div id="detail_main">
|
|
36
|
-
<%= content_for?(:detail) ? yield(:detail) : yield %></div>
|
|
37
|
-
</div>
|
|
38
|
-
<br style="clear:both;"/>
|
|
39
|
-
<%else%>
|
|
40
|
-
<%= content_for?(:detail) ? yield(:detail) : yield %>
|
|
41
|
-
<%end%>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
|
|
46
|
-
</body>
|
|
47
|
-
</html>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<div class="login-form">
|
|
2
|
-
<h1>Forgot Password</h1>
|
|
3
|
-
<%= form_tag spud_admin_password_resets_path do %>
|
|
4
|
-
|
|
5
|
-
<div class="field-group">
|
|
6
|
-
<%= label_tag :email %>
|
|
7
|
-
<%= text_field_tag :email %>
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
<div class="field-group">
|
|
11
|
-
<%= submit_tag "Send Reset Instructions" %>
|
|
12
|
-
</div>
|
|
13
|
-
<% end %>
|
|
14
|
-
</div>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<div class="login-form">
|
|
2
|
-
<h1>Password Reset</h1>
|
|
3
|
-
<%= form_for @user, url: spud_admin_password_reset_path(:id => @user.perishable_token) do |f| %>
|
|
4
|
-
<% if flash[:notice] %>
|
|
5
|
-
<div class="alert alert-success">
|
|
6
|
-
<%= flash[:notice] %>
|
|
7
|
-
</div>
|
|
8
|
-
<% end %>
|
|
9
|
-
<%= error_messages_for(f.object) %>
|
|
10
|
-
|
|
11
|
-
<div class="field-group">
|
|
12
|
-
<%= f.label :password %>
|
|
13
|
-
<%= f.password_field :password %>
|
|
14
|
-
</div>
|
|
15
|
-
<div class="field-group">
|
|
16
|
-
<%= f.label :password_confirmation %>
|
|
17
|
-
<%= f.password_field :password_confirmation %>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
<div class="field-group">
|
|
21
|
-
<%= f.submit "Reset Password" %>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<% end %>
|
|
25
|
-
</div>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<div class="login-form">
|
|
2
|
-
<h1>Login</h1>
|
|
3
|
-
<%= form_for @user_session, :url => spud_admin_login_path do |f| %>
|
|
4
|
-
<% if flash[:notice] %>
|
|
5
|
-
<div class="alert alert-success">
|
|
6
|
-
<%= flash[:notice] %>
|
|
7
|
-
</div>
|
|
8
|
-
<% end %>
|
|
9
|
-
<%= error_messages_for(f.object) %>
|
|
10
|
-
|
|
11
|
-
<div class="field-group">
|
|
12
|
-
<%= f.label :login %>
|
|
13
|
-
<%= f.text_field :login %>
|
|
14
|
-
</div>
|
|
15
|
-
<div class="field-group">
|
|
16
|
-
<%= f.label :password %>
|
|
17
|
-
<%= f.password_field :password %>
|
|
18
|
-
</div>
|
|
19
|
-
<div class="field-group">
|
|
20
|
-
<%= f.check_box :remember_me %> <%= f.label :remember_me, class: 'inline' %>
|
|
21
|
-
</div>
|
|
22
|
-
<div class="field-group">
|
|
23
|
-
<%= f.submit "Login" %> or <%=link_to "Forgot Password?", spud_admin_password_resets_path %>
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
<% end %>
|
|
27
|
-
</div>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<p> Fill in all information pertaining to the current user you wish to modify. Fields marked with * are required and must be filled out.</p>
|
|
4
|
-
|
|
5
|
-
<%=form_for @user,:url => spud_admin_user_path(:id => @user.id),:html=>{:class=>"form-horizontal"} do |f|%>
|
|
6
|
-
<%=render :partial => "form",:locals => {:f => f}%>
|
|
7
|
-
|
|
8
|
-
<div class="form-actions form-actions-no-modal">
|
|
9
|
-
<%=f.submit "Save User", :class=>"btn btn-primary"%> or <%=link_to "cancel",request.referer,:class => "btn"%>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<%end%>
|
|
13
|
-
|
|
14
|
-
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<p> Fill in all information pertaining to the new user you wish to create. Fields marked with * are required and must be filled out.</p>
|
|
4
|
-
|
|
5
|
-
<%=form_for @user,:url => spud_admin_users_path(),:html=>{:class=>"form-horizontal"} do |f|%>
|
|
6
|
-
<%=render :partial => "form",:locals => {:f => f}%>
|
|
7
|
-
|
|
8
|
-
<div class="form-actions form-actions-no-modal">
|
|
9
|
-
<%=f.submit "Save User", :class=>"btn btn-primary"%> or <%=link_to "cancel",request.referer,:class => "btn"%>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<%end%>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<%=content_for :data_controls do%>
|
|
2
|
-
<%=link_to "New User",new_spud_admin_user_path(),:class => "ajax btn btn-primary",:title => "New User"%>
|
|
3
|
-
<%end%>
|
|
4
|
-
<%=content_for :detail do%>
|
|
5
|
-
<table class="admin-table data-table" id="usertable">
|
|
6
|
-
<thead>
|
|
7
|
-
<tr>
|
|
8
|
-
|
|
9
|
-
<th><%= sortable "login"%></th>
|
|
10
|
-
<th><%= sortable "email"%></th>
|
|
11
|
-
<th><%= sortable "first_name", "Name"%></th>
|
|
12
|
-
|
|
13
|
-
<th><%= sortable "last_login_at", "Last Login"%></th>
|
|
14
|
-
<th><%= sortable "created_at", "Date Created"%></th>
|
|
15
|
-
<th></th>
|
|
16
|
-
</tr>
|
|
17
|
-
</thead>
|
|
18
|
-
<tbody>
|
|
19
|
-
<%@users.each do |user|%>
|
|
20
|
-
<tr id="row_user_<%=user.id%>">
|
|
21
|
-
|
|
22
|
-
<td><%=link_to user.login,edit_spud_admin_user_path(:id => user.id),:class => "ajax", :title => "Edit #{user.login}"%></td>
|
|
23
|
-
<td><%=user.email%></td>
|
|
24
|
-
<td><%=user.first_name%> <%=user.last_name%></td>
|
|
25
|
-
|
|
26
|
-
<td><%=timestamp user.last_login_at%></td>
|
|
27
|
-
<td><%=timestamp user.created_at%></td>
|
|
28
|
-
<td align="right"><%=link_to "Remove",spud_admin_user_path(:id => user.id),:method => :delete,:remote => true,:confirm => "Are you sure you want to remove this user?",:class => "btn btn-danger"%></td>
|
|
29
|
-
</tr>
|
|
30
|
-
<%end%>
|
|
31
|
-
</tbody>
|
|
32
|
-
<tfoot>
|
|
33
|
-
<tr>
|
|
34
|
-
<td colspan="6">
|
|
35
|
-
<%=will_paginate @users%>
|
|
36
|
-
</td>
|
|
37
|
-
</tr>
|
|
38
|
-
</tfoot>
|
|
39
|
-
</table>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<%end%>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<%=content_for :data_controls do%>
|
|
2
|
-
<%=link_to "Edit",edit_spud_admin_user_path(:id => @user.id),:class => "ajax",:title => "Edit User"%> | <%=link_to "Remove",spud_admin_user_path(:id => @user.id),:method => :delete,:title => "Remove User",:confirm => "Are you sure you wish to remove this user?"%>
|
|
3
|
-
<%end%>
|
|
4
|
-
|
|
5
|
-
<%=content_for :detail do%>
|
|
6
|
-
<div class="info_card">
|
|
7
|
-
<p><strong>Login:</strong> <%=@user.login%> <%="(Super Administrator)" if @user.super_admin%></p>
|
|
8
|
-
<p><strong>Email:</strong> <%=link_to @user.email, "mailto:#{@user.email}"%></p>
|
|
9
|
-
<p><strong>Last Login:</strong> <span title="IP: <%=@user.last_login_ip%>"><%=timestamp @user.last_login_at%></span></p>
|
|
10
|
-
<p><strong>Created:</strong> <%=timestamp @user.created_at%></p>
|
|
11
|
-
</div>
|
|
12
|
-
<%end%>
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<%content_for :detail do%>
|
|
2
|
-
<%=form_tag "/setup",:method => :post,:class=>"form-horizontal" do %>
|
|
3
|
-
<fieldset>
|
|
4
|
-
<legend>New Admin Account</legend>
|
|
5
|
-
|
|
6
|
-
<div class="control-group">
|
|
7
|
-
<%=label_tag :login, "Login",:class => "control-label"%>
|
|
8
|
-
<div class="controls">
|
|
9
|
-
<%=text_field_tag :login,nil,:title => "",:size=>25%>
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="control-group">
|
|
13
|
-
<%=label_tag :email, "Email",:class => "control-label"%>
|
|
14
|
-
<div class="controls">
|
|
15
|
-
<%=text_field_tag :email,nil,:title => "",:size=>25%>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<div class="control-group">
|
|
20
|
-
<%=label_tag :password, "Password",:class => "control-label"%>
|
|
21
|
-
<div class="controls">
|
|
22
|
-
<%=password_field_tag :password,nil,:title => "",:size=>25%>
|
|
23
|
-
<p class="help-block">Password must be at least 8 characters</p>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
<div class="control-group">
|
|
27
|
-
<%=label_tag :password_confirmation, "Confirm",:class => "control-label"%>
|
|
28
|
-
<div class="controls">
|
|
29
|
-
<%=password_field_tag :password_confirmation,nil,:title => "",:size=>25%>
|
|
30
|
-
<p class="help-block">Retype your password here.</p>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</fieldset>
|
|
37
|
-
<div class="form-actions">
|
|
38
|
-
<%=submit_tag "Create Admin Account", :class=>"btn btn-primary"%>
|
|
39
|
-
</div>
|
|
40
|
-
|
|
41
|
-
<%end%>
|
|
42
|
-
|
|
43
|
-
<%end%>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe Spud::Admin::SettingsController do
|
|
4
|
-
before(:each) do
|
|
5
|
-
activate_authlogic
|
|
6
|
-
SpudUserSession.create(FactoryGirl.build(:spud_user))
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
describe :edit do
|
|
10
|
-
it "should respond with success" do
|
|
11
|
-
get :edit
|
|
12
|
-
response.should be_success
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
it "should have a page thumbnail" do
|
|
16
|
-
get :edit
|
|
17
|
-
assigns(:page_thumbnail).should_not be_blank
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
it "should have a page name" do
|
|
21
|
-
get :edit
|
|
22
|
-
assigns(:page_name).should_not be_blank
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
describe :update do
|
|
27
|
-
it "should redirect to the admin root with a successful update" do
|
|
28
|
-
put :update, :spud_user => {:first_name => "Mike"}
|
|
29
|
-
response.should redirect_to(spud_admin_root_url)
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
it "should put a message in the flash notice" do
|
|
33
|
-
put :update, :spud_user => {:first_name => "Mike"}
|
|
34
|
-
flash[:notice].should_not be_blank
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
it "should put a message in the flash error on a failed update" do
|
|
38
|
-
put :update, :spud_user => {:password => "newpass"}
|
|
39
|
-
flash[:error].should_not be_blank
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
it "should have a page thumbnail on a failed update" do
|
|
43
|
-
put :update, :spud_user => {:password => "newpass"}
|
|
44
|
-
|
|
45
|
-
assigns(:page_thumbnail).should_not be_blank
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
it "should have a page name on a failed update" do
|
|
49
|
-
put :update, :spud_user => {:password => "newpass"}
|
|
50
|
-
|
|
51
|
-
assigns(:page_name).should_not be_blank
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
end
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
describe Spud::Admin::UserSessionsController do
|
|
3
|
-
before(:each) do
|
|
4
|
-
# activate_authlogic
|
|
5
|
-
# SpudUserSession.create(FactoryGirl.build(:spud_user))
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
describe :new do
|
|
9
|
-
it "should redirect to setup url if no users exist" do
|
|
10
|
-
get :new
|
|
11
|
-
response.should redirect_to(spud_setup_url)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
it "should render login form if users do exist" do
|
|
15
|
-
u = FactoryGirl.create(:spud_user)
|
|
16
|
-
u.save
|
|
17
|
-
get :new
|
|
18
|
-
response.should be_success
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
describe :create do
|
|
23
|
-
it "should rerender form when login is invalid" do
|
|
24
|
-
post :create
|
|
25
|
-
response.should be_success
|
|
26
|
-
end
|
|
27
|
-
it "should redirect to admin root if login is valid" do
|
|
28
|
-
u = FactoryGirl.create(:spud_user,:login => "testuser")
|
|
29
|
-
u.save
|
|
30
|
-
user_session = {:login => "testuser", :password => "password"}
|
|
31
|
-
post :create, :spud_user_session => user_session
|
|
32
|
-
response.should redirect_to(spud_admin_root_path)
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
describe :destroy do
|
|
37
|
-
it "should redirect to login after logout when no referer" do
|
|
38
|
-
activate_authlogic
|
|
39
|
-
SpudUserSession.create(FactoryGirl.build(:spud_user))
|
|
40
|
-
delete :destroy
|
|
41
|
-
response.should redirect_to(spud_admin_login_path)
|
|
42
|
-
end
|
|
43
|
-
it "should redirect to previous page after logout" do
|
|
44
|
-
request.env["HTTP_REFERER"] = "/"
|
|
45
|
-
activate_authlogic
|
|
46
|
-
SpudUserSession.create(FactoryGirl.build(:spud_user))
|
|
47
|
-
delete :destroy
|
|
48
|
-
response.should redirect_to("/")
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
end
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
|
|
3
|
-
describe Spud::SetupController do
|
|
4
|
-
|
|
5
|
-
describe :index do
|
|
6
|
-
it "should be successful" do
|
|
7
|
-
get :index
|
|
8
|
-
|
|
9
|
-
response.should be_success
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
it "should have a page thumbnail" do
|
|
13
|
-
get :index
|
|
14
|
-
|
|
15
|
-
assigns(:page_thumbnail).should_not be_blank
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it "should have a page name" do
|
|
19
|
-
get :index
|
|
20
|
-
|
|
21
|
-
assigns(:page_name).should_not be_blank
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
it "should set a flash error message when a spud user exists" do
|
|
25
|
-
SpudUser.stubs(:count).returns(1)
|
|
26
|
-
get :index
|
|
27
|
-
|
|
28
|
-
flash[:error].should_not be_blank
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
it "should redirect to the admin login form when there is already a user" do
|
|
32
|
-
SpudUser.stubs(:count).returns(1)
|
|
33
|
-
get :index
|
|
34
|
-
|
|
35
|
-
response.should redirect_to(spud_admin_login_path)
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
it "should create a new user" do
|
|
39
|
-
lambda {
|
|
40
|
-
post :index, FactoryGirl.attributes_for(:spud_user)
|
|
41
|
-
}.should change(SpudUser, :count).by(1)
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
it "should redirect to the admin login form when first admin user has been created" do
|
|
45
|
-
post :index, FactoryGirl.attributes_for(:spud_user)
|
|
46
|
-
|
|
47
|
-
response.should redirect_to(spud_admin_login_path)
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
it "should display an error if the user is invalid" do
|
|
51
|
-
post :index, FactoryGirl.attributes_for(:spud_user, :email => nil)
|
|
52
|
-
|
|
53
|
-
flash[:error].should_not be_blank
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|