forgeos_cms 1.9.4 → 1.9.5.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/MIT-LICENSE +20 -0
- data/README.textile +3 -1
- data/app/assets/javascripts/forgeos/admin/functions.js +2 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_cms/all.js +1 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_cms/carousels.js +4 -4
- data/app/assets/javascripts/forgeos/admin/inits.js +2 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/all.js +1 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/carousels.js +5 -1
- data/app/assets/stylesheets/forgeos/admin/forgeos_cms/_blocks.css.sass +12 -10
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/style.css.sass +4 -4
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/style.css.sass +4 -4
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/style.css.sass +10 -7
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/style.css.sass +4 -4
- data/app/controllers/admin/actualities_controller.rb +15 -5
- data/app/controllers/admin/import_controller.rb +2 -2
- data/app/controllers/admin/menus_controller.rb +13 -2
- data/app/controllers/admin/newsletters_controller.rb +8 -5
- data/app/controllers/admin/pages_controller.rb +6 -2
- data/app/controllers/admin/static_content_blocks_controller.rb +6 -2
- data/app/controllers/admin/widgets_controller.rb +7 -4
- data/app/helpers/admin/base_helper.rb +5 -5
- data/app/models/block.rb +1 -1
- data/app/models/page_sweeper.rb +1 -1
- data/app/views/admin/actualities/_form.html.haml +2 -2
- data/app/views/admin/actualities/activate.js.erb +1 -0
- data/app/views/admin/actualities/destroy.js.erb +1 -0
- data/app/views/admin/actualities/index.json.erb +3 -6
- data/app/views/admin/carousels/_form.html.haml +2 -2
- data/app/views/admin/categories/_block.html.haml +1 -0
- data/app/views/admin/menus/_form.html.haml +1 -1
- data/app/views/admin/menus/_form_menu_links.html.haml +2 -0
- data/app/views/admin/menus/activate.js.erb +1 -0
- data/app/views/admin/menus/destroy.js.erb +1 -0
- data/app/views/admin/menus/index.json.erb +4 -6
- data/app/views/admin/newsletters/_form.html.haml +1 -1
- data/app/views/admin/newsletters/destroy.js.erb +1 -0
- data/app/views/admin/newsletters/index.json.erb +1 -3
- data/app/views/admin/pages/_form.html.haml +1 -1
- data/app/views/admin/pages/_page_url.html.haml +1 -0
- data/app/views/admin/pages/_seo.html.haml +1 -2
- data/app/views/admin/pages/destroy.js.erb +1 -0
- data/app/views/admin/pages/index.json.erb +3 -5
- data/app/views/admin/static_content_blocks/_form.html.haml +1 -1
- data/app/views/admin/static_content_blocks/destroy.js.erb +1 -0
- data/app/views/admin/static_content_blocks/index.json.erb +3 -6
- data/app/views/admin/widget_actualities/_form.html.haml +1 -1
- data/app/views/admin/widget_faqs/_form.html.haml +1 -1
- data/app/views/admin/widgets/destroy.js.erb +1 -0
- data/app/views/admin/widgets/index.json.erb +2 -4
- data/config/forgeos_admin_menu.yml +13 -0
- data/config/locales/activerecord/en.yml +0 -1
- data/config/locales/activerecord/fr.yml +0 -1
- data/config/locales/admin/page/fr.yml +5 -5
- data/config/routes.rb +5 -2
- data/lib/forgeos/cms.rb +0 -1
- data/lib/forgeos/cms/engine.rb +4 -1
- data/lib/forgeos/cms/version.rb +5 -0
- data/lib/forgeos_cms.rb +0 -2
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +9 -0
- data/test/dummy/app/assets/stylesheets/application.css +7 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +42 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +27 -0
- data/test/dummy/config/environments/production.rb +51 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/forgeos_cms_test.rb +7 -0
- data/test/test_helper.rb +10 -0
- metadata +337 -307
- data/app/controllers/actualities_controller.rb +0 -11
- data/app/controllers/admin/base_controller.rb +0 -11
- data/app/controllers/forgeos/application_controller.rb +0 -38
- data/app/controllers/newsletters_controller.rb +0 -11
- data/app/controllers/pages_controller.rb +0 -24
- data/app/controllers/search_controller.rb +0 -7
- data/app/helpers/application_helper.rb +0 -43
- data/app/helpers/menu_helper.rb +0 -46
- data/app/helpers/routes_helper.rb +0 -19
- data/app/views/actualities/rss.rxml +0 -20
- data/app/views/admin/carousels/_attachments_popups.html.haml +0 -43
- data/app/views/pages/_linked_pages.html.haml +0 -4
- data/app/views/pages/_page.html.haml +0 -15
- data/app/views/pages/show.html.haml +0 -9
- data/app/views/search/index.html.haml +0 -8
- data/lib/forgeos/admin_menu.rb +0 -14
data/Gemfile
ADDED
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2011 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.textile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
h1. ForgeosCMS
|
2
2
|
|
3
|
-
ForgeosCMS is
|
3
|
+
ForgeosCMS is a CMS plugin for ruby on rails applications and a part of the "Forgeos Suite":http://forgeos.com
|
4
|
+
This branch work with rails 3.1.0.rc5 and is distributed as a gem on "Rubygems.org":https://rubygems.org/gems/forgeos_cms
|
4
5
|
|
5
6
|
VERSION : 1.9.4
|
6
7
|
|
@@ -11,6 +12,7 @@ h2. Install
|
|
11
12
|
$ rails new my_site -d mysql
|
12
13
|
$ cd my_site
|
13
14
|
$ rake rails:template LOCATION=https://raw.github.com/webpulser/forgeos_cms/rails3/forgeos_cms_install.rb
|
15
|
+
$ rails s
|
14
16
|
</code></pre>
|
15
17
|
# Then go to localhost:3000/admin and Enjoy !
|
16
18
|
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require_tree .
|
@@ -48,9 +48,9 @@ function remove_carousel_item(destroy_link){
|
|
48
48
|
update_block_container_positions(jQuery('#carousel_items'));
|
49
49
|
}
|
50
50
|
|
51
|
-
function add_picture_to_carousel_item(
|
51
|
+
function add_picture_to_carousel_item(data){
|
52
52
|
var image = current_carousel_item_link.prevAll('img');
|
53
|
-
image.attr('src', path);
|
54
|
-
image.attr('alt', name);
|
55
|
-
current_carousel_item_link.prevAll('input').attr('value', id);
|
53
|
+
image.attr('src', data.path);
|
54
|
+
image.attr('alt', data.name);
|
55
|
+
current_carousel_item_link.prevAll('input').attr('value', data.id);
|
56
56
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require_tree .
|
@@ -5,7 +5,11 @@ jQuery(document).ready(function(){
|
|
5
5
|
|
6
6
|
jQuery('.change-picture').live('click',function(){
|
7
7
|
current_carousel_item_link = jQuery(this);
|
8
|
-
|
8
|
+
jQuery('.add-image').removeClass('current');
|
9
|
+
current_carousel_item_link.addClass('add-image');
|
10
|
+
current_carousel_item_link.addClass('current');
|
11
|
+
current_carousel_item_link.data('callback', 'add_picture_to_carousel_item');
|
12
|
+
openimageUploadDialog();
|
9
13
|
return false;
|
10
14
|
});
|
11
15
|
|
@@ -2,7 +2,8 @@
|
|
2
2
|
width: 650px !important
|
3
3
|
.blocks-tree.hidden
|
4
4
|
display: none
|
5
|
-
|
5
|
+
#page_meta_info_attributes_title
|
6
|
+
width: 650px
|
6
7
|
.block-container.widget-modify
|
7
8
|
min-height: 4em
|
8
9
|
height: auto !important
|
@@ -17,7 +18,7 @@
|
|
17
18
|
background:
|
18
19
|
color: #e0e0e0
|
19
20
|
border: 1px solid #f3f3f3
|
20
|
-
+
|
21
|
+
+border-radius(4px)
|
21
22
|
overflow: hidden
|
22
23
|
.block-type
|
23
24
|
padding: 0 4px
|
@@ -98,7 +99,7 @@
|
|
98
99
|
+block
|
99
100
|
text-align: left
|
100
101
|
margin: 8px
|
101
|
-
padding-left:
|
102
|
+
padding-left: 15px
|
102
103
|
&.picture-title
|
103
104
|
margin-top: 40px
|
104
105
|
.block-name
|
@@ -107,7 +108,7 @@
|
|
107
108
|
width: 99%
|
108
109
|
font-size: 0.7em
|
109
110
|
border: 1px solid $lightGray
|
110
|
-
+
|
111
|
+
+border-radius(4px)
|
111
112
|
padding: 2px
|
112
113
|
font-weight: bold
|
113
114
|
textarea
|
@@ -115,12 +116,12 @@
|
|
115
116
|
width: 99%
|
116
117
|
font-size: 0.9em
|
117
118
|
border: 1px solid $lightGray
|
118
|
-
+
|
119
|
+
+border-radius(4px)
|
119
120
|
padding: 2px
|
120
121
|
margin-bottom: 0.8em
|
121
122
|
.widget-url
|
122
123
|
border: 1px solid $lightGray
|
123
|
-
+
|
124
|
+
+border-radius(4px)
|
124
125
|
background: #e6e6e6
|
125
126
|
height: 1.2em
|
126
127
|
margin: 5px 0
|
@@ -160,17 +161,17 @@
|
|
160
161
|
margin-right: 0
|
161
162
|
padding-right: 16px
|
162
163
|
&.open
|
163
|
-
background:
|
164
|
+
background: image_url("forgeos/jstree/themes/categories/fminus_rtl.gif") right 6px no-repeat
|
164
165
|
margin-right: 0
|
165
166
|
padding-right: 16px
|
166
167
|
&.closed
|
167
|
-
background:
|
168
|
+
background: image_url("forgeos/jstree/themes/categories/fplus_rtl.gif") right 4px no-repeat
|
168
169
|
margin-right: 0
|
169
170
|
padding-right: 16px
|
170
171
|
a
|
171
172
|
cursor: default
|
172
173
|
padding: 0px 5px 0px 24px
|
173
|
-
+
|
174
|
+
+border-radius(4px)
|
174
175
|
width: auto
|
175
176
|
color: #557383 !important
|
176
177
|
font-weight: bold
|
@@ -200,7 +201,7 @@
|
|
200
201
|
span.clicked
|
201
202
|
padding: 0px 3px 0px 20px
|
202
203
|
&.clicked
|
203
|
-
|
204
|
+
+border-radius(3px)
|
204
205
|
margin: 2px 0 !important
|
205
206
|
|
206
207
|
#form_actuality
|
@@ -221,3 +222,4 @@
|
|
221
222
|
padding: 2px
|
222
223
|
.block-type
|
223
224
|
padding: 3px
|
225
|
+
|
@@ -4,14 +4,14 @@
|
|
4
4
|
li
|
5
5
|
width: 100%
|
6
6
|
&.jstree-open > ins.jstree-icon
|
7
|
-
background:
|
7
|
+
background: image_url("forgeos/jstree/themes/association_page/dark-blue-minus.png") 0 0 no-repeat
|
8
8
|
|
9
9
|
&.jstree-closed > ins.jstree-icon
|
10
|
-
background:
|
10
|
+
background: image_url("forgeos/jstree/themes/association_page/dark-blue-plus.png") 0 1px no-repeat
|
11
11
|
&.jstree-checked a > ins.jstree-checkbox
|
12
|
-
background:
|
12
|
+
background: image_url("forgeos/jstree/themes/association_page/check-checked.png") 0 1px no-repeat
|
13
13
|
&.jstree-unchecked a > ins.jstree-checkbox
|
14
|
-
background:
|
14
|
+
background: image_url("forgeos/jstree/themes/association_page/check-unchecked.png") 0 1px no-repeat
|
15
15
|
|
16
16
|
a
|
17
17
|
display: inline !important
|
@@ -6,14 +6,14 @@
|
|
6
6
|
width: 95%
|
7
7
|
|
8
8
|
&.open
|
9
|
-
background:
|
9
|
+
background: image_url("forgeos/jstree/themes/block_category/brown-minus.png") 0px 1px no-repeat
|
10
10
|
|
11
11
|
&.closed
|
12
|
-
background:
|
12
|
+
background: image_url("forgeos/jstree/themes/block_category/brown-plus.png") 0 1px no-repeat
|
13
13
|
|
14
14
|
|
15
15
|
#jstree-dragged.jstree-block_category li li.open
|
16
|
-
background:
|
16
|
+
background: image_url("forgeos/jstree/themes/block_category/brown-plus.png") 0 1px no-repeat
|
17
17
|
|
18
18
|
|
19
19
|
.jstree.jstree-block_category .ltr li a
|
@@ -85,7 +85,7 @@
|
|
85
85
|
|
86
86
|
|
87
87
|
.jstree.jstree-block_category .ltr li a.loading
|
88
|
-
background-image:
|
88
|
+
background-image: image_url("forgeos/jstree/themes/block_category/throbber.gif")
|
89
89
|
|
90
90
|
|
91
91
|
.jstree-block_category-context
|
@@ -4,7 +4,7 @@
|
|
4
4
|
.see-on, .see-off, .editing
|
5
5
|
display: none
|
6
6
|
li.open
|
7
|
-
background:
|
7
|
+
background: image_url("forgeos/jstree/themes/menu-tree/dark-blue-plus.png") 0 3px no-repeat
|
8
8
|
#tree-marker
|
9
9
|
background-color: #FBEC88
|
10
10
|
background-position: 0 0 !important
|
@@ -33,9 +33,9 @@
|
|
33
33
|
top: 2px
|
34
34
|
|
35
35
|
&.jstree-open
|
36
|
-
background:
|
36
|
+
background: image_url("forgeos/jstree/themes/menu-tree/dark-blue-minus.png") 0 2px no-repeat
|
37
37
|
&.jstree-closed
|
38
|
-
background:
|
38
|
+
background: image_url("forgeos/jstree/themes/menu-tree/dark-blue-plus.png") 0 3px no-repeat
|
39
39
|
&.folder
|
40
40
|
.tree-link
|
41
41
|
background-color: #FAFAFA
|
@@ -50,7 +50,7 @@
|
|
50
50
|
width: 500px !important
|
51
51
|
|
52
52
|
.tree-link
|
53
|
-
background:
|
53
|
+
background: image_url("forgeos/jstree/themes/menu-tree/drag-drop.png") no-repeat left center
|
54
54
|
padding-top: 2px
|
55
55
|
padding-bottom: 2px
|
56
56
|
padding-left: 40px
|
@@ -61,16 +61,16 @@
|
|
61
61
|
position: relative
|
62
62
|
margin-right: 80px
|
63
63
|
&.editing
|
64
|
-
background:
|
64
|
+
background: image_url("forgeos/jstree/themes/menu-tree/big-drag-and-drop.png") repeat-y left center
|
65
65
|
a.tree-link
|
66
66
|
|
67
67
|
display: block
|
68
68
|
|
69
69
|
&.jstree-leaf .tree-link
|
70
|
-
background:
|
70
|
+
background: image_url("forgeos/jstree/themes/menu-tree/drag-drop.png") no-repeat left center
|
71
71
|
background-color: #FFF
|
72
72
|
&.editing
|
73
|
-
background:
|
73
|
+
background: image_url("forgeos/jstree/themes/menu-tree/big-drag-and-drop.png") repeat-y left center
|
74
74
|
|
75
75
|
|
76
76
|
.add-green-plus, .edit-link, .destroy-link
|
@@ -91,6 +91,8 @@
|
|
91
91
|
display: block
|
92
92
|
|
93
93
|
.actions
|
94
|
+
margin-left: 330px
|
95
|
+
padding-top: 15px
|
94
96
|
color: #4D4D4D
|
95
97
|
a
|
96
98
|
color: #006EBD
|
@@ -108,3 +110,4 @@
|
|
108
110
|
right: 2px
|
109
111
|
top: 2px
|
110
112
|
padding: 0
|
113
|
+
|
@@ -6,14 +6,14 @@
|
|
6
6
|
width: 95%
|
7
7
|
|
8
8
|
&.open
|
9
|
-
background:
|
9
|
+
background: image_url("forgeos/jstree/themes/page_category/brown-minus.png") 0px 1px no-repeat
|
10
10
|
|
11
11
|
&.closed
|
12
|
-
background:
|
12
|
+
background: image_url("forgeos/jstree/themes/page_category/brown-plus.png") 0 1px no-repeat
|
13
13
|
|
14
14
|
|
15
15
|
#jstree-dragged.jstree-page_category li li.open
|
16
|
-
background:
|
16
|
+
background: image_url("forgeos/jstree/themes/page_category/brown-plus.png") 0 1px no-repeat
|
17
17
|
|
18
18
|
|
19
19
|
.jstree.jstree-page_category .ltr li a
|
@@ -85,7 +85,7 @@
|
|
85
85
|
|
86
86
|
|
87
87
|
.jstree.jstree-page_category .ltr li a.loading
|
88
|
-
background-image:
|
88
|
+
background-image: image_url("forgeos/jstree/themes/page_category/throbber.gif")
|
89
89
|
|
90
90
|
|
91
91
|
.jstree-page_category-context
|
@@ -44,17 +44,27 @@ class Admin::ActualitiesController < Admin::BaseController
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def activate
|
47
|
-
|
47
|
+
@actuality.activate
|
48
|
+
respond_to do |wants|
|
49
|
+
wants.html do
|
50
|
+
redirect_to([forgeos_cms, :admin, :actualities])
|
51
|
+
end
|
52
|
+
wants.js
|
53
|
+
end
|
48
54
|
end
|
49
55
|
|
50
56
|
def destroy
|
51
57
|
if @actuality.destroy
|
52
58
|
flash[:notice] = t('actuality.destroy.success').capitalize
|
53
|
-
return redirect_to([forgeos_cms, :admin, :actualities]) if !request.xhr?
|
54
59
|
else
|
55
60
|
flash[:error] = t('actuality.destroy.failed').capitalize
|
56
61
|
end
|
57
|
-
|
62
|
+
respond_to do |wants|
|
63
|
+
wants.html do
|
64
|
+
redirect_to([forgeos_cms, :admin, :actualities])
|
65
|
+
end
|
66
|
+
wants.js
|
67
|
+
end
|
58
68
|
end
|
59
69
|
|
60
70
|
|
@@ -89,12 +99,12 @@ private
|
|
89
99
|
|
90
100
|
|
91
101
|
if params[:sSearch] && !params[:sSearch].blank?
|
102
|
+
options[:group] = 'id'
|
92
103
|
@actualities = Actuality.search(params[:sSearch],options)
|
93
104
|
else
|
94
105
|
options[:joins] = joins
|
106
|
+
options[:group] = 'id'
|
95
107
|
@actualities = Actuality.paginate(options)
|
96
108
|
end
|
97
109
|
end
|
98
|
-
|
99
|
-
|
100
110
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
load File.join(Gem.loaded_specs['forgeos_core'].full_gem_path, 'app', 'controllers', 'admin', 'import_controller.rb')
|
2
2
|
Admin::ImportController.class_eval do
|
3
|
-
map_fields :create_page, Page.new.attributes.keys
|
4
|
-
map_fields :create_block, Block.new.attributes.keys
|
5
3
|
before_filter :cms_models, :only => :index
|
6
4
|
|
5
|
+
map_fields :create_page, Page.new.attributes.keys
|
7
6
|
def create_page
|
8
7
|
create_model(Page,'single_key')
|
9
8
|
end
|
10
9
|
|
10
|
+
map_fields :create_block, Block.new.attributes.keys
|
11
11
|
def create_block
|
12
12
|
create_model(Block,'single_key')
|
13
13
|
end
|
@@ -53,11 +53,22 @@ class Admin::MenusController < Admin::BaseController
|
|
53
53
|
else
|
54
54
|
flash[:error] = t('menu.destroy.failed').capitalize
|
55
55
|
end
|
56
|
-
|
56
|
+
respond_to do |wants|
|
57
|
+
wants.html do
|
58
|
+
redirect_to([forgeos_cms, :admin, :menus])
|
59
|
+
end
|
60
|
+
wants.js
|
61
|
+
end
|
57
62
|
end
|
58
63
|
|
59
64
|
def activate
|
60
|
-
|
65
|
+
@menu.activate
|
66
|
+
respond_to do |wants|
|
67
|
+
wants.html do
|
68
|
+
redirect_to([forgeos_cms, :admin, :menus])
|
69
|
+
end
|
70
|
+
wants.js
|
71
|
+
end
|
61
72
|
end
|
62
73
|
|
63
74
|
private
|
@@ -56,21 +56,24 @@ class Admin::NewslettersController < Admin::BaseController
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def destroy
|
59
|
-
|
60
|
-
if @deleted
|
59
|
+
if @newsletter.destroy
|
61
60
|
flash[:notice] = I18n.t('newsletter.destroy.success').capitalize
|
62
|
-
return redirect_to([forgeos_cms, :admin, :newsletters]) if !request.xhr?
|
63
61
|
else
|
64
62
|
flash[:error] = I18n.t('newsletter.destroy.failed').capitalize
|
65
63
|
end
|
66
|
-
|
64
|
+
respond_to do |wants|
|
65
|
+
wants.html do
|
66
|
+
redirect_to([forgeos_cms, :admin, :newsletter])
|
67
|
+
end
|
68
|
+
wants.js
|
69
|
+
end
|
67
70
|
end
|
68
71
|
|
69
72
|
private
|
70
73
|
|
71
74
|
def get_newsletter
|
72
75
|
unless @newsletter = Newsletter.find_by_id(params[:id])
|
73
|
-
flash[:error] = I18n.t('
|
76
|
+
flash[:error] = I18n.t('newsletter.not_found').capitalize
|
74
77
|
return redirect_to([forgeos_cms, :admin, :newsletters])
|
75
78
|
end
|
76
79
|
end
|
@@ -61,10 +61,14 @@ class Admin::PagesController < Admin::BaseController
|
|
61
61
|
if @page.destroy
|
62
62
|
flash[:notice] = I18n.t('page.destroy.success').capitalize
|
63
63
|
else
|
64
|
-
flash[:error] = @page.errors if @page
|
65
64
|
flash[:error] = I18n.t('page.destroy.failed').capitalize
|
66
65
|
end
|
67
|
-
|
66
|
+
respond_to do |wants|
|
67
|
+
wants.html do
|
68
|
+
redirect_to([forgeos_cms, :admin, :pages])
|
69
|
+
end
|
70
|
+
wants.js
|
71
|
+
end
|
68
72
|
end
|
69
73
|
|
70
74
|
def link
|
@@ -52,10 +52,14 @@ class Admin::StaticContentBlocksController < Admin::BaseController
|
|
52
52
|
if @static_content_block.destroy
|
53
53
|
flash[:notice] = I18n.t('static_content_block.destroy.success').capitalize
|
54
54
|
else
|
55
|
-
flash[:error] = @static_content_block.errors if @static_content_block
|
56
55
|
flash[:error] = I18n.t('static_content_block.destroy.failed').capitalize
|
57
56
|
end
|
58
|
-
|
57
|
+
respond_to do |wants|
|
58
|
+
wants.html do
|
59
|
+
redirect_to([forgeos_cms, :admin, :static_content_blocks])
|
60
|
+
end
|
61
|
+
wants.js
|
62
|
+
end
|
59
63
|
end
|
60
64
|
|
61
65
|
def link
|