tb_cms 1.0 → 1.0.1
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.markdown +1 -1
- data/app/assets/javascripts/{spud/admin → admin}/cms/application.js +2 -2
- data/app/controllers/{spud/admin → admin}/menu_items_controller.rb +13 -14
- data/app/controllers/{spud/admin → admin}/menus_controller.rb +11 -12
- data/app/controllers/{spud/admin → admin}/pages_controller.rb +11 -12
- data/app/controllers/{spud/admin → admin}/snippets_controller.rb +11 -13
- data/app/controllers/{spud/cms → cms}/sitemaps_controller.rb +1 -1
- data/app/helpers/{spud/cms → cms}/application_helper.rb +1 -1
- data/app/observers/page_sweeper.rb +2 -2
- data/app/views/{spud/admin → admin}/menu_items/_menu_item_row.html.erb +2 -2
- data/app/views/admin/menu_items/edit.html.erb +10 -0
- data/app/views/{spud/admin → admin}/menu_items/index.html.erb +1 -1
- data/app/views/admin/menu_items/new.html.erb +12 -0
- data/app/views/{spud/admin → admin}/menus/edit.html.erb +2 -2
- data/app/views/admin/menus/index.html.erb +24 -0
- data/app/views/{spud/admin → admin}/menus/new.html.erb +2 -2
- data/app/views/{spud/admin → admin}/pages/_form.html.erb +1 -1
- data/app/views/admin/pages/_page_row.html.erb +18 -0
- data/app/views/{spud/admin → admin}/pages/edit.html.erb +2 -2
- data/app/views/{spud/admin → admin}/pages/index.html.erb +1 -1
- data/app/views/{spud/admin → admin}/pages/new.html.erb +2 -2
- data/app/views/admin/snippets/edit.html.erb +7 -0
- data/app/views/admin/snippets/index.html.erb +24 -0
- data/app/views/{spud/admin → admin}/snippets/new.html.erb +2 -2
- data/app/views/admin/templates/edit.html.erb +9 -0
- data/app/views/admin/templates/index.html.erb +17 -0
- data/app/views/{spud/admin → admin}/templates/new.html.erb +2 -2
- data/config/routes.rb +21 -22
- data/lib/spud_cms/engine.rb +8 -8
- data/lib/spud_cms/template_parser.rb +1 -1
- data/lib/spud_cms/version.rb +1 -1
- data/spec/controllers/{spud/admin → admin}/menu_items_controller_spec.rb +4 -4
- data/spec/controllers/{spud/admin → admin}/menus_controller_spec.rb +4 -4
- data/spec/controllers/{spud/admin → admin}/pages_controller_spec.rb +11 -3
- data/spec/controllers/admin/snippets_controller_spec.rb +5 -0
- data/spec/controllers/{spud/cms → cms}/sitemaps_controller_spec.rb +1 -1
- data/spec/controllers/pages_controller_spec.rb +1 -1
- data/spec/dummy/db/migrate/20120307003559_create_spud_permalinks.spud_permalinks.rb +1 -1
- data/spec/dummy/db/migrate/20120610123556_add_scope_to_spud_admin_permissions.spud_core.rb +1 -1
- data/spec/dummy/db/schema.rb +1 -1
- data/spec/dummy/log/test.log +7557 -0
- data/spec/helpers/{spud/cms → cms}/application_helper_spec.rb +1 -1
- metadata +51 -57
- data/app/assets/javascripts/spud/admin/snippets.js +0 -2
- data/app/assets/stylesheets/spud/admin/cms.css +0 -4
- data/app/assets/stylesheets/spud/admin/snippets.css +0 -4
- data/app/controllers/spud/admin/cms_controller.rb +0 -3
- data/app/views/spud/admin/menu_items/edit.html.erb +0 -10
- data/app/views/spud/admin/menu_items/new.html.erb +0 -12
- data/app/views/spud/admin/menus/index.html.erb +0 -24
- data/app/views/spud/admin/pages/_page_row.html.erb +0 -18
- data/app/views/spud/admin/snippets/edit.html.erb +0 -7
- data/app/views/spud/admin/snippets/index.html.erb +0 -24
- data/app/views/spud/admin/templates/edit.html.erb +0 -9
- data/app/views/spud/admin/templates/index.html.erb +0 -17
- data/spec/controllers/spud/admin/cms_controller_spec.rb +0 -11
- data/spec/controllers/spud/admin/snippets_controller_spec.rb +0 -5
- /data/app/assets/javascripts/{spud/admin → admin}/cms/menu_items.js +0 -0
- /data/app/assets/javascripts/{spud/admin → admin}/cms/pages.js +0 -0
- /data/app/assets/stylesheets/{spud/admin → admin}/cms/application.css +0 -0
- /data/app/views/{spud/admin → admin}/menu_items/_form.html.erb +0 -0
- /data/app/views/{spud/admin → admin}/menus/_form.html.erb +0 -0
- /data/app/views/{spud/admin → admin}/pages/_page_partials_form.html.erb +0 -0
- /data/app/views/{spud/admin → admin}/pages/show.html.erb +0 -0
- /data/app/views/{spud/admin → admin}/snippets/_form.html.erb +0 -0
- /data/app/views/{spud/admin → admin}/templates/_form.html.erb +0 -0
- /data/app/views/{spud/cms → cms}/sitemaps/show.xml.builder +0 -0
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
OTIxNWM0MWZmMWJlYWJkOTRhZmQ1MjA3OWI3MDdmMzE2Y2Y0ZjFmOA==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
YjM0ZWIzNGI1NmUxMzg5OTZlNDhlYTMwMTM5YzUyZDFiYjdjN2ZhMg==
|
|
7
7
|
!binary "U0hBNTEy":
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
MWRlMjcyZjRhM2JmNjE4MmQ2NTJlMzZhMmUzMDI2ZjM4Y2IwZWM2MzM0MTcz
|
|
10
|
+
YmRjODBiOWMzNDRmMDM3ZTkwNDJmYzU2NTU4ZTNjZmVjMzM3YWRhMjZiM2Ux
|
|
11
|
+
MDU0NzFiMGQzMGI3ZTcxZDBhNmE0Mzk3ZjI0YzkyMjRkNjE3ZTg=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
NDBmNzNlNjI5NjUxNTg4ZmY4MmY0NTAxMTZmODFiNzc5NDJmODExYTM4YmJm
|
|
14
|
+
ZDdkODZkNTM0ZDliZTFkYjZhZjU1ZDQxZDk2YTY3MTJiMDMwZDVhZDMxMWQ2
|
|
15
|
+
NWMyOTMwYTAxOGYxM2NlNjliYWQ2NzMyY2Y3MmJmYWY5MWQyZTY=
|
data/README.markdown
CHANGED
|
@@ -84,7 +84,7 @@ In your new engine add spud_admin as a dependency and create an initializer insi
|
|
|
84
84
|
|
|
85
85
|
You can use the layouts provided with spud admin by using 'spud/admin/application' or 'spud/admin/detail' layouts
|
|
86
86
|
|
|
87
|
-
When creating controllers for the admin panel create them in the
|
|
87
|
+
When creating controllers for the admin panel create them in the Admin Namespace and have them extend Admin::ApplicationController for automatic user authentication restrictions.
|
|
88
88
|
|
|
89
89
|
Testing
|
|
90
90
|
-----------------
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
class
|
|
2
|
-
add_breadcrumb "Menus", :
|
|
1
|
+
class Admin::MenuItemsController < Admin::ApplicationController
|
|
2
|
+
add_breadcrumb "Menus", :admin_menus_path
|
|
3
3
|
belongs_to_spud_app :menus, :page_title => "Menu Items"
|
|
4
|
-
layout 'spud/admin/detail'
|
|
5
4
|
before_filter :load_menu
|
|
6
5
|
before_filter :load_menu_item, :only => [:edit,:update,:show,:destroy,:reorder]
|
|
7
6
|
|
|
@@ -12,7 +11,7 @@ class Spud::Admin::MenuItemsController < Spud::Admin::CmsController
|
|
|
12
11
|
end
|
|
13
12
|
|
|
14
13
|
def new
|
|
15
|
-
add_breadcrumb "New", :
|
|
14
|
+
add_breadcrumb "New", :new_admin_page_path
|
|
16
15
|
|
|
17
16
|
@menu_item = @menu.spud_menu_items.new
|
|
18
17
|
respond_with @menu_item
|
|
@@ -20,7 +19,7 @@ class Spud::Admin::MenuItemsController < Spud::Admin::CmsController
|
|
|
20
19
|
|
|
21
20
|
def create
|
|
22
21
|
|
|
23
|
-
add_breadcrumb "New", :
|
|
22
|
+
add_breadcrumb "New", :new_admin_page_path
|
|
24
23
|
@menu_item = SpudMenuItem.new(params[:spud_menu_item])
|
|
25
24
|
@menu_item.spud_menu_id = @menu.id
|
|
26
25
|
if params[:spud_menu_item][:parent_id].blank?
|
|
@@ -42,11 +41,11 @@ class Spud::Admin::MenuItemsController < Spud::Admin::CmsController
|
|
|
42
41
|
|
|
43
42
|
|
|
44
43
|
|
|
45
|
-
respond_with @menu_item,:location =>
|
|
44
|
+
respond_with @menu_item,:location => admin_menu_menu_items_url
|
|
46
45
|
end
|
|
47
46
|
|
|
48
47
|
def edit
|
|
49
|
-
add_breadcrumb "Edit #{@menu_item.name}", :
|
|
48
|
+
add_breadcrumb "Edit #{@menu_item.name}", :edit_admin_menu_menu_item_path
|
|
50
49
|
if @menu_item.parent_type == "SpudMenu"
|
|
51
50
|
@menu_item.parent_id = nil
|
|
52
51
|
end
|
|
@@ -55,7 +54,7 @@ class Spud::Admin::MenuItemsController < Spud::Admin::CmsController
|
|
|
55
54
|
|
|
56
55
|
def update
|
|
57
56
|
|
|
58
|
-
add_breadcrumb "Edit #{@menu_item.name}", :
|
|
57
|
+
add_breadcrumb "Edit #{@menu_item.name}", :edit_admin_menu_menu_item_path
|
|
59
58
|
if params[:spud_menu_item][:parent_id].blank?
|
|
60
59
|
params[:spud_menu_item][:parent_type] = "SpudMenu"
|
|
61
60
|
params[:spud_menu_item][:parent_id] = @menu.id
|
|
@@ -66,14 +65,14 @@ class Spud::Admin::MenuItemsController < Spud::Admin::CmsController
|
|
|
66
65
|
@menu_item.spud_menu_id = @menu.id
|
|
67
66
|
flash[:notice] = "Menu saved successfully!" if @menu_item.save
|
|
68
67
|
|
|
69
|
-
respond_with @menu_item,:location =>
|
|
68
|
+
respond_with @menu_item,:location => admin_menu_menu_items_url
|
|
70
69
|
end
|
|
71
70
|
|
|
72
71
|
def destroy
|
|
73
72
|
|
|
74
73
|
flash[:notice] = "Menu Item removed!" if @menu_item.destroy
|
|
75
74
|
|
|
76
|
-
respond_with @menu_item,:location =>
|
|
75
|
+
respond_with @menu_item,:location => admin_menu_menu_items_url
|
|
77
76
|
end
|
|
78
77
|
|
|
79
78
|
def reorder
|
|
@@ -92,19 +91,19 @@ private
|
|
|
92
91
|
|
|
93
92
|
if @menu.blank?
|
|
94
93
|
flash[:error] = "Menu not found!"
|
|
95
|
-
redirect_to
|
|
94
|
+
redirect_to admin_menus_url() and return false
|
|
96
95
|
elsif Spud::Core.multisite_mode_enabled && @menu.site_id != session[:admin_site]
|
|
97
96
|
flash[:warning] = "Site Context Changed. The menu you were viewing is not associated with the current site. Redirected back to menu selections."
|
|
98
|
-
redirect_to
|
|
97
|
+
redirect_to admin_menus_url() and return false
|
|
99
98
|
end
|
|
100
|
-
add_breadcrumb "#{@menu.name}", :
|
|
99
|
+
add_breadcrumb "#{@menu.name}", :admin_menu_menu_items_path
|
|
101
100
|
end
|
|
102
101
|
|
|
103
102
|
def load_menu_item
|
|
104
103
|
@menu_item = SpudMenuItem.where(:id =>params[:id]).first
|
|
105
104
|
if @menu_item.blank?
|
|
106
105
|
flash[:error] = "Menu Item not found!"
|
|
107
|
-
redirect_to
|
|
106
|
+
redirect_to admin_menu_menu_items_url() and return false
|
|
108
107
|
end
|
|
109
108
|
end
|
|
110
109
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
class
|
|
2
|
-
layout 'spud/admin/detail'
|
|
1
|
+
class Admin::MenusController < Admin::ApplicationController
|
|
3
2
|
belongs_to_spud_app :menus
|
|
4
|
-
add_breadcrumb "Menus", :
|
|
3
|
+
add_breadcrumb "Menus", :admin_menus_path
|
|
5
4
|
before_filter :load_menu,:only => [:edit,:update,:show,:destroy]
|
|
6
5
|
|
|
7
6
|
def index
|
|
@@ -11,34 +10,34 @@ class Spud::Admin::MenusController < Spud::Admin::CmsController
|
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
def new
|
|
14
|
-
add_breadcrumb "New", :
|
|
13
|
+
add_breadcrumb "New", :new_admin_menu_path
|
|
15
14
|
@menu = SpudMenu.new
|
|
16
15
|
respond_with @menu
|
|
17
16
|
end
|
|
18
17
|
|
|
19
18
|
def create
|
|
20
|
-
add_breadcrumb "New", :
|
|
19
|
+
add_breadcrumb "New", :new_admin_menu_path
|
|
21
20
|
@menu = SpudMenu.new(params[:spud_menu])
|
|
22
21
|
@menu.site_id = session[:admin_site]
|
|
23
22
|
flash[:notice] = "New menu created" if @menu.save
|
|
24
|
-
respond_with @menu,:location => @menu.id != nil ?
|
|
23
|
+
respond_with @menu,:location => @menu.id != nil ? admin_menu_menu_items_url(:menu_id => @menu.id) : admin_menus_url
|
|
25
24
|
end
|
|
26
25
|
|
|
27
26
|
def edit
|
|
28
|
-
add_breadcrumb "Edit #{@menu.name}", :
|
|
27
|
+
add_breadcrumb "Edit #{@menu.name}", :edit_admin_menu_path
|
|
29
28
|
respond_with @menu
|
|
30
29
|
end
|
|
31
30
|
|
|
32
31
|
def update
|
|
33
|
-
add_breadcrumb "Edit #{@menu.name}", :
|
|
32
|
+
add_breadcrumb "Edit #{@menu.name}", :edit_admin_menu_path
|
|
34
33
|
|
|
35
34
|
flash[:notice] = "Menu saved successfully" if @menu.update_attributes(params[:spud_menu])
|
|
36
|
-
respond_with @menu,:location =>
|
|
35
|
+
respond_with @menu,:location => admin_menu_menu_items_url(:menu_id => @menu.id)
|
|
37
36
|
end
|
|
38
37
|
|
|
39
38
|
def destroy
|
|
40
39
|
flash[:notice] = "Menu removed!" if @menu.destroy
|
|
41
|
-
respond_with @menu,:location =>
|
|
40
|
+
respond_with @menu,:location => admin_menus_url
|
|
42
41
|
end
|
|
43
42
|
|
|
44
43
|
private
|
|
@@ -46,10 +45,10 @@ private
|
|
|
46
45
|
@menu = SpudMenu.where(:id => params[:id]).first
|
|
47
46
|
if @menu.blank?
|
|
48
47
|
flash[:error] = "Menu not found!"
|
|
49
|
-
redirect_to
|
|
48
|
+
redirect_to admin_menus_url() and return false
|
|
50
49
|
elsif Spud::Core.multisite_mode_enabled && @menu.site_id != session[:admin_site]
|
|
51
50
|
flash[:warning] = "Site Context Changed. The menu you were viewing is not associated with the current site. Redirected back to menu selections."
|
|
52
|
-
redirect_to
|
|
51
|
+
redirect_to admin_menus_url() and return false
|
|
53
52
|
end
|
|
54
53
|
end
|
|
55
54
|
end
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
class
|
|
2
|
-
|
|
3
|
-
add_breadcrumb "Pages", :spud_admin_pages_path
|
|
1
|
+
class Admin::PagesController < Admin::ApplicationController
|
|
2
|
+
add_breadcrumb "Pages", :admin_pages_path
|
|
4
3
|
belongs_to_spud_app :pages
|
|
5
4
|
before_filter :load_page,:only => [:edit,:update,:show,:destroy]
|
|
6
5
|
|
|
@@ -24,7 +23,7 @@ class Spud::Admin::PagesController < Spud::Admin::CmsController
|
|
|
24
23
|
end
|
|
25
24
|
|
|
26
25
|
def new
|
|
27
|
-
add_breadcrumb "New", :
|
|
26
|
+
add_breadcrumb "New", :new_admin_page_path
|
|
28
27
|
|
|
29
28
|
layouts = Spud::Cms::Engine.template_parser.layouts(Spud::Core.site_config_for_id(session[:admin_site] || 0)[:short_name])
|
|
30
29
|
layout, layout_info = layouts.select{|k,v| v[:default]}.flatten
|
|
@@ -46,12 +45,12 @@ class Spud::Admin::PagesController < Spud::Admin::CmsController
|
|
|
46
45
|
return
|
|
47
46
|
end
|
|
48
47
|
flash[:notice] = "Page Saved successfully" if @page.save
|
|
49
|
-
respond_with @page,:location =>
|
|
48
|
+
respond_with @page,:location => admin_pages_url
|
|
50
49
|
end
|
|
51
50
|
|
|
52
51
|
def edit
|
|
53
|
-
add_breadcrumb "#{@page.name}", :
|
|
54
|
-
add_breadcrumb "Edit", :
|
|
52
|
+
add_breadcrumb "#{@page.name}", :admin_page_path
|
|
53
|
+
add_breadcrumb "Edit", :edit_admin_page_path
|
|
55
54
|
|
|
56
55
|
layouts = Spud::Cms::Engine.template_parser.layouts(Spud::Core.site_config_for_id(session[:admin_site] || 0)[:short_name])
|
|
57
56
|
layout, layout_info = layouts.select{|k,v| k == @page.layout}.flatten if @page.layout.blank? == false
|
|
@@ -78,7 +77,7 @@ class Spud::Admin::PagesController < Spud::Admin::CmsController
|
|
|
78
77
|
end
|
|
79
78
|
if @page.save
|
|
80
79
|
flash[:notice] = "Page updated successfully!"
|
|
81
|
-
redirect_to
|
|
80
|
+
redirect_to admin_pages_url() and return
|
|
82
81
|
else
|
|
83
82
|
flash[:error] = "There was an error saving this page"
|
|
84
83
|
render :action => "edit"
|
|
@@ -102,7 +101,7 @@ class Spud::Admin::PagesController < Spud::Admin::CmsController
|
|
|
102
101
|
end
|
|
103
102
|
respond_to do |format|
|
|
104
103
|
format.js {render :status => status}
|
|
105
|
-
format.html { redirect_to
|
|
104
|
+
format.html { redirect_to admin_pages_url()}
|
|
106
105
|
end
|
|
107
106
|
end
|
|
108
107
|
|
|
@@ -159,7 +158,7 @@ class Spud::Admin::PagesController < Spud::Admin::CmsController
|
|
|
159
158
|
end
|
|
160
159
|
end
|
|
161
160
|
end
|
|
162
|
-
redirect_to
|
|
161
|
+
redirect_to admin_pages_url
|
|
163
162
|
end
|
|
164
163
|
|
|
165
164
|
|
|
@@ -169,10 +168,10 @@ private
|
|
|
169
168
|
@page = SpudPage.where(:id => params[:id]).includes(:spud_page_partials).first
|
|
170
169
|
if @page.blank?
|
|
171
170
|
flash[:error] = "Page not found!"
|
|
172
|
-
redirect_to
|
|
171
|
+
redirect_to admin_pages_url() and return false
|
|
173
172
|
elsif Spud::Core.multisite_mode_enabled && @page.site_id != session[:admin_site]
|
|
174
173
|
flash[:warning] = "Site Context Changed. The page you were viewing is not associated with the current site. Redirected back to page selections."
|
|
175
|
-
redirect_to
|
|
174
|
+
redirect_to admin_pages_url() and return false
|
|
176
175
|
end
|
|
177
176
|
return true
|
|
178
177
|
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
class
|
|
1
|
+
class Admin::SnippetsController < Admin::ApplicationController
|
|
2
2
|
belongs_to_spud_app :snippets
|
|
3
|
-
|
|
4
|
-
add_breadcrumb "Snippets", :spud_admin_snippets_url
|
|
3
|
+
add_breadcrumb "Snippets", :admin_snippets_url
|
|
5
4
|
|
|
6
5
|
before_filter :load_snippet, :only => [:show, :edit, :update, :destroy]
|
|
7
6
|
|
|
@@ -9,41 +8,40 @@ class Spud::Admin::SnippetsController < Spud::Admin::ApplicationController
|
|
|
9
8
|
|
|
10
9
|
def index
|
|
11
10
|
@snippets = SpudSnippet.site(session[:admin_site]).order(:name).paginate :page => params[:page]
|
|
12
|
-
|
|
13
11
|
respond_with @snippets
|
|
14
12
|
end
|
|
15
13
|
|
|
16
14
|
def new
|
|
17
|
-
add_breadcrumb "New", :
|
|
15
|
+
add_breadcrumb "New", :new_admin_snippet_url
|
|
18
16
|
@snippet = SpudSnippet.new
|
|
19
17
|
respond_with @snippet
|
|
20
18
|
end
|
|
21
19
|
|
|
22
20
|
def create
|
|
23
|
-
add_breadcrumb "New", :
|
|
21
|
+
add_breadcrumb "New", :new_admin_snippet_url
|
|
24
22
|
@snippet = SpudSnippet.new(params[:spud_snippet])
|
|
25
23
|
@snippet.site_id = session[:admin_site]
|
|
26
24
|
|
|
27
25
|
@snippet.save
|
|
28
26
|
|
|
29
|
-
respond_with @snippet, :location =>
|
|
27
|
+
respond_with @snippet, :location => admin_snippets_url
|
|
30
28
|
end
|
|
31
29
|
|
|
32
30
|
def edit
|
|
33
|
-
add_breadcrumb "Edit", :
|
|
31
|
+
add_breadcrumb "Edit", :edit_admin_snippet_url
|
|
34
32
|
|
|
35
33
|
respond_with @snippet
|
|
36
34
|
end
|
|
37
35
|
|
|
38
36
|
def update
|
|
39
|
-
add_breadcrumb "Edit", :
|
|
37
|
+
add_breadcrumb "Edit", :edit_admin_snippet_url
|
|
40
38
|
flash[:notice] = "Snippet saved successfully!" if @snippet.update_attributes(params[:spud_snippet])
|
|
41
|
-
respond_with @snippet, :location =>
|
|
39
|
+
respond_with @snippet, :location => admin_snippets_url
|
|
42
40
|
end
|
|
43
41
|
|
|
44
42
|
def destroy
|
|
45
43
|
flash[:notice] = "Snippet removed!" if @snippet.destroy
|
|
46
|
-
respond_with @snippet,:location =>
|
|
44
|
+
respond_with @snippet,:location => admin_snippets_url
|
|
47
45
|
end
|
|
48
46
|
|
|
49
47
|
|
|
@@ -52,10 +50,10 @@ private
|
|
|
52
50
|
@snippet = SpudSnippet.where(:id => params[:id]).first
|
|
53
51
|
if @snippet.blank?
|
|
54
52
|
flash[:error] = "Snippet does not exist!"
|
|
55
|
-
redirect_to
|
|
53
|
+
redirect_to admin_snippets_url and return false
|
|
56
54
|
elsif Spud::Core.multisite_mode_enabled && @snippet.site_id != session[:admin_site]
|
|
57
55
|
flash[:warning] = "This snippet is for a different site"
|
|
58
|
-
redirect_to
|
|
56
|
+
redirect_to admin_snippets_url and return false
|
|
59
57
|
end
|
|
60
58
|
end
|
|
61
59
|
end
|
|
@@ -13,13 +13,13 @@ class PageSweeper < ActionController::Caching::Sweeper
|
|
|
13
13
|
|
|
14
14
|
def after_save(record)
|
|
15
15
|
expire_cache_for(record)
|
|
16
|
-
expire_page
|
|
16
|
+
expire_page cms_sitemap_path(:format => :xml)
|
|
17
17
|
expire_page spud_sitemap_path(:format => :xml)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def after_destroy(record)
|
|
21
21
|
expire_cache_for(record)
|
|
22
|
-
expire_page
|
|
22
|
+
expire_page cms_sitemap_path
|
|
23
23
|
expire_page spud_sitemap_path
|
|
24
24
|
end
|
|
25
25
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<div class="page_row" menu_item_id="<%=menu_item.id%>">
|
|
2
2
|
|
|
3
|
-
<span class="row_meta"><%=prefix if defined? prefix%><%=link_to menu_item.name,
|
|
3
|
+
<span class="row_meta"><%=prefix if defined? prefix%><%=link_to menu_item.name,edit_admin_menu_menu_item_path(:id => menu_item.id)%></span>
|
|
4
4
|
|
|
5
|
-
<span class="edit_controls"><%=link_to "Edit",
|
|
5
|
+
<span class="edit_controls"><%=link_to "Edit",edit_admin_menu_menu_item_path(:id => menu_item.id), :title => "Edit Menu Item",:class => 'btn'%> <%=link_to "Remove",admin_menu_menu_item_path(:id => menu_item.id),:method => :delete,:class => 'btn btn-danger',:confirm => "Are you sure you want to remove this menu item?"%></span>
|
|
6
6
|
<br style="clear:both;"/>
|
|
7
7
|
</div>
|
|
8
8
|
<ul class="menu_list subitem sortable connectedSortable">
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
<%=form_for @menu_item,:url => admin_menu_menu_item_path(:id => @menu_item.id),:html=>{:class=>"form-horizontal"} do |f|%>
|
|
5
|
+
<%=render :partial => "form",:locals => {:f => f}%>
|
|
6
|
+
<div class="form-actions">
|
|
7
|
+
<%=f.submit "Save Menu Item", :class=>"btn btn-primary"%> or <%=link_to "cancel",admin_menu_menu_items_path,:class => "btn"%>
|
|
8
|
+
</div>
|
|
9
|
+
<%end%>
|
|
10
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%=content_for :data_controls do%>
|
|
2
|
-
<%=link_to "New Menu Item",
|
|
2
|
+
<%=link_to "New Menu Item",new_admin_menu_menu_item_path(),:class => "btn btn-primary",:title => "New Menu Item"%>
|
|
3
3
|
<%end%>
|
|
4
4
|
<%=content_for :detail do%>
|
|
5
5
|
<ul id="root_menu_list" class="menu_list page_list sortable connectedSortable">
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
<%=form_for @menu_item,:url => admin_menu_menu_items_path,:html=>{:class=>"form-horizontal"} do |f|%>
|
|
5
|
+
<%=render :partial => "form",:locals => {:f => f}%>
|
|
6
|
+
<div class="form-actions">
|
|
7
|
+
<%=f.submit "Create Menu Item", :class=>"btn btn-primary"%> or <%=link_to "cancel",admin_menu_menu_items_path,:class => "btn"%>
|
|
8
|
+
</div>
|
|
9
|
+
<%end%>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
<%=form_for @menu,:url =>
|
|
4
|
+
<%=form_for @menu,:url => admin_menu_path(:id => @menu.id),:html=>{:class=>"form-horizontal"} do |f|%>
|
|
5
5
|
<%=render :partial => "form",:locals => {:f => f}%>
|
|
6
6
|
<div class="form-actions">
|
|
7
|
-
<%=f.submit "Save Menu", :class=>"btn btn-primary"%> or <%=link_to "cancel",
|
|
7
|
+
<%=f.submit "Save Menu", :class=>"btn btn-primary"%> or <%=link_to "cancel",admin_menus_path,:class => "btn"%>
|
|
8
8
|
</div>
|
|
9
9
|
|
|
10
10
|
<%end%>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<%=content_for :data_controls do%>
|
|
2
|
+
<%=link_to "New Menu",new_admin_menu_path(),:class => "btn btn-primary",:title => "New Menu"%>
|
|
3
|
+
<%end%>
|
|
4
|
+
<%=content_for :detail do%>
|
|
5
|
+
<div class="page_list">
|
|
6
|
+
<%@menus.each do |menu|%>
|
|
7
|
+
<div class="page_row">
|
|
8
|
+
|
|
9
|
+
<span class="row_meta"><%=link_to menu.name,admin_menu_menu_items_path(:menu_id => menu.id)%></span>
|
|
10
|
+
|
|
11
|
+
<span class="edit_controls">
|
|
12
|
+
<%=link_to "Edit",edit_admin_menu_path(:id => menu.id),:class => 'btn'%>
|
|
13
|
+
<%=link_to "Remove",admin_menu_path(:id => menu.id),:method => :delete,:class => 'btn btn-danger',:confirm => "Are you sure you want to remove this menu and all items associated with it?"%>
|
|
14
|
+
</span>
|
|
15
|
+
<br style="clear:both;"/>
|
|
16
|
+
</div>
|
|
17
|
+
<%end%>
|
|
18
|
+
<%=will_paginate @menus%>
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<%end%>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<%=form_for @menu,:url =>
|
|
1
|
+
<%=form_for @menu,:url => admin_menus_path,:html=>{:class=>"form-horizontal"} do |f|%>
|
|
2
2
|
<%=render :partial => "form",:locals => {:f => f}%>
|
|
3
3
|
<div class="form-actions">
|
|
4
|
-
<%=f.submit "Create Menu", :class=>"btn btn-primary"%> or <%=link_to "cancel",
|
|
4
|
+
<%=f.submit "Create Menu", :class=>"btn btn-primary"%> or <%=link_to "cancel",admin_menus_path,:class => "btn"%>
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
7
|
<%end%>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
<%=f.label :layout, "Template", :class=>"control-label"%>
|
|
28
28
|
<div class="controls">
|
|
29
|
-
<%=f.select :layout, options_for_select(layout_options,@page.layout),{},{:title => "", 'data-source' =>
|
|
29
|
+
<%=f.select :layout, options_for_select(layout_options,@page.layout),{},{:title => "", 'data-source' => page_parts_admin_pages_path(:page => @page.id) }%>
|
|
30
30
|
<span class="help-inline">Use this to control the layout template to be used for this page if they are available.</span>
|
|
31
31
|
</div>
|
|
32
32
|
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<div class="page_row">
|
|
2
|
+
|
|
3
|
+
<span class="row_meta"><%=prefix if defined? prefix%><%=link_to page.name,edit_admin_page_path(:id => page.id)%></span>
|
|
4
|
+
|
|
5
|
+
<span class="edit_controls"><%=link_to "Preview",admin_page_path(:id => page.id), :title => "Preview",:class => 'btn'%> <%=link_to "Remove",admin_page_path(:id => page.id),:method => :delete,:class => 'btn btn-danger',:confirm => "Are you sure you want to remove this page?"%></span>
|
|
6
|
+
<br style="clear:both;"/>
|
|
7
|
+
</div>
|
|
8
|
+
<%if !page.spud_pages.all.blank?%>
|
|
9
|
+
|
|
10
|
+
<div class="left_guide">
|
|
11
|
+
|
|
12
|
+
<%page.spud_pages.each do |spud_page|%>
|
|
13
|
+
<%=render :partial => 'page_row',:locals => {:page => spud_page}%>
|
|
14
|
+
<%end%>
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<%end%>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<%=form_for @page,:url =>
|
|
1
|
+
<%=form_for @page,:url => admin_page_path(:id => @page.id),:html=>{:class=>"form-horizontal page_form",:target => "report" } do |f|%>
|
|
2
2
|
<%=render :partial => "form",:locals => {:f => f}%>
|
|
3
3
|
<div class="form-actions">
|
|
4
|
-
<%=f.submit "Save Page", :class=>"btn btn-primary btn-save",:onclick => "savePage();"%> <%=f.submit "Preview", :class=>"btn btn-info btn-preview"%> or <%=link_to "cancel",
|
|
4
|
+
<%=f.submit "Save Page", :class=>"btn btn-primary btn-save",:onclick => "savePage();"%> <%=f.submit "Preview", :class=>"btn btn-info btn-preview"%> or <%=link_to "cancel",admin_pages_path,:class => "btn"%>
|
|
5
5
|
</div>
|
|
6
6
|
<%end%>
|
|
7
7
|
<br />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%=content_for :data_controls do%>
|
|
2
|
-
<%=link_to "New Page",
|
|
2
|
+
<%=link_to "New Page",new_admin_page_path(),:class => "btn btn-primary",:title => "New Page"%> <%=link_to "Clear Cache",clear_admin_pages_path(),:class => "btn btn-warning",:title => "Clear Page Cache" if Spud::Cms.cache_mode %>
|
|
3
3
|
<%end%>
|
|
4
4
|
|
|
5
5
|
<%=content_for :detail do%>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<%=form_for @page,:url =>
|
|
1
|
+
<%=form_for @page,:url => admin_pages_path(),:html=>{:class=>"form-horizontal page_form"} do |f|%>
|
|
2
2
|
<%=render :partial => "form",:locals => {:f => f}%>
|
|
3
3
|
<div class="form-actions">
|
|
4
|
-
<%=f.submit "Create Page", :class=>"btn btn-primary form-btn btn-save","data-loading-text"=>"Saving..."%> <%=f.submit "Preview", :class=>"btn btn-primary btn-preview"%> or <%=link_to "cancel",
|
|
4
|
+
<%=f.submit "Create Page", :class=>"btn btn-primary form-btn btn-save","data-loading-text"=>"Saving..."%> <%=f.submit "Preview", :class=>"btn btn-primary btn-preview"%> or <%=link_to "cancel",admin_pages_path,:class => "btn"%>
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
7
|
<%end%>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<%=form_for @snippet,:url => admin_snippet_path(@snippet),:html=>{:class=>"form-horizontal"} do |f|%>
|
|
2
|
+
<%=render :partial => "form",:locals => {:f => f}%>
|
|
3
|
+
<div class="form-actions">
|
|
4
|
+
<%=f.submit "Save Snippet", :class=>"btn btn-primary"%> or <%=link_to "cancel",admin_snippets_path,:class => "btn"%>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<%end%>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<%=content_for :data_controls do%>
|
|
2
|
+
<%=link_to "New Snippet",new_admin_snippet_path(),:class => "btn btn-primary",:title => "New Snippet"%>
|
|
3
|
+
<%end%>
|
|
4
|
+
<%=content_for :detail do%>
|
|
5
|
+
<div class="page_list">
|
|
6
|
+
<%@snippets.each do |snippet|%>
|
|
7
|
+
<div class="page_row">
|
|
8
|
+
|
|
9
|
+
<span class="row_meta"><%=link_to snippet.name,edit_admin_snippet_path(:id => snippet.id)%></span>
|
|
10
|
+
|
|
11
|
+
<span class="edit_controls">
|
|
12
|
+
|
|
13
|
+
<%=link_to "Remove",admin_snippet_path(:id => snippet.id),:method => :delete,:class => 'btn btn-danger',:confirm => "Are you sure you want to remove this snippet?"%>
|
|
14
|
+
</span>
|
|
15
|
+
<br style="clear:both;"/>
|
|
16
|
+
</div>
|
|
17
|
+
<%end%>
|
|
18
|
+
<%=will_paginate @snippets%>
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<%end%>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<%=form_for @snippet,:url =>
|
|
1
|
+
<%=form_for @snippet,:url => admin_snippets_path,:html=>{:class=>"form-horizontal"} do |f|%>
|
|
2
2
|
<%=render :partial => "form",:locals => {:f => f}%>
|
|
3
3
|
<div class="form-actions">
|
|
4
|
-
<%=f.submit "Create Snippet", :class=>"btn btn-primary"%> or <%=link_to "cancel",
|
|
4
|
+
<%=f.submit "Create Snippet", :class=>"btn btn-primary"%> or <%=link_to "cancel",admin_snippets_path,:class => "btn"%>
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
7
|
<%end%>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
<%=form_for @template,:url => admin_template_path(:id => @template.id),:html=>{:class=>"form-horizontal"} do |f|%>
|
|
3
|
+
<%=render :partial => "form",:locals => {:f => f}%>
|
|
4
|
+
<div class="form-actions">
|
|
5
|
+
<%=f.submit "Save Template", :class=>"btn btn-primary"%> or <%=link_to "cancel",admin_templates_path,:class => "btn"%>
|
|
6
|
+
</div>
|
|
7
|
+
<%end%>
|
|
8
|
+
|
|
9
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<%=content_for :data_controls do%>
|
|
2
|
+
<%=link_to "New Template",new_admin_template_path(),:class => "btn btn-primary",:title => "New Template"%>
|
|
3
|
+
<%end%>
|
|
4
|
+
<%=content_for :detail do%>
|
|
5
|
+
<div class="page_list">
|
|
6
|
+
<%@templates.each do |template|%>
|
|
7
|
+
<div class="page_row">
|
|
8
|
+
<span class="row_meta"><%=link_to template.name,edit_admin_template_path(:id => template.id)%></span>
|
|
9
|
+
|
|
10
|
+
<span class="edit_controls"><%=link_to "Edit",edit_admin_template_path(:id => template.id), :title => "Edit Template",:class => 'btn'%> <%=link_to "Remove",admin_template_path(:id => template.id),:method => :delete,:class => 'btn btn-danger',:confirm => "Are you sure you want to remove this template?"%></span>
|
|
11
|
+
<br style="clear:both;"/>
|
|
12
|
+
</div>
|
|
13
|
+
<%end%>
|
|
14
|
+
<%=will_paginate @templates%>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<%end%>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
<%=form_for @template,:url =>
|
|
4
|
+
<%=form_for @template,:url => admin_templates_path(),:html=>{:class=>"form-horizontal"} do |f|%>
|
|
5
5
|
<%=render :partial => "form",:locals => {:f => f}%>
|
|
6
6
|
<div class="form-actions">
|
|
7
|
-
<%=f.submit "Create Template", :class=>"btn btn-primary"%> or <%=link_to "cancel",
|
|
7
|
+
<%=f.submit "Create Template", :class=>"btn btn-primary"%> or <%=link_to "cancel",admin_templates_path,:class => "btn"%>
|
|
8
8
|
</div>
|
|
9
9
|
<%end%>
|
|
10
10
|
|