tb_cms 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/README.markdown +1 -1
- data/app/controllers/admin/menu_items_controller.rb +5 -5
- data/app/controllers/admin/menus_controller.rb +8 -2
- data/app/controllers/admin/pages_controller.rb +7 -21
- data/app/controllers/admin/snippets_controller.rb +7 -4
- data/app/controllers/cms/sitemaps_controller.rb +0 -2
- data/app/controllers/pages_controller.rb +1 -10
- data/app/helpers/cms/application_helper.rb +90 -98
- data/app/models/spud_menu.rb +2 -3
- data/app/models/spud_menu_item.rb +1 -4
- data/app/models/spud_page.rb +6 -8
- data/app/models/spud_page_partial.rb +6 -21
- data/app/models/spud_page_partial_revision.rb +1 -1
- data/app/models/spud_snippet.rb +3 -19
- data/app/views/admin/menu_items/_menu_item_row.html.erb +2 -2
- data/app/views/admin/menus/index.html.erb +6 -9
- data/app/views/admin/pages/_page_row.html.erb +16 -16
- data/app/views/admin/pages/edit.html.erb +1 -1
- data/app/views/admin/snippets/index.html.erb +1 -1
- data/app/views/pages/show.html.erb +27 -22
- data/config/routes.rb +1 -4
- data/db/migrate/20121119030136_change_liquid_tags_to_polymorphic.rb +4 -2
- data/db/migrate/20140110142037_drop_spud_page_liquid_tags.rb +31 -0
- data/lib/spud_cms/engine.rb +1 -9
- data/lib/spud_cms/page_route.rb +2 -4
- data/lib/spud_cms/version.rb +1 -1
- data/spec/controllers/admin/menu_items_controller_spec.rb +0 -2
- data/spec/controllers/cms/sitemaps_controller_spec.rb +11 -17
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/config/environments/test.rb +9 -2
- data/spec/dummy/config/initializers/secret_token.rb +1 -0
- data/spec/dummy/db/migrate/{20120307002859_create_spud_admin_permissions.spud_core.rb → 20140110051449_create_spud_admin_permissions.tb_core.rb} +1 -1
- data/spec/dummy/db/migrate/{20120307002860_create_spud_users.spud_core.rb → 20140110051450_create_spud_users.tb_core.rb} +1 -1
- data/spec/dummy/db/migrate/{20120610123555_add_time_zone_to_spud_user.spud_core.rb → 20140110051451_add_time_zone_to_spud_user.tb_core.rb} +1 -1
- data/spec/dummy/db/migrate/20140110051452_add_scope_to_spud_admin_permissions.tb_core.rb +7 -0
- data/spec/dummy/db/migrate/{20120610123557_create_spud_user_settings.spud_core.rb → 20140110051453_create_spud_user_settings.tb_core.rb} +1 -1
- data/spec/dummy/db/migrate/20140110051454_create_spud_roles.tb_core.rb +11 -0
- data/spec/dummy/db/migrate/20140110051455_create_spud_permissions.tb_core.rb +11 -0
- data/spec/dummy/db/migrate/20140110051456_create_spud_role_permissions.tb_core.rb +12 -0
- data/spec/dummy/db/migrate/20140110051457_drop_spud_admin_permissions.tb_core.rb +16 -0
- data/spec/dummy/db/migrate/20140110051458_create_spud_liquid_tags.tb_core.rb +13 -0
- data/spec/dummy/db/migrate/20140110051459_create_spud_permalinks.tb_permalinks.rb +12 -0
- data/spec/dummy/db/migrate/20140110051460_add_site_id_to_spud_permalinks.tb_permalinks.rb +7 -0
- data/spec/dummy/db/migrate/20140110051461_modify_site_id_for_spud_permalinks.tb_permalinks.rb +12 -0
- data/spec/dummy/db/migrate/20140110051462_create_spud_pages.tb_cms.rb +20 -0
- data/spec/dummy/db/migrate/20140110051463_create_spud_menus.tb_cms.rb +11 -0
- data/spec/dummy/db/migrate/20140110051464_create_spud_menu_items.tb_cms.rb +18 -0
- data/spec/dummy/db/migrate/20140110051465_create_spud_templates.tb_cms.rb +12 -0
- data/spec/dummy/db/migrate/20140110051466_create_spud_page_partials.tb_cms.rb +14 -0
- data/spec/dummy/db/migrate/20140110051467_add_visibility_to_spud_pages.tb_cms.rb +7 -0
- data/spec/dummy/db/migrate/20140110051468_add_menu_name_to_spud_menu_items.tb_cms.rb +6 -0
- data/spec/dummy/db/migrate/20140110051469_add_use_custom_url_name_to_spud_pages.tb_cms.rb +6 -0
- data/spec/dummy/db/migrate/20140110051470_add_notes_to_spud_pages.tb_cms.rb +6 -0
- data/spec/dummy/db/migrate/20140110051471_add_menu_id_to_spud_menu_items.tb_cms.rb +8 -0
- data/spec/dummy/db/migrate/20140110051472_add_classes_to_spud_menu_items.tb_cms.rb +7 -0
- data/spec/dummy/db/migrate/20140110051473_add_site_id_to_spud_pages.tb_cms.rb +7 -0
- data/spec/dummy/db/migrate/20140110051474_add_site_id_to_spud_templates.tb_cms.rb +7 -0
- data/spec/dummy/db/migrate/20140110051475_add_site_id_to_spud_menus.tb_cms.rb +7 -0
- data/spec/dummy/db/migrate/20140110051476_create_spud_page_partial_revisions.tb_cms.rb +14 -0
- data/spec/dummy/db/migrate/20140110051477_add_symbol_name_to_spud_page_partials.tb_cms.rb +6 -0
- data/spec/dummy/db/migrate/20140110051478_modify_site_id_for_spud_pages.tb_cms.rb +16 -0
- data/spec/dummy/db/migrate/20140110051479_add_content_processed_to_spud_page_partials.tb_cms.rb +6 -0
- data/spec/dummy/db/migrate/20140110051480_add_layout_to_spud_pages.tb_cms.rb +9 -0
- data/spec/dummy/db/migrate/20140110051481_create_spud_page_liquid_tags.tb_cms.rb +12 -0
- data/spec/dummy/db/migrate/20140110051482_create_spud_snippets.tb_cms.rb +18 -0
- data/spec/dummy/db/migrate/20140110051483_change_liquid_tags_to_polymorphic.tb_cms.rb +20 -0
- data/spec/dummy/db/migrate/20140110051484_drop_spud_page_liquid_tags.tb_cms.rb +30 -0
- data/spec/dummy/db/schema.rb +96 -79
- data/spec/helpers/cms/application_helper_spec.rb +11 -9
- data/spec/models/spud_page_partial_spec.rb +3 -3
- data/spec/models/spud_page_spec.rb +3 -4
- metadata +115 -77
- data/app/models/spud_page_liquid_tag.rb +0 -4
- data/app/observers/page_sweeper.rb +0 -48
- data/app/observers/snippet_sweeper.rb +0 -41
- data/spec/dummy/db/migrate/20120307003559_create_spud_permalinks.spud_permalinks.rb +0 -12
- data/spec/dummy/db/migrate/20120610123556_add_scope_to_spud_admin_permissions.spud_core.rb +0 -7
- data/spec/dummy/db/migrate/20120610123615_add_site_id_to_spud_permalinks.spud_permalinks.rb +0 -7
- data/spec/dummy/log/test.log +0 -11310
- data/spec/models/spud_page_liquid_tag_spec.rb +0 -5
@@ -28,6 +28,7 @@ module Dummy
|
|
28
28
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
29
29
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
30
30
|
# config.i18n.default_locale = :de
|
31
|
+
config.i18n.enforce_available_locales = true
|
31
32
|
|
32
33
|
# Configure the default encoding used in templates for Ruby 1.9.
|
33
34
|
config.encoding = "utf-8"
|
@@ -11,8 +11,14 @@ Dummy::Application.configure do
|
|
11
11
|
config.serve_static_assets = true
|
12
12
|
config.static_cache_control = "public, max-age=3600"
|
13
13
|
|
14
|
+
# Deprecated
|
14
15
|
# Log error messages when you accidentally call methods on nil
|
15
|
-
config.whiny_nils = true
|
16
|
+
# config.whiny_nils = true
|
17
|
+
|
18
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
19
|
+
# just for the purpose of running a single test. If you are using a tool that
|
20
|
+
# preloads Rails for running tests, you may have to set it to true.
|
21
|
+
config.eager_load = false
|
16
22
|
|
17
23
|
# Show full error reports and disable caching
|
18
24
|
config.consider_all_requests_local = true
|
@@ -29,8 +35,9 @@ Dummy::Application.configure do
|
|
29
35
|
# ActionMailer::Base.deliveries array.
|
30
36
|
config.action_mailer.delivery_method = :test
|
31
37
|
|
38
|
+
# Deprecated
|
32
39
|
# Raise exception on mass assignment protection for Active Record models
|
33
|
-
config.active_record.mass_assignment_sanitizer = :strict
|
40
|
+
# config.active_record.mass_assignment_sanitizer = :strict
|
34
41
|
|
35
42
|
# Print deprecation notices to the stderr
|
36
43
|
config.active_support.deprecation = :stderr
|
@@ -5,3 +5,4 @@
|
|
5
5
|
# Make sure the secret is at least 30 characters and all random,
|
6
6
|
# no regular words or you'll be exposed to dictionary attacks.
|
7
7
|
Dummy::Application.config.secret_token = 'a4229e720d134158820df9fc1b34eb71a1911140b6c9df6c7cd09001cabf044a8281f95d3446a2845263d6cda9ec29a87bc77f7442d48231025bbb7ce9349bf4'
|
8
|
+
Dummy::Application.config.secret_key_base = '83ed28f1288f2f059bc8f642f2acb0606ed8b46a3490bee501c1223d3acac326c325b2a97f3b984dda20828815aa123c911970579df1faaedefa21613b05630d'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# This migration comes from tb_core (originally 20130620143010)
|
2
|
+
class CreateSpudRoles < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_roles do |t|
|
5
|
+
t.string :name
|
6
|
+
t.timestamps
|
7
|
+
end
|
8
|
+
add_column :spud_users, :spud_role_id, :integer
|
9
|
+
add_index :spud_users, :spud_role_id
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# This migration comes from tb_core (originally 20130620143941)
|
2
|
+
class CreateSpudPermissions < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_permissions do |t|
|
5
|
+
t.string :name, :null => false
|
6
|
+
t.string :tag, :null => false
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
add_index :spud_permissions, :tag, :unique => true
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from tb_core (originally 20130620151132)
|
2
|
+
class CreateSpudRolePermissions < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_role_permissions do |t|
|
5
|
+
t.integer :spud_role_id, :null => false
|
6
|
+
t.string :spud_permission_tag, :null => false
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
add_index :spud_role_permissions, :spud_role_id
|
10
|
+
add_index :spud_role_permissions, :spud_permission_tag
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# This migration comes from tb_core (originally 20130620163144)
|
2
|
+
class DropSpudAdminPermissions < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
drop_table :spud_admin_permissions
|
5
|
+
end
|
6
|
+
|
7
|
+
def down
|
8
|
+
create_table :spud_admin_permissions do |t|
|
9
|
+
t.integer :user_id
|
10
|
+
t.string :name
|
11
|
+
t.boolean :access
|
12
|
+
t.string :scope
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This migration comes from tb_core (originally 20140110040026)
|
2
|
+
class CreateSpudLiquidTags < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_liquid_tags do |t|
|
5
|
+
t.integer :attachment_id
|
6
|
+
t.string :attachment_type
|
7
|
+
t.string :tag_name
|
8
|
+
t.string :value
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
add_index :spud_liquid_tags, [:tag_name, :value]
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from tb_permalinks (originally 20120306195503)
|
2
|
+
class CreateSpudPermalinks < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_permalinks do |t|
|
5
|
+
t.string :url_name
|
6
|
+
t.string :attachment_type
|
7
|
+
t.integer :attachment_id
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
add_index :spud_permalinks, [:attachment_type,:attachment_id], :name => "idx_permalink_attachment"
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# This migration comes from tb_permalinks (originally 20120329135522)
|
2
|
+
class AddSiteIdToSpudPermalinks < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
add_column :spud_permalinks, :site_id, :integer
|
5
|
+
add_index :spud_permalinks, :site_id, :name => "idx_permalinks_site_id"
|
6
|
+
end
|
7
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from tb_permalinks (originally 20120912123700)
|
2
|
+
class ModifySiteIdForSpudPermalinks < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
change_column :spud_permalinks, :site_id, :integer, :default => 0, :null => false
|
5
|
+
SpudPermalink.where(:site_id => nil).each {|f| f.site_id = 0 ; f.save}
|
6
|
+
end
|
7
|
+
|
8
|
+
def down
|
9
|
+
change_column :spud_permalinks, :site_id, :integer, :default => nil, :null => true
|
10
|
+
SpudPermalink.where(:site_id => 0).each {|f| f.site_id = nil ; f.save}
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# This migration comes from tb_cms (originally 20120101192412)
|
2
|
+
class CreateSpudPages < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_pages do |t|
|
5
|
+
t.string :name
|
6
|
+
t.string :url_name
|
7
|
+
t.datetime :publish_at
|
8
|
+
t.integer :created_by
|
9
|
+
t.integer :updated_by
|
10
|
+
t.string :format,:default => "html"
|
11
|
+
t.integer :spud_page_id
|
12
|
+
t.text :meta_description
|
13
|
+
t.string :meta_keywords
|
14
|
+
t.integer :page_order
|
15
|
+
t.integer :template_id
|
16
|
+
|
17
|
+
t.timestamps
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# This migration comes from tb_cms (originally 20120101193255)
|
2
|
+
class CreateSpudMenuItems < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_menu_items do |t|
|
5
|
+
t.string :parent_type
|
6
|
+
t.integer :parent_id
|
7
|
+
t.integer :item_type
|
8
|
+
t.integer :spud_page_id
|
9
|
+
t.integer :menu_order,:default => 0
|
10
|
+
t.string :url
|
11
|
+
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
|
15
|
+
add_index :spud_menu_items,[:parent_type,:parent_id]
|
16
|
+
add_index :spud_menu_items,[:menu_order]
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from tb_cms (originally 20120101194124)
|
2
|
+
class CreateSpudTemplates < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_templates do |t|
|
5
|
+
t.string :name
|
6
|
+
t.string :base_layout
|
7
|
+
t.text :content
|
8
|
+
t.text :page_parts # On top of Main
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This migration comes from tb_cms (originally 20120103034659)
|
2
|
+
class CreateSpudPagePartials < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_page_partials do |t|
|
5
|
+
t.integer :spud_page_id
|
6
|
+
t.string :name
|
7
|
+
t.text :content
|
8
|
+
t.string :format
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
add_index :spud_page_partials,:spud_page_id
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# This migration comes from tb_cms (originally 20120104194032)
|
2
|
+
class AddVisibilityToSpudPages < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
add_column :spud_pages, :visibility, :integer,:default => 0
|
5
|
+
add_column :spud_pages, :published, :boolean,:default => true
|
6
|
+
end
|
7
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# This migration comes from tb_cms (originally 20120510195151)
|
2
|
+
class CreateSpudPagePartialRevisions < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_page_partial_revisions do |t|
|
5
|
+
t.string :name
|
6
|
+
t.text :content
|
7
|
+
t.string :format
|
8
|
+
t.integer :spud_page_id
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
|
12
|
+
add_index :spud_page_partial_revisions,[:spud_page_id,:name],:name => "revision_idx"
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# This migration comes from tb_cms (originally 20120912121313)
|
2
|
+
class ModifySiteIdForSpudPages < ActiveRecord::Migration
|
3
|
+
def up
|
4
|
+
change_column :spud_pages,:site_id,:integer,:default => 0,:null => false
|
5
|
+
change_column :spud_templates,:site_id,:integer,:default => 0,:null => false
|
6
|
+
change_column :spud_menus,:site_id,:integer,:default => 0,:null => false
|
7
|
+
SpudPage.where(:site_id => nil).each {|f| f.site_id = 0 ; f.save}
|
8
|
+
SpudMenu.where(:site_id => nil).each {|f| f.site_id = 0 ; f.save}
|
9
|
+
end
|
10
|
+
|
11
|
+
def down
|
12
|
+
change_column :spud_pages,:site_id,:integer,:default => nil,:null => true
|
13
|
+
change_column :spud_templates,:site_id,:integer,:default => nil,:null => true
|
14
|
+
change_column :spud_menus,:site_id,:integer,:default => nil,:null => true
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This migration comes from tb_cms (originally 20121112212113)
|
2
|
+
class CreateSpudPageLiquidTags < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_page_liquid_tags do |t|
|
5
|
+
t.integer :spud_page_partial_id
|
6
|
+
t.string :tag_name
|
7
|
+
t.string :value
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
add_index :spud_page_liquid_tags, [:tag_name,:value]
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# This migration comes from tb_cms (originally 20121119025608)
|
2
|
+
class CreateSpudSnippets < ActiveRecord::Migration
|
3
|
+
def change
|
4
|
+
create_table :spud_snippets do |t|
|
5
|
+
t.string :name
|
6
|
+
t.text :content
|
7
|
+
t.string :format
|
8
|
+
t.text :content_processed
|
9
|
+
t.integer :site_id, :default => 0
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
|
13
|
+
add_index :spud_snippets, :site_id
|
14
|
+
add_index :spud_snippets, :name
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
end
|