spud_cms 0.8.13 → 0.8.14
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
CHANGED
@@ -18,8 +18,11 @@ Installation/Usage
|
|
18
18
|
bundle exec rake spud_core:install:migrations
|
19
19
|
bundle exec rake spud_cms:install:migrations
|
20
20
|
rake db:migrate
|
21
|
+
4. Change ApplicationController to inherit from Spud::ApplicationController instead of ActionController::Base
|
21
22
|
|
22
|
-
|
23
|
+
class ApplicationController < Spud::ApplicationController
|
24
|
+
|
25
|
+
5. run a rails server instance and point your browser to /spud/admin
|
23
26
|
|
24
27
|
Routing to the CMS Engine
|
25
28
|
--------------------------
|
@@ -5,10 +5,17 @@ class PagesController < ApplicationController
|
|
5
5
|
after_filter({:only => [:show]}) do |c|
|
6
6
|
return if !Spud::Cms.enable_full_page_caching
|
7
7
|
if @page && @page.is_private? == false
|
8
|
-
|
8
|
+
c.cache_page(nil, nil, false)
|
9
9
|
end
|
10
|
-
|
10
|
+
end
|
11
|
+
|
11
12
|
def show
|
13
|
+
# prevents 500 errors if a url like "/home.jpg" is hit
|
14
|
+
if request.format != :html
|
15
|
+
render_404
|
16
|
+
return
|
17
|
+
end
|
18
|
+
|
12
19
|
url_name = !params[:id].blank? ? params[:id] : Spud::Cms.root_page_name
|
13
20
|
|
14
21
|
# MultiSite Code Block
|
@@ -48,9 +55,10 @@ class PagesController < ApplicationController
|
|
48
55
|
# else
|
49
56
|
# return
|
50
57
|
# end
|
51
|
-
|
58
|
+
render_404
|
52
59
|
return
|
53
60
|
end
|
61
|
+
|
54
62
|
if @page.is_private?
|
55
63
|
if defined?(require_user) && require_user == false
|
56
64
|
logger.debug("responds to require user!")
|
@@ -67,18 +75,21 @@ class PagesController < ApplicationController
|
|
67
75
|
layout = cms_config[:default_page_layout] if !cms_config.blank? && !cms_config[:default_page_layout].blank?
|
68
76
|
end
|
69
77
|
|
70
|
-
|
71
78
|
if !@page.spud_template.blank?
|
72
79
|
if !@page.spud_template.base_layout.blank?
|
73
80
|
layout = @page.spud_template.base_layout
|
74
81
|
end
|
75
82
|
@inline = @page.spud_template.content
|
76
|
-
|
77
83
|
end
|
78
|
-
|
84
|
+
|
85
|
+
render :layout => layout, :content_type => :html
|
79
86
|
|
80
87
|
end
|
81
88
|
|
82
89
|
private
|
83
90
|
|
91
|
+
def render_404
|
92
|
+
Spud::Cms.template_404 ? render(Spud::Cms.template_404,:status => 404) : render(:text=>nil,:status => 404)
|
93
|
+
end
|
94
|
+
|
84
95
|
end
|
data/lib/spud_cms/version.rb
CHANGED
@@ -75,3 +75,93 @@ Migrating to AddSiteIdToSpudPermalinks (20120610123615)
|
|
75
75
|
[1m[35m (0.3ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120329132322')
|
76
76
|
[1m[36m (0.3ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20120329132330')[0m
|
77
77
|
[1m[35m (0.3ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120510195151')
|
78
|
+
[1m[36m (6.2ms)[0m [1mSELECT `schema_migrations`.`version` FROM `schema_migrations` [0m
|
79
|
+
[1m[36m (0.3ms)[0m [1mSELECT `schema_migrations`.`version` FROM `schema_migrations` [0m
|
80
|
+
Migrating to CreateSpudPages (20120101192412)
|
81
|
+
Migrating to CreateSpudMenus (20120101193138)
|
82
|
+
Migrating to CreateSpudMenuItems (20120101193255)
|
83
|
+
Migrating to CreateSpudTemplates (20120101194124)
|
84
|
+
Migrating to CreateSpudPagePartials (20120103034659)
|
85
|
+
Migrating to AddVisibilityToSpudPages (20120104194032)
|
86
|
+
Migrating to AddMenuNameToSpudMenuItems (20120107181337)
|
87
|
+
Migrating to AddUseCustomUrlNameToSpudPages (20120111134754)
|
88
|
+
Migrating to AddNotesToSpudPages (20120118141852)
|
89
|
+
Migrating to AddMenuIdToSpudMenuItems (20120126232428)
|
90
|
+
Migrating to AddClassesToSpudMenuItems (20120128163601)
|
91
|
+
Migrating to CreateSpudAdminPermissions (20120307002859)
|
92
|
+
Migrating to CreateSpudUsers (20120307002860)
|
93
|
+
Migrating to CreateSpudPermalinks (20120307003559)
|
94
|
+
Migrating to AddSiteIdToSpudPages (20120329132314)
|
95
|
+
[1m[35m (67.0ms)[0m ALTER TABLE `spud_pages` ADD `site_id` int(11)
|
96
|
+
[1m[36m (21.2ms)[0m [1mCREATE INDEX `index_spud_pages_on_site_id` ON `spud_pages` (`site_id`)[0m
|
97
|
+
[1m[35m (1.3ms)[0m INSERT INTO `schema_migrations` (`version`) VALUES ('20120329132314')
|
98
|
+
Migrating to AddSiteIdToSpudTemplates (20120329132322)
|
99
|
+
[1m[36m (16.8ms)[0m [1mALTER TABLE `spud_templates` ADD `site_id` int(11)[0m
|
100
|
+
[1m[35m (17.7ms)[0m CREATE INDEX `index_spud_templates_on_site_id` ON `spud_templates` (`site_id`)
|
101
|
+
[1m[36m (0.5ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120329132322')[0m
|
102
|
+
Migrating to AddSiteIdToSpudMenus (20120329132330)
|
103
|
+
[1m[35m (16.2ms)[0m ALTER TABLE `spud_menus` ADD `site_id` int(11)
|
104
|
+
[1m[36m (17.6ms)[0m [1mCREATE INDEX `index_spud_menus_on_site_id` ON `spud_menus` (`site_id`)[0m
|
105
|
+
[1m[35m (1.0ms)[0m INSERT INTO `schema_migrations` (`version`) VALUES ('20120329132330')
|
106
|
+
Migrating to CreateSpudPagePartialRevisions (20120510195151)
|
107
|
+
[1m[36m (13.0ms)[0m [1mCREATE TABLE `spud_page_partial_revisions` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `content` text, `format` varchar(255), `spud_page_id` int(11), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB[0m
|
108
|
+
[1m[35m (16.6ms)[0m CREATE INDEX `revision_idx` ON `spud_page_partial_revisions` (`spud_page_id`, `name`)
|
109
|
+
[1m[36m (0.9ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120510195151')[0m
|
110
|
+
Migrating to AddTimeZoneToSpudUser (20120610123555)
|
111
|
+
[1m[35m (19.9ms)[0m ALTER TABLE `spud_users` ADD `time_zone` varchar(255)
|
112
|
+
[1m[36m (2.0ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120610123555')[0m
|
113
|
+
Migrating to AddScopeToSpudAdminPermissions (20120610123556)
|
114
|
+
[1m[35m (21.5ms)[0m ALTER TABLE `spud_admin_permissions` ADD `scope` varchar(255)
|
115
|
+
[1m[36m (0.3ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120610123556')[0m
|
116
|
+
Migrating to CreateSpudUserSettings (20120610123557)
|
117
|
+
[1m[35m (10.5ms)[0m CREATE TABLE `spud_user_settings` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_user_id` int(11), `key` varchar(255), `value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
|
118
|
+
[1m[36m (0.4ms)[0m [1mINSERT INTO `schema_migrations` (`version`) VALUES ('20120610123557')[0m
|
119
|
+
Migrating to AddSiteIdToSpudPermalinks (20120610123615)
|
120
|
+
[1m[35m (15.8ms)[0m ALTER TABLE `spud_permalinks` ADD `site_id` int(11)
|
121
|
+
[1m[36m (12.7ms)[0m [1mCREATE INDEX `index_spud_permalinks_on_site_id` ON `spud_permalinks` (`site_id`)[0m
|
122
|
+
[1m[35m (1.2ms)[0m INSERT INTO `schema_migrations` (`version`) VALUES ('20120610123615')
|
123
|
+
[1m[36m (0.5ms)[0m [1mSELECT `schema_migrations`.`version` FROM `schema_migrations` [0m
|
124
|
+
[1m[36m (0.2ms)[0m [1mSELECT `schema_migrations`.`version` FROM `schema_migrations` [0m
|
125
|
+
[1m[35m (4.6ms)[0m DROP DATABASE IF EXISTS `spud_cms_test`
|
126
|
+
[1m[36m (2.5ms)[0m [1mCREATE DATABASE `spud_cms_test` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`[0m
|
127
|
+
[1m[35m (12.8ms)[0m CREATE TABLE `spud_admin_permissions` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `user_id` int(11), `name` varchar(255), `access` tinyint(1), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `scope` varchar(255)) ENGINE=InnoDB
|
128
|
+
[1m[36m (14.6ms)[0m [1mCREATE TABLE `spud_menu_items` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `parent_type` varchar(255), `parent_id` int(11), `item_type` int(11), `spud_page_id` int(11), `menu_order` int(11) DEFAULT 0, `url` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `name` varchar(255), `spud_menu_id` int(11), `classes` varchar(255)) ENGINE=InnoDB[0m
|
129
|
+
[1m[35m (15.8ms)[0m CREATE INDEX `index_spud_menu_items_on_menu_order` ON `spud_menu_items` (`menu_order`)
|
130
|
+
[1m[36m (15.0ms)[0m [1mCREATE INDEX `index_spud_menu_items_on_parent_type_and_parent_id` ON `spud_menu_items` (`parent_type`, `parent_id`)[0m
|
131
|
+
[1m[35m (16.6ms)[0m CREATE INDEX `index_spud_menu_items_on_spud_menu_id` ON `spud_menu_items` (`spud_menu_id`)
|
132
|
+
[1m[36m (14.5ms)[0m [1mCREATE TABLE `spud_menus` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `description` text, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `site_id` int(11)) ENGINE=InnoDB[0m
|
133
|
+
[1m[35m (15.5ms)[0m CREATE INDEX `index_spud_menus_on_site_id` ON `spud_menus` (`site_id`)
|
134
|
+
[1m[36m (11.1ms)[0m [1mCREATE TABLE `spud_page_partial_revisions` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `content` text, `format` varchar(255), `spud_page_id` int(11), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB[0m
|
135
|
+
[1m[35m (13.7ms)[0m CREATE INDEX `revision_idx` ON `spud_page_partial_revisions` (`spud_page_id`, `name`)
|
136
|
+
[1m[36m (9.4ms)[0m [1mCREATE TABLE `spud_page_partials` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_page_id` int(11), `name` varchar(255), `content` text, `format` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB[0m
|
137
|
+
[1m[35m (15.4ms)[0m CREATE INDEX `index_spud_page_partials_on_spud_page_id` ON `spud_page_partials` (`spud_page_id`)
|
138
|
+
[1m[36m (11.2ms)[0m [1mCREATE TABLE `spud_pages` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `url_name` varchar(255), `publish_at` datetime, `created_by` int(11), `updated_by` int(11), `format` varchar(255) DEFAULT 'html', `spud_page_id` int(11), `meta_description` text, `meta_keywords` varchar(255), `page_order` int(11), `template_id` int(11), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `visibility` int(11) DEFAULT 0, `published` tinyint(1) DEFAULT 1, `use_custom_url_name` tinyint(1) DEFAULT 0, `notes` text, `site_id` int(11)) ENGINE=InnoDB[0m
|
139
|
+
[1m[35m (15.6ms)[0m CREATE INDEX `index_spud_pages_on_site_id` ON `spud_pages` (`site_id`)
|
140
|
+
[1m[36m (11.4ms)[0m [1mCREATE TABLE `spud_permalinks` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `url_name` varchar(255), `attachment_type` varchar(255), `attachment_id` int(11), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `site_id` int(11)) ENGINE=InnoDB[0m
|
141
|
+
[1m[35m (12.6ms)[0m CREATE INDEX `index_spud_permalinks_on_attachment_type_and_attachment_id` ON `spud_permalinks` (`attachment_type`, `attachment_id`)
|
142
|
+
[1m[36m (15.6ms)[0m [1mCREATE INDEX `index_spud_permalinks_on_site_id` ON `spud_permalinks` (`site_id`)[0m
|
143
|
+
[1m[35m (12.4ms)[0m CREATE TABLE `spud_templates` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `name` varchar(255), `base_layout` varchar(255), `content` text, `page_parts` text, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `site_id` int(11)) ENGINE=InnoDB
|
144
|
+
[1m[36m (14.7ms)[0m [1mCREATE INDEX `index_spud_templates_on_site_id` ON `spud_templates` (`site_id`)[0m
|
145
|
+
[1m[35m (8.4ms)[0m CREATE TABLE `spud_user_settings` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `spud_user_id` int(11), `key` varchar(255), `value` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
|
146
|
+
[1m[36m (12.7ms)[0m [1mCREATE TABLE `spud_users` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `first_name` varchar(255), `last_name` varchar(255), `super_admin` tinyint(1), `login` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `crypted_password` varchar(255) NOT NULL, `password_salt` varchar(255) NOT NULL, `persistence_token` varchar(255) NOT NULL, `single_access_token` varchar(255) NOT NULL, `perishable_token` varchar(255) NOT NULL, `login_count` int(11) DEFAULT 0 NOT NULL, `failed_login_count` int(11) DEFAULT 0 NOT NULL, `last_request_at` datetime, `current_login_at` datetime, `last_login_at` datetime, `current_login_ip` varchar(255), `last_login_ip` varchar(255), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `time_zone` varchar(255)) ENGINE=InnoDB[0m
|
147
|
+
[1m[35m (16.4ms)[0m CREATE INDEX `index_spud_users_on_email` ON `spud_users` (`email`)
|
148
|
+
[1m[36m (11.1ms)[0m [1mCREATE INDEX `index_spud_users_on_login` ON `spud_users` (`login`)[0m
|
149
|
+
[1m[35m (11.1ms)[0m CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB
|
150
|
+
[1m[36m (14.4ms)[0m [1mCREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)[0m
|
151
|
+
[1m[35m (0.2ms)[0m SELECT version FROM `schema_migrations`
|
152
|
+
[1m[36m (0.3ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20120610123615')[0m
|
153
|
+
[1m[35m (0.3ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120101192412')
|
154
|
+
[1m[36m (0.3ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20120101193138')[0m
|
155
|
+
[1m[35m (0.3ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120101193255')
|
156
|
+
[1m[36m (0.3ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20120101194124')[0m
|
157
|
+
[1m[35m (0.3ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120103034659')
|
158
|
+
[1m[36m (0.3ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20120104194032')[0m
|
159
|
+
[1m[35m (0.6ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120107181337')
|
160
|
+
[1m[36m (0.8ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20120111134754')[0m
|
161
|
+
[1m[35m (0.4ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120118141852')
|
162
|
+
[1m[36m (0.3ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20120126232428')[0m
|
163
|
+
[1m[35m (0.4ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120128163601')
|
164
|
+
[1m[36m (0.4ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20120329132314')[0m
|
165
|
+
[1m[35m (0.3ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120329132322')
|
166
|
+
[1m[36m (0.2ms)[0m [1mINSERT INTO `schema_migrations` (version) VALUES ('20120329132330')[0m
|
167
|
+
[1m[35m (0.3ms)[0m INSERT INTO `schema_migrations` (version) VALUES ('20120510195151')
|
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.8.
|
4
|
+
version: 0.8.14
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -332,7 +332,6 @@ files:
|
|
332
332
|
- spec/dummy/Rakefile
|
333
333
|
- spec/dummy/README.rdoc
|
334
334
|
- spec/dummy/script/rails
|
335
|
-
- spec/helpers/spud/admin/cms_helper_spec.rb
|
336
335
|
- spec/models/spud_page_partial_revision_spec.rb
|
337
336
|
- spec/models/spud_page_spec.rb
|
338
337
|
- spec/models/spud_template_spec.rb
|
@@ -352,7 +351,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
352
351
|
version: '0'
|
353
352
|
segments:
|
354
353
|
- 0
|
355
|
-
hash: -
|
354
|
+
hash: -1245758938193748243
|
356
355
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
357
356
|
none: false
|
358
357
|
requirements:
|
@@ -361,7 +360,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
361
360
|
version: '0'
|
362
361
|
segments:
|
363
362
|
- 0
|
364
|
-
hash: -
|
363
|
+
hash: -1245758938193748243
|
365
364
|
requirements: []
|
366
365
|
rubyforge_project:
|
367
366
|
rubygems_version: 1.8.24
|
@@ -408,7 +407,6 @@ test_files:
|
|
408
407
|
- spec/dummy/Rakefile
|
409
408
|
- spec/dummy/README.rdoc
|
410
409
|
- spec/dummy/script/rails
|
411
|
-
- spec/helpers/spud/admin/cms_helper_spec.rb
|
412
410
|
- spec/models/spud_page_partial_revision_spec.rb
|
413
411
|
- spec/models/spud_page_spec.rb
|
414
412
|
- spec/models/spud_template_spec.rb
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
# Specs in this file have access to a helper object that includes
|
4
|
-
# the Spud::Admin::CmsHelper. For example:
|
5
|
-
#
|
6
|
-
# describe Spud::Admin::CmsHelper do
|
7
|
-
# describe "string concat" do
|
8
|
-
# it "concats two strings with spaces" do
|
9
|
-
# helper.concat_strings("this","that").should == "this that"
|
10
|
-
# end
|
11
|
-
# end
|
12
|
-
# end
|
13
|
-
describe Spud::Admin::CmsHelper do
|
14
|
-
pending "add some examples to (or delete) #{__FILE__}"
|
15
|
-
end
|