we5-browsercms 3.0.2 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +1 -0
- data/app/controllers/cms/content_block_controller.rb +25 -2
- data/app/controllers/cms/content_controller.rb +31 -2
- data/app/controllers/cms/dashboard_controller.rb +2 -1
- data/app/controllers/cms/error_handling.rb +9 -2
- data/app/controllers/cms/links_controller.rb +2 -0
- data/app/controllers/cms/pages_controller.rb +22 -18
- data/app/controllers/cms/section_nodes_controller.rb +1 -1
- data/app/controllers/cms/sections_controller.rb +12 -7
- data/app/controllers/cms/sessions_controller.rb +17 -10
- data/app/controllers/cms/users_controller.rb +8 -6
- data/app/helpers/cms/application_helper.rb +2 -6
- data/app/helpers/cms/menu_helper.rb +118 -146
- data/app/helpers/cms/page_helper.rb +2 -2
- data/app/models/attachment.rb +2 -2
- data/app/models/forgot_password_mailer.rb +12 -0
- data/app/models/group.rb +13 -2
- data/app/models/guest_user.rb +9 -3
- data/app/models/link.rb +2 -2
- data/app/models/page.rb +1 -1
- data/app/models/section.rb +7 -2
- data/app/models/user.rb +35 -17
- data/app/portlets/forgot_password_portlet.rb +27 -0
- data/app/portlets/reset_password_portlet.rb +28 -0
- data/app/views/cms/blocks/_toolbar_for_member.html.erb +3 -3
- data/app/views/cms/blocks/index.html.erb +11 -6
- data/app/views/cms/content/show.html.erb +3 -3
- data/app/views/cms/forgot_password_mailer/reset_password.text.html.erb +3 -0
- data/app/views/cms/forgot_password_mailer/reset_password.text.plain.erb +3 -0
- data/app/views/cms/menus/_menu.html.erb +9 -0
- data/app/views/cms/menus/_menu_item.html.erb +11 -0
- data/app/views/cms/pages/_edit_connector.html.erb +1 -1
- data/app/views/cms/pages/_edit_container.html.erb +1 -1
- data/app/views/cms/section_nodes/_node.html.erb +1 -1
- data/app/views/cms/sections/_form.html.erb +36 -34
- data/app/views/cms/shared/access_denied.html.erb +3 -0
- data/app/views/cms/users/change_password.html.erb +8 -6
- data/app/views/cms/users/index.html.erb +1 -1
- data/app/views/cms/users/show.html.erb +50 -0
- data/app/views/layouts/_cms_toolbar.html.erb +1 -1
- data/app/views/layouts/_page_toolbar.html.erb +7 -7
- data/app/views/layouts/cms/administration.html.erb +24 -7
- data/app/views/portlets/forgot_password/_form.html.erb +5 -0
- data/app/views/portlets/forgot_password/render.html.erb +14 -0
- data/app/views/portlets/reset_password/_form.html.erb +3 -0
- data/app/views/portlets/reset_password/render.html.erb +24 -0
- data/{we5-browsercms.gemspec → browsercms.gemspec} +72 -54
- data/db/migrate/20091109175123_browsercms_3_0_5.rb +9 -0
- data/lib/acts_as_list.rb +8 -4
- data/lib/cms/acts/content_block.rb +1 -1
- data/lib/cms/authentication/controller.rb +26 -7
- data/lib/cms/behaviors/attaching.rb +3 -3
- data/lib/cms/behaviors/publishing.rb +12 -1
- data/lib/cms/behaviors/rendering.rb +17 -4
- data/lib/cms/behaviors/versioning.rb +2 -2
- data/lib/cms/routes.rb +4 -0
- data/lib/tasks/cms.rake +0 -18
- data/public/javascripts/cms/content_library.js +36 -0
- data/public/javascripts/cms/sitemap.js +21 -9
- data/public/stylesheets/cms/form_layout.css +16 -2
- data/public/stylesheets/cms/nav.css +4 -3
- data/test/functional/cms/content_block_controller_test.rb +120 -0
- data/test/functional/cms/content_controller_test.rb +135 -80
- data/test/functional/cms/links_controller_test.rb +89 -1
- data/test/functional/cms/pages_controller_test.rb +138 -0
- data/test/functional/cms/section_nodes_controller_test.rb +45 -5
- data/test/functional/cms/sections_controller_test.rb +148 -1
- data/test/functional/cms/sessions_controller_test.rb +26 -2
- data/test/functional/cms/users_controller_test.rb +49 -2
- data/test/integration/cms/password_management_test.rb +57 -0
- data/test/test_helper.rb +3 -1
- data/test/unit/behaviors/attaching_test.rb +26 -0
- data/test/unit/helpers/menu_helper_test.rb +118 -278
- data/test/unit/models/group_test.rb +6 -0
- data/test/unit/models/user_test.rb +127 -29
- metadata +20 -3
@@ -8,7 +8,7 @@
|
|
8
8
|
<% able_to?(:administrate) do %><li><%= link_to image_tag("/images/cms/nav_admin#{'_on' if tab == :administration}.gif", :id => 'nav_admin_img'), cms_administration_path, :target => "_top" %></li><% end %>
|
9
9
|
</ul>
|
10
10
|
<ul id="userlinks">
|
11
|
-
<li id="user_info"><%= image_tag "cms/icons/user.png"
|
11
|
+
<li id="user_info"><a href="<%= current_user.able_to?(:administrate) ? edit_cms_user_path(current_user) : cms_user_path(current_user) %>" target="_top"><%= image_tag "cms/icons/user.png" %> <%= current_user.full_name %></a></li>
|
12
12
|
<li><%= link_to "Logout", cms_logout_path, :class => "http_delete", :target => "_top" %></li>
|
13
13
|
</ul>
|
14
14
|
<% flash_class, flash_message = flash.to_a.first %>
|
@@ -50,30 +50,30 @@
|
|
50
50
|
<%= link_to "<span>Publish</span>",
|
51
51
|
@page.live? ? '#' : publish_cms_page_path(@page),
|
52
52
|
:id => "publish_button",
|
53
|
-
:class => "http_put button#{' disabled' if !current_user.able_to?(:publish_content) || @page.version != @page.draft.version || @page.live?} left",
|
53
|
+
:class => "http_put button#{' disabled' if !current_user.able_to?(:publish_content) || !current_user.able_to_edit?(@page) || @page.version != @page.draft.version || @page.live?} left",
|
54
54
|
:target => "_top" %>
|
55
55
|
|
56
56
|
<%= link_to "<span>Assign</span>",
|
57
57
|
new_cms_page_task_path(@page),
|
58
58
|
:id => "assign_button",
|
59
|
-
:class => "button#{ ' disabled' if @page.assigned_to == current_user} middle",
|
59
|
+
:class => "button#{ ' disabled' if @page.assigned_to == current_user || !current_user.able_to_edit?(@page) } middle",
|
60
60
|
:target => "_top" %>
|
61
61
|
|
62
62
|
<%= link_to "<span>Complete Task</span>",
|
63
63
|
@page.current_task ? complete_cms_task_path(@page.current_task) : '#',
|
64
64
|
:id => "complete_task_button",
|
65
|
-
:class => "http_put button#{ ' disabled'
|
65
|
+
:class => "http_put button#{ ' disabled' if @page.assigned_to != current_user || !current_user.able_to_edit?(@page) } right",
|
66
66
|
:target => "_top" %>
|
67
67
|
|
68
68
|
<%= link_to "<span>Edit Properties</span>",
|
69
69
|
[:edit, :cms, @page],
|
70
70
|
:id => "edit_properties_button",
|
71
|
-
:class => "spacer button",
|
71
|
+
:class => "spacer button#{ ' disabled' unless current_user.able_to_edit?(@page) }",
|
72
72
|
:target => "_top" %>
|
73
73
|
|
74
74
|
<%= link_to "<span>List Versions</span>",
|
75
75
|
versions_cms_page_path(@page),
|
76
|
-
:class => "spacer button",
|
76
|
+
:class => "spacer button#{ ' disabled' unless current_user.able_to_edit?(@page) }",
|
77
77
|
:target => "_top" %>
|
78
78
|
|
79
79
|
<% able_to? :publish_content do %>
|
@@ -83,7 +83,7 @@
|
|
83
83
|
:id => "delete_button",
|
84
84
|
:title => "Are you sure you want to delete '#{@page.name}'?",
|
85
85
|
:target => "_top",
|
86
|
-
:class => "spacer button confirm_with_title http_delete" %>
|
86
|
+
:class => "spacer button confirm_with_title http_delete#{ ' disabled' unless current_user.able_to_publish?(@page) }" %>
|
87
87
|
<% else %>
|
88
88
|
<%= link_to "<span>Revert to this Version</span>",
|
89
89
|
revert_to_cms_page_path(@page, @page.version),
|
@@ -98,7 +98,7 @@
|
|
98
98
|
<div class="visual_editor_label">Visual Editor:</div>
|
99
99
|
<div class="visual_editor_value_container">
|
100
100
|
<% if @mode == "edit" %>
|
101
|
-
<div><span id="visual_editor_state"
|
101
|
+
<div><span id="visual_editor_state"<%= ' title="You don\'t have permission to edit this page"' unless current_user.able_to_edit?(@page) %>>ON<%= '*' unless current_user.able_to_edit?(@page) %></span></div>
|
102
102
|
<% else %>
|
103
103
|
<div><span id="visual_editor_state">OFF</span></div>
|
104
104
|
<% end %>
|
@@ -7,18 +7,29 @@
|
|
7
7
|
<div id="wrapper">
|
8
8
|
<%= render_cms_toolbar(:administration) %>
|
9
9
|
<div id="main">
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
|
11
|
+
<% if current_user.able_to?(:administrate) %>
|
12
|
+
<div class="top_cap_menu"></div>
|
13
|
+
<div id="menu">
|
14
|
+
<%= render :partial => 'cms/shared/admin_sidebar' %>
|
15
|
+
</div>
|
16
|
+
<div id="contentwrap">
|
17
|
+
<% else %>
|
18
|
+
<div class="top_cap"></div>
|
19
|
+
<div id="contentwrapbig">
|
20
|
+
<% end %>
|
21
|
+
|
15
22
|
<div id="functions">
|
16
23
|
<h1><%= @toolbar_title %></h1>
|
17
24
|
<%= yield :functions %>
|
18
25
|
|
19
26
|
</div>
|
20
27
|
<br clear="all" />
|
21
|
-
|
28
|
+
|
29
|
+
<% able_to?(:administrate) do %>
|
30
|
+
<div class="top_cap_content"></div>
|
31
|
+
<% end %>
|
32
|
+
|
22
33
|
<div id="content">
|
23
34
|
<div class="pad">
|
24
35
|
<%= yield %>
|
@@ -26,7 +37,13 @@
|
|
26
37
|
</div>
|
27
38
|
</div>
|
28
39
|
<br clear="all" />
|
29
|
-
|
40
|
+
|
41
|
+
<% if current_user.able_to?(:administrate) %>
|
42
|
+
<div class="bottom_cap_content"></div>
|
43
|
+
<% else %>
|
44
|
+
<div class="bottom_cap"></div>
|
45
|
+
<% end %>
|
46
|
+
|
30
47
|
<%= render :partial => 'layouts/cms/footer' %>
|
31
48
|
</div>
|
32
49
|
</div>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<%= f.cms_text_field :name %>
|
2
|
+
<%= f.cms_text_field :reset_password_url, :instructions => 'page in which the user will reset his or her password. No get parameters allowed.' %>
|
3
|
+
|
4
|
+
<%= f.cms_drop_down :handler, ActionView::Template.template_handler_extensions, :default => "erb" %>
|
5
|
+
<%= f.cms_text_area :template, :default_value => @block.class.default_template %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<% if flash_scope = flash[:forgot_password] -%>
|
2
|
+
<% if flash_scope[:error] -%>
|
3
|
+
<span class="forgot-password-error"><%= flash_scope[:error] %></span>
|
4
|
+
<% end -%>
|
5
|
+
<% if flash_scope[:notice] -%>
|
6
|
+
<span class="forgot-password-notice"><%= flash_scope[:notice] %></span>
|
7
|
+
<% end -%>
|
8
|
+
<% end -%>
|
9
|
+
|
10
|
+
<% form_tag do %>
|
11
|
+
<label for="email">Your account email address:</label>
|
12
|
+
<%= text_field_tag "email" %><br>
|
13
|
+
<%= submit_tag "Request reset password token"%>
|
14
|
+
<% end %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<%= error_message_on :user, :password %>
|
2
|
+
|
3
|
+
<% if flash_scope = flash[:reset_password] -%>
|
4
|
+
<% if flash_scope[:error] -%>
|
5
|
+
<span class="reset-password-error"><%= flash_scope[:error] %></span>
|
6
|
+
<% end -%>
|
7
|
+
<% if flash_scope[:notice] -%>
|
8
|
+
<span class="reset-password-notice"><%= flash_scope[:notice] %></span>
|
9
|
+
<% end -%>
|
10
|
+
<% end -%>
|
11
|
+
|
12
|
+
<% form_tag do %>
|
13
|
+
<% if params[:token] -%>
|
14
|
+
<%= hidden_field_tag "token", params[:token] %>
|
15
|
+
<% end -%>
|
16
|
+
|
17
|
+
<label for="password">New Password:</label>
|
18
|
+
<%= password_field_tag "password" %><br>
|
19
|
+
|
20
|
+
<label for="password_confirmation">Confirm New Password:</label>
|
21
|
+
<%= password_field_tag "password_confirmation" %><br>
|
22
|
+
|
23
|
+
<%= submit_tag "Reset Password" %>
|
24
|
+
<% end %>
|
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{we5-browsercms}
|
8
|
-
s.version = "3.0.
|
8
|
+
s.version = "3.0.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["BrowserMedia"]
|
12
|
-
s.date = %q{2009-
|
12
|
+
s.date = %q{2009-11-17}
|
13
13
|
s.email = %q{github@browsermedia.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE.txt",
|
@@ -74,6 +74,7 @@ Gem::Specification.new do |s|
|
|
74
74
|
"app/models/email_message.rb",
|
75
75
|
"app/models/email_message_mailer.rb",
|
76
76
|
"app/models/file_block.rb",
|
77
|
+
"app/models/forgot_password_mailer.rb",
|
77
78
|
"app/models/group.rb",
|
78
79
|
"app/models/group_permission.rb",
|
79
80
|
"app/models/group_section.rb",
|
@@ -103,7 +104,9 @@ Gem::Specification.new do |s|
|
|
103
104
|
"app/models/user_group_membership.rb",
|
104
105
|
"app/portlets/dynamic_portlet.rb",
|
105
106
|
"app/portlets/email_page_portlet.rb",
|
107
|
+
"app/portlets/forgot_password_portlet.rb",
|
106
108
|
"app/portlets/login_portlet.rb",
|
109
|
+
"app/portlets/reset_password_portlet.rb",
|
107
110
|
"app/portlets/tag_cloud_portlet.rb",
|
108
111
|
"app/views/cms/blocks/_hidden_fields.html.erb",
|
109
112
|
"app/views/cms/blocks/_toolbar.html.erb",
|
@@ -133,6 +136,8 @@ Gem::Specification.new do |s|
|
|
133
136
|
"app/views/cms/email_messages/show.html.erb",
|
134
137
|
"app/views/cms/file_blocks/_form.html.erb",
|
135
138
|
"app/views/cms/file_blocks/render.html.erb",
|
139
|
+
"app/views/cms/forgot_password_mailer/reset_password.text.html.erb",
|
140
|
+
"app/views/cms/forgot_password_mailer/reset_password.text.plain.erb",
|
136
141
|
"app/views/cms/form_builder/_cms_date_picker.html.erb",
|
137
142
|
"app/views/cms/form_builder/_cms_datetime_select.html.erb",
|
138
143
|
"app/views/cms/form_builder/_cms_drop_down.html.erb",
|
@@ -155,6 +160,8 @@ Gem::Specification.new do |s|
|
|
155
160
|
"app/views/cms/links/destroy.js.rjs",
|
156
161
|
"app/views/cms/links/edit.html.erb",
|
157
162
|
"app/views/cms/links/new.html.erb",
|
163
|
+
"app/views/cms/menus/_menu.html.erb",
|
164
|
+
"app/views/cms/menus/_menu_item.html.erb",
|
158
165
|
"app/views/cms/page_routes/_form.html.erb",
|
159
166
|
"app/views/cms/page_routes/edit.html.erb",
|
160
167
|
"app/views/cms/page_routes/index.html.erb",
|
@@ -191,6 +198,7 @@ Gem::Specification.new do |s|
|
|
191
198
|
"app/views/cms/shared/_pagination.html.erb",
|
192
199
|
"app/views/cms/shared/_version_conflict_diff.html.erb",
|
193
200
|
"app/views/cms/shared/_version_conflict_error.html.erb",
|
201
|
+
"app/views/cms/shared/access_denied.html.erb",
|
194
202
|
"app/views/cms/shared/error.html.erb",
|
195
203
|
"app/views/cms/tags/_form.html.erb",
|
196
204
|
"app/views/cms/tags/render.html.erb",
|
@@ -205,6 +213,7 @@ Gem::Specification.new do |s|
|
|
205
213
|
"app/views/cms/users/edit.html.erb",
|
206
214
|
"app/views/cms/users/index.html.erb",
|
207
215
|
"app/views/cms/users/new.html.erb",
|
216
|
+
"app/views/cms/users/show.html.erb",
|
208
217
|
"app/views/layouts/_cms_toolbar.html.erb",
|
209
218
|
"app/views/layouts/_page_toolbar.html.erb",
|
210
219
|
"app/views/layouts/application.html.erb",
|
@@ -221,11 +230,16 @@ Gem::Specification.new do |s|
|
|
221
230
|
"app/views/portlets/dynamic/_form.html.erb",
|
222
231
|
"app/views/portlets/email_page/_form.html.erb",
|
223
232
|
"app/views/portlets/email_page/render.html.erb",
|
233
|
+
"app/views/portlets/forgot_password/_form.html.erb",
|
234
|
+
"app/views/portlets/forgot_password/render.html.erb",
|
224
235
|
"app/views/portlets/login/_form.html.erb",
|
225
236
|
"app/views/portlets/login/render.html.erb",
|
226
237
|
"app/views/portlets/portlets/_form.html.erb",
|
238
|
+
"app/views/portlets/reset_password/_form.html.erb",
|
239
|
+
"app/views/portlets/reset_password/render.html.erb",
|
227
240
|
"app/views/portlets/tag_cloud/_form.html.erb",
|
228
241
|
"app/views/portlets/tag_cloud/render.html.erb",
|
242
|
+
"browsercms.gemspec",
|
229
243
|
"db/demo/data.rb",
|
230
244
|
"db/demo/page_partials/_footer.html.erb",
|
231
245
|
"db/demo/page_partials/_header.html.erb",
|
@@ -233,6 +247,7 @@ Gem::Specification.new do |s|
|
|
233
247
|
"db/demo/page_templates/sub_page.html.erb",
|
234
248
|
"db/migrate/20080815014337_browsercms_3_0_0.rb",
|
235
249
|
"db/migrate/20081114172307_load_seed_data.rb",
|
250
|
+
"db/migrate/20091109175123_browsercms_3_0_5.rb",
|
236
251
|
"doc/app/classes/AbstractFileBlock.html",
|
237
252
|
"doc/app/classes/ActiveRecord.html",
|
238
253
|
"doc/app/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html",
|
@@ -1167,6 +1182,7 @@ Gem::Specification.new do |s|
|
|
1167
1182
|
"public/images/cms/usercontrols_bg.png",
|
1168
1183
|
"public/images/cms/usercontrols_bg_cap.png",
|
1169
1184
|
"public/javascripts/cms/application.js",
|
1185
|
+
"public/javascripts/cms/content_library.js",
|
1170
1186
|
"public/javascripts/cms/editor.js",
|
1171
1187
|
"public/javascripts/cms/sitemap.js",
|
1172
1188
|
"public/javascripts/jquery-ui.js",
|
@@ -1225,8 +1241,7 @@ Gem::Specification.new do |s|
|
|
1225
1241
|
"rails_generators/portlet/templates/unit_test.erb",
|
1226
1242
|
"templates/blank.rb",
|
1227
1243
|
"templates/demo.rb",
|
1228
|
-
"templates/module.rb"
|
1229
|
-
"we5-browsercms.gemspec"
|
1244
|
+
"templates/module.rb"
|
1230
1245
|
]
|
1231
1246
|
s.homepage = %q{http://www.browsercms.org}
|
1232
1247
|
s.rdoc_options = ["--charset=UTF-8"]
|
@@ -1235,69 +1250,71 @@ Gem::Specification.new do |s|
|
|
1235
1250
|
s.rubygems_version = %q{1.3.5}
|
1236
1251
|
s.summary = %q{BrowserCMS is a general purpose, open source Web Content Management System (CMS), written in Ruby on Rails.}
|
1237
1252
|
s.test_files = [
|
1238
|
-
"test/
|
1239
|
-
"test/
|
1240
|
-
"test/functional/cms/
|
1241
|
-
"test/functional/cms/categories_controller_test.rb",
|
1242
|
-
"test/functional/cms/connectors_controller_test.rb",
|
1243
|
-
"test/functional/cms/content_controller_test.rb",
|
1253
|
+
"test/functional/cms/file_blocks_controller_test.rb",
|
1254
|
+
"test/functional/cms/toolbar_controller_test.rb",
|
1255
|
+
"test/functional/cms/sessions_controller_test.rb",
|
1244
1256
|
"test/functional/cms/content_types_controller_test.rb",
|
1245
1257
|
"test/functional/cms/dashboard_controller_test.rb",
|
1246
|
-
"test/functional/cms/
|
1247
|
-
"test/functional/cms/file_blocks_controller_test.rb",
|
1248
|
-
"test/functional/cms/groups_controller_test.rb",
|
1249
|
-
"test/functional/cms/home_controller_test.rb",
|
1258
|
+
"test/functional/cms/cache_controller_test.rb",
|
1250
1259
|
"test/functional/cms/html_blocks_controller_test.rb",
|
1251
|
-
"test/functional/cms/
|
1260
|
+
"test/functional/cms/users_controller_test.rb",
|
1261
|
+
"test/functional/cms/content_controller_test.rb",
|
1252
1262
|
"test/functional/cms/links_controller_test.rb",
|
1263
|
+
"test/functional/cms/dynamic_views_controller_test.rb",
|
1264
|
+
"test/functional/cms/categories_controller_test.rb",
|
1265
|
+
"test/functional/cms/content_block_controller_test.rb",
|
1253
1266
|
"test/functional/cms/pages_controller_test.rb",
|
1254
|
-
"test/functional/cms/
|
1267
|
+
"test/functional/cms/connectors_controller_test.rb",
|
1268
|
+
"test/functional/cms/home_controller_test.rb",
|
1255
1269
|
"test/functional/cms/section_nodes_controller_test.rb",
|
1270
|
+
"test/functional/cms/groups_controller_test.rb",
|
1256
1271
|
"test/functional/cms/sections_controller_test.rb",
|
1257
|
-
"test/functional/cms/
|
1258
|
-
"test/functional/cms/
|
1259
|
-
"test/
|
1260
|
-
"test/
|
1261
|
-
"test/test_helper.rb",
|
1272
|
+
"test/functional/cms/portlets_controller_test.rb",
|
1273
|
+
"test/functional/cms/image_blocks_controller_test.rb",
|
1274
|
+
"test/factories.rb",
|
1275
|
+
"test/custom_assertions.rb",
|
1262
1276
|
"test/test_logging.rb",
|
1263
|
-
"test/
|
1264
|
-
"test/unit/behaviors/dynamic_attributes_test.rb",
|
1265
|
-
"test/unit/behaviors/publishable_test.rb",
|
1266
|
-
"test/unit/behaviors/searching_test.rb",
|
1267
|
-
"test/unit/behaviors/taggable_test.rb",
|
1268
|
-
"test/unit/extensions/active_record/base_test.rb",
|
1269
|
-
"test/unit/extensions/hash_test.rb",
|
1270
|
-
"test/unit/extensions/integer_test.rb",
|
1271
|
-
"test/unit/helpers/application_helper_test.rb",
|
1272
|
-
"test/unit/helpers/form_builder_test.rb",
|
1273
|
-
"test/unit/helpers/menu_helper_test.rb",
|
1277
|
+
"test/test_helper.rb",
|
1274
1278
|
"test/unit/helpers/page_helper_test.rb",
|
1279
|
+
"test/unit/helpers/application_helper_test.rb",
|
1275
1280
|
"test/unit/helpers/path_helper_test.rb",
|
1276
|
-
"test/unit/
|
1277
|
-
"test/unit/
|
1278
|
-
"test/unit/
|
1279
|
-
"test/unit/models/
|
1280
|
-
"test/unit/models/
|
1281
|
-
"test/unit/models/category_type_test.rb",
|
1282
|
-
"test/unit/models/connector_test.rb",
|
1283
|
-
"test/unit/models/content_type_test.rb",
|
1281
|
+
"test/unit/helpers/menu_helper_test.rb",
|
1282
|
+
"test/unit/helpers/form_builder_test.rb",
|
1283
|
+
"test/unit/schema_statements_test.rb",
|
1284
|
+
"test/unit/models/user_test.rb",
|
1285
|
+
"test/unit/models/link_test.rb",
|
1284
1286
|
"test/unit/models/email_page_portlet_test.rb",
|
1285
|
-
"test/unit/models/file_block_test.rb",
|
1286
1287
|
"test/unit/models/group_test.rb",
|
1288
|
+
"test/unit/models/site_test.rb",
|
1289
|
+
"test/unit/models/sections_test.rb",
|
1290
|
+
"test/unit/models/section_node_test.rb",
|
1291
|
+
"test/unit/models/content_type_test.rb",
|
1287
1292
|
"test/unit/models/html_block_test.rb",
|
1288
|
-
"test/unit/models/link_test.rb",
|
1289
|
-
"test/unit/models/page_partial_test.rb",
|
1290
|
-
"test/unit/models/page_route_test.rb",
|
1291
|
-
"test/unit/models/page_template_test.rb",
|
1292
|
-
"test/unit/models/page_test.rb",
|
1293
|
-
"test/unit/models/permission_test.rb",
|
1294
1293
|
"test/unit/models/portlet_test.rb",
|
1295
|
-
"test/unit/models/
|
1296
|
-
"test/unit/models/sections_test.rb",
|
1297
|
-
"test/unit/models/site_test.rb",
|
1294
|
+
"test/unit/models/connector_test.rb",
|
1298
1295
|
"test/unit/models/task_test.rb",
|
1299
|
-
"test/unit/models/
|
1300
|
-
"test/unit/
|
1296
|
+
"test/unit/models/page_test.rb",
|
1297
|
+
"test/unit/models/category_test.rb",
|
1298
|
+
"test/unit/models/page_route_test.rb",
|
1299
|
+
"test/unit/models/page_partial_test.rb",
|
1300
|
+
"test/unit/models/attachment_test.rb",
|
1301
|
+
"test/unit/models/file_block_test.rb",
|
1302
|
+
"test/unit/models/permission_test.rb",
|
1303
|
+
"test/unit/models/page_template_test.rb",
|
1304
|
+
"test/unit/models/category_type_test.rb",
|
1305
|
+
"test/unit/behaviors/publishable_test.rb",
|
1306
|
+
"test/unit/behaviors/searching_test.rb",
|
1307
|
+
"test/unit/behaviors/dynamic_attributes_test.rb",
|
1308
|
+
"test/unit/behaviors/taggable_test.rb",
|
1309
|
+
"test/unit/behaviors/attaching_test.rb",
|
1310
|
+
"test/unit/extensions/hash_test.rb",
|
1311
|
+
"test/unit/extensions/active_record/base_test.rb",
|
1312
|
+
"test/unit/extensions/integer_test.rb",
|
1313
|
+
"test/unit/lib/routes_test.rb",
|
1314
|
+
"test/unit/lib/generators_test.rb",
|
1315
|
+
"test/unit/lib/content_block_test.rb",
|
1316
|
+
"test/integration/cms/password_management_test.rb",
|
1317
|
+
"test/integration/login_test.rb"
|
1301
1318
|
]
|
1302
1319
|
|
1303
1320
|
if s.respond_to? :specification_version then
|
@@ -1310,3 +1327,4 @@ Gem::Specification.new do |s|
|
|
1310
1327
|
else
|
1311
1328
|
end
|
1312
1329
|
end
|
1330
|
+
|
data/lib/acts_as_list.rb
CHANGED
@@ -61,7 +61,7 @@ module ActsAsList
|
|
61
61
|
|
62
62
|
#{scope_condition_method}
|
63
63
|
|
64
|
-
before_destroy :
|
64
|
+
before_destroy :remove_from_list_without_saving
|
65
65
|
before_create :add_to_list_bottom
|
66
66
|
EOV
|
67
67
|
end
|
@@ -118,13 +118,17 @@ module ActsAsList
|
|
118
118
|
end
|
119
119
|
|
120
120
|
# Removes the item from the list.
|
121
|
-
def remove_from_list
|
121
|
+
def remove_from_list(save = true)
|
122
122
|
if in_list?
|
123
123
|
decrement_positions_on_lower_items
|
124
|
-
update_attribute
|
124
|
+
update_attribute(position_column, nil) if save
|
125
125
|
end
|
126
126
|
end
|
127
127
|
|
128
|
+
def remove_from_list_without_saving
|
129
|
+
self.remove_from_list(false)
|
130
|
+
end
|
131
|
+
|
128
132
|
# Increase the position of this item without adjusting the rest of the list.
|
129
133
|
def increment_position
|
130
134
|
return unless in_list?
|
@@ -249,4 +253,4 @@ module ActsAsList
|
|
249
253
|
self.update_attribute(position_column, position)
|
250
254
|
end
|
251
255
|
end
|
252
|
-
end
|
256
|
+
end
|