spud_cms 0.4.8 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +40 -0
- data/app/controllers/pages_controller.rb +5 -0
- data/app/controllers/spud/admin/pages_controller.rb +4 -4
- data/app/helpers/spud/cms/application_helper.rb +23 -3
- data/app/models/page_sweeper.rb +18 -1
- data/app/models/spud_page.rb +45 -4
- data/app/views/pages/show.html.erb +3 -1
- data/config/routes.rb +5 -1
- data/db/migrate/20120101192412_create_spud_pages.rb +19 -0
- data/db/migrate/20120101193138_create_spud_menus.rb +10 -0
- data/db/migrate/20120101193255_create_spud_menu_items.rb +17 -0
- data/db/migrate/20120101194124_create_spud_templates.rb +11 -0
- data/db/migrate/20120103034659_create_spud_page_partials.rb +13 -0
- data/db/migrate/20120104194032_add_visibility_to_spud_pages.rb +6 -0
- data/db/migrate/20120107181337_add_menu_name_to_spud_menu_items.rb +5 -0
- data/db/migrate/20120111134754_add_use_custom_url_name_to_spud_pages.rb +5 -0
- data/db/migrate/20120118141852_add_notes_to_spud_pages.rb +5 -0
- data/db/migrate/20120126232428_add_menu_id_to_spud_menu_items.rb +7 -0
- data/db/migrate/20120128163601_add_classes_to_spud_menu_items.rb +6 -0
- data/lib/spud_cms/engine.rb +11 -1
- data/lib/spud_cms/page_route.rb +3 -0
- data/lib/spud_cms/version.rb +5 -0
- data/lib/spud_cms.rb +2 -1
- data/lib/tasks/spud_cms_tasks.rake +4 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -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/{config → test/dummy/config}/application.rb +18 -7
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +15 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -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 +3 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/migrate/20120307002859_create_spud_admin_permissions.spud_core.rb +12 -0
- data/test/dummy/db/migrate/20120307002860_create_spud_users.spud_core.rb +30 -0
- data/test/dummy/db/migrate/20120307003559_create_spud_permalinks.spud_permalinks.rb +12 -0
- data/test/dummy/db/schema.rb +124 -0
- data/test/dummy/log/development.log +437 -0
- data/test/dummy/log/test.log +2280 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/spud_cms_test.rb +7 -0
- data/test/test_helper.rb +10 -0
- metadata +206 -18
- data/README.markdown +0 -71
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</html>
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
+
require "rails/test_help"
|
6
|
+
|
7
|
+
Rails.backtrace_cleaner.remove_silencers!
|
8
|
+
|
9
|
+
# Load support files
|
10
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spud_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,44 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-03-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: &70182273335660 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.2.1
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70182273335660
|
14
25
|
- !ruby/object:Gem::Dependency
|
15
26
|
name: spud_core
|
16
|
-
requirement: &
|
27
|
+
requirement: &70182273335160 !ruby/object:Gem::Requirement
|
17
28
|
none: false
|
18
29
|
requirements:
|
19
|
-
- -
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.7.2
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70182273335160
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: spud_permalinks
|
38
|
+
requirement: &70182273334700 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
20
42
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
43
|
+
version: 0.0.1
|
22
44
|
type: :runtime
|
23
45
|
prerelease: false
|
24
|
-
version_requirements: *
|
46
|
+
version_requirements: *70182273334700
|
25
47
|
- !ruby/object:Gem::Dependency
|
26
48
|
name: codemirror-rails
|
27
|
-
requirement: &
|
49
|
+
requirement: &70182273334320 !ruby/object:Gem::Requirement
|
28
50
|
none: false
|
29
51
|
requirements:
|
30
52
|
- - ! '>='
|
@@ -32,13 +54,84 @@ dependencies:
|
|
32
54
|
version: '0'
|
33
55
|
type: :runtime
|
34
56
|
prerelease: false
|
35
|
-
version_requirements: *
|
36
|
-
|
37
|
-
|
57
|
+
version_requirements: *70182273334320
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: mysql2
|
60
|
+
requirement: &70182273333860 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *70182273333860
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: &70182273333440 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70182273333440
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: rspec-rails
|
82
|
+
requirement: &70182273333020 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *70182273333020
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: factory_girl
|
93
|
+
requirement: &70182273332520 !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - =
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: 2.5.0
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *70182273332520
|
102
|
+
- !ruby/object:Gem::Dependency
|
103
|
+
name: mocha
|
104
|
+
requirement: &70182273332020 !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - =
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.10.3
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: *70182273332020
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: database_cleaner
|
115
|
+
requirement: &70182273331560 !ruby/object:Gem::Requirement
|
116
|
+
none: false
|
117
|
+
requirements:
|
118
|
+
- - =
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: 0.7.1
|
121
|
+
type: :development
|
122
|
+
prerelease: false
|
123
|
+
version_requirements: *70182273331560
|
124
|
+
description: Spud CMS is a full-featured light weight modular cms engine as a part
|
125
|
+
of the spud suite of rails gems. This particular gem comes with page management,
|
126
|
+
administrative dashboard, template management, menu management and more. It is also
|
127
|
+
capable of handling full-page caching as well as action-caching for even faster
|
128
|
+
performance. Add more modules like spud_blog, spud_inquiries, spud_events, or spud_media
|
129
|
+
for more features.
|
130
|
+
email:
|
131
|
+
- destes@redwindsw.com
|
38
132
|
executables: []
|
39
133
|
extensions: []
|
40
|
-
extra_rdoc_files:
|
41
|
-
- README.markdown
|
134
|
+
extra_rdoc_files: []
|
42
135
|
files:
|
43
136
|
- app/assets/images/spud/admin/menus_thumb.png
|
44
137
|
- app/assets/images/spud/admin/pages_thumb.png
|
@@ -81,15 +174,67 @@ files:
|
|
81
174
|
- app/views/spud/admin/templates/index.html.erb
|
82
175
|
- app/views/spud/admin/templates/new.html.erb
|
83
176
|
- app/views/spud/cms/sitemaps/show.xml.builder
|
84
|
-
- config/application.rb
|
85
177
|
- config/boot.rb
|
86
178
|
- config/routes.rb
|
87
|
-
-
|
179
|
+
- db/migrate/20120101192412_create_spud_pages.rb
|
180
|
+
- db/migrate/20120101193138_create_spud_menus.rb
|
181
|
+
- db/migrate/20120101193255_create_spud_menu_items.rb
|
182
|
+
- db/migrate/20120101194124_create_spud_templates.rb
|
183
|
+
- db/migrate/20120103034659_create_spud_page_partials.rb
|
184
|
+
- db/migrate/20120104194032_add_visibility_to_spud_pages.rb
|
185
|
+
- db/migrate/20120107181337_add_menu_name_to_spud_menu_items.rb
|
186
|
+
- db/migrate/20120111134754_add_use_custom_url_name_to_spud_pages.rb
|
187
|
+
- db/migrate/20120118141852_add_notes_to_spud_pages.rb
|
188
|
+
- db/migrate/20120126232428_add_menu_id_to_spud_menu_items.rb
|
189
|
+
- db/migrate/20120128163601_add_classes_to_spud_menu_items.rb
|
88
190
|
- lib/spud_cms/configuration.rb
|
89
191
|
- lib/spud_cms/engine.rb
|
192
|
+
- lib/spud_cms/page_route.rb
|
90
193
|
- lib/spud_cms/test_files.rb
|
91
|
-
-
|
92
|
-
|
194
|
+
- lib/spud_cms/version.rb
|
195
|
+
- lib/spud_cms.rb
|
196
|
+
- lib/tasks/spud_cms_tasks.rake
|
197
|
+
- MIT-LICENSE
|
198
|
+
- Rakefile
|
199
|
+
- README.rdoc
|
200
|
+
- test/dummy/app/assets/javascripts/application.js
|
201
|
+
- test/dummy/app/assets/stylesheets/application.css
|
202
|
+
- test/dummy/app/controllers/application_controller.rb
|
203
|
+
- test/dummy/app/helpers/application_helper.rb
|
204
|
+
- test/dummy/app/views/layouts/application.html.erb
|
205
|
+
- test/dummy/config/application.rb
|
206
|
+
- test/dummy/config/boot.rb
|
207
|
+
- test/dummy/config/database.yml
|
208
|
+
- test/dummy/config/environment.rb
|
209
|
+
- test/dummy/config/environments/development.rb
|
210
|
+
- test/dummy/config/environments/production.rb
|
211
|
+
- test/dummy/config/environments/test.rb
|
212
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
213
|
+
- test/dummy/config/initializers/inflections.rb
|
214
|
+
- test/dummy/config/initializers/mime_types.rb
|
215
|
+
- test/dummy/config/initializers/secret_token.rb
|
216
|
+
- test/dummy/config/initializers/session_store.rb
|
217
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
218
|
+
- test/dummy/config/locales/en.yml
|
219
|
+
- test/dummy/config/routes.rb
|
220
|
+
- test/dummy/config.ru
|
221
|
+
- test/dummy/db/migrate/20120307002859_create_spud_admin_permissions.spud_core.rb
|
222
|
+
- test/dummy/db/migrate/20120307002860_create_spud_users.spud_core.rb
|
223
|
+
- test/dummy/db/migrate/20120307003559_create_spud_permalinks.spud_permalinks.rb
|
224
|
+
- test/dummy/db/schema.rb
|
225
|
+
- test/dummy/log/development.log
|
226
|
+
- test/dummy/log/test.log
|
227
|
+
- test/dummy/public/404.html
|
228
|
+
- test/dummy/public/422.html
|
229
|
+
- test/dummy/public/500.html
|
230
|
+
- test/dummy/public/favicon.ico
|
231
|
+
- test/dummy/Rakefile
|
232
|
+
- test/dummy/README.rdoc
|
233
|
+
- test/dummy/script/rails
|
234
|
+
- test/integration/navigation_test.rb
|
235
|
+
- test/spud_cms_test.rb
|
236
|
+
- test/test_helper.rb
|
237
|
+
homepage: http://www.github.com/davydotcom/spud_cms
|
93
238
|
licenses: []
|
94
239
|
post_install_message:
|
95
240
|
rdoc_options: []
|
@@ -101,16 +246,59 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
101
246
|
- - ! '>='
|
102
247
|
- !ruby/object:Gem::Version
|
103
248
|
version: '0'
|
249
|
+
segments:
|
250
|
+
- 0
|
251
|
+
hash: 1115534449787478592
|
104
252
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
253
|
none: false
|
106
254
|
requirements:
|
107
255
|
- - ! '>='
|
108
256
|
- !ruby/object:Gem::Version
|
109
257
|
version: '0'
|
258
|
+
segments:
|
259
|
+
- 0
|
260
|
+
hash: 1115534449787478592
|
110
261
|
requirements: []
|
111
262
|
rubyforge_project:
|
112
263
|
rubygems_version: 1.8.15
|
113
264
|
signing_key:
|
114
265
|
specification_version: 3
|
115
|
-
summary:
|
116
|
-
test_files:
|
266
|
+
summary: Modular CMS Engine
|
267
|
+
test_files:
|
268
|
+
- test/dummy/app/assets/javascripts/application.js
|
269
|
+
- test/dummy/app/assets/stylesheets/application.css
|
270
|
+
- test/dummy/app/controllers/application_controller.rb
|
271
|
+
- test/dummy/app/helpers/application_helper.rb
|
272
|
+
- test/dummy/app/views/layouts/application.html.erb
|
273
|
+
- test/dummy/config/application.rb
|
274
|
+
- test/dummy/config/boot.rb
|
275
|
+
- test/dummy/config/database.yml
|
276
|
+
- test/dummy/config/environment.rb
|
277
|
+
- test/dummy/config/environments/development.rb
|
278
|
+
- test/dummy/config/environments/production.rb
|
279
|
+
- test/dummy/config/environments/test.rb
|
280
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
281
|
+
- test/dummy/config/initializers/inflections.rb
|
282
|
+
- test/dummy/config/initializers/mime_types.rb
|
283
|
+
- test/dummy/config/initializers/secret_token.rb
|
284
|
+
- test/dummy/config/initializers/session_store.rb
|
285
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
286
|
+
- test/dummy/config/locales/en.yml
|
287
|
+
- test/dummy/config/routes.rb
|
288
|
+
- test/dummy/config.ru
|
289
|
+
- test/dummy/db/migrate/20120307002859_create_spud_admin_permissions.spud_core.rb
|
290
|
+
- test/dummy/db/migrate/20120307002860_create_spud_users.spud_core.rb
|
291
|
+
- test/dummy/db/migrate/20120307003559_create_spud_permalinks.spud_permalinks.rb
|
292
|
+
- test/dummy/db/schema.rb
|
293
|
+
- test/dummy/log/development.log
|
294
|
+
- test/dummy/log/test.log
|
295
|
+
- test/dummy/public/404.html
|
296
|
+
- test/dummy/public/422.html
|
297
|
+
- test/dummy/public/500.html
|
298
|
+
- test/dummy/public/favicon.ico
|
299
|
+
- test/dummy/Rakefile
|
300
|
+
- test/dummy/README.rdoc
|
301
|
+
- test/dummy/script/rails
|
302
|
+
- test/integration/navigation_test.rb
|
303
|
+
- test/spud_cms_test.rb
|
304
|
+
- test/test_helper.rb
|
data/README.markdown
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
Spud CMS
|
2
|
-
========
|
3
|
-
|
4
|
-
Spud CMS is a CMS Engine designed to be robust, easy to use, and light weight.
|
5
|
-
NOTE: This project is still in its early infancy.
|
6
|
-
|
7
|
-
Installation/Usage
|
8
|
-
------------------
|
9
|
-
|
10
|
-
1. In your Gemfile add the following
|
11
|
-
|
12
|
-
gem 'spud_core', :git => "git://github.com/davydotcom/spud_core_admin.git"
|
13
|
-
gem 'spud_cms', :git => "git://github.com/davydotcom/spud_cms.git"
|
14
|
-
|
15
|
-
2. Run bundle install
|
16
|
-
3. Copy in database migrations to your new rails project
|
17
|
-
|
18
|
-
bundle exec rake spud_core:install:migrations
|
19
|
-
bundle exec rake spud_cms:install:migrations
|
20
|
-
rake db:migrate
|
21
|
-
|
22
|
-
4. run a rails server instance and point your browser to /spud/admin
|
23
|
-
|
24
|
-
Routing to the CMS Engine
|
25
|
-
--------------------------
|
26
|
-
Routing your home page to the CMS engine is fairly straight forward.
|
27
|
-
in your applications environment.rb file add a configure block as such
|
28
|
-
|
29
|
-
|
30
|
-
Spud::Cms.configure do |config|
|
31
|
-
config.menus_enabled = true
|
32
|
-
config.templates_enabled = false
|
33
|
-
config.root_page_name = "home"
|
34
|
-
end
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
Where "home" is the page name you wish to use.
|
39
|
-
|
40
|
-
Pages will default render to the 'application' layout of your application. You can change this by using templates to specify base layouts.
|
41
|
-
|
42
|
-
Using Menus
|
43
|
-
-----------
|
44
|
-
A lot of cms engines allow you to render your navigation links in a ul block by using your page tree structure. In a lot of cases this is insufficient as some sites have urls that redirect to pages outside of your cms. This is where menus come in. They can be built in the spud admin control panel.
|
45
|
-
In your application layout file or any erb template you can render a ul block like so
|
46
|
-
|
47
|
-
<%=sp_list_menu({:id => "navigation",:name => "Main"})%>
|
48
|
-
|
49
|
-
This will output a <ul id="navigation"></ul> block for the menu you created in admin named "Main"
|
50
|
-
|
51
|
-
|
52
|
-
Adding Your Own Engines
|
53
|
-
-----------------------
|
54
|
-
|
55
|
-
Creating a rails engine that ties into spud admin is fairly straight forward
|
56
|
-
In your new engine add spud_admin as a dependency and create an initializer inside your engine class as such:
|
57
|
-
|
58
|
-
initializer :admin do
|
59
|
-
Spud::Core.configure do |config|
|
60
|
-
config.admin_applications += [{:name => "Pages",:thumbnail => "spud/admin/pages_thumb.png",:url => "/spud/admin/pages",:order => 0}]
|
61
|
-
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
You can use the layouts provided with spud admin by using 'spud/admin/application' or 'spud/admin/detail' layouts
|
66
|
-
|
67
|
-
When creating controllers for the admin panel create them in the Spud::Admin Namespace and have them extend Spud::Admin::ApplicationController for automatic user authentication restrictions.
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|