tb_cms 1.3.beta1 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +0 -9
- data/app/assets/javascripts/admin/cms/menu_items.js +12 -6
- data/app/assets/javascripts/admin/cms/pages.js +3 -0
- data/app/controllers/cms/sitemaps_controller.rb +1 -1
- data/app/controllers/pages_controller.rb +4 -4
- data/app/helpers/cms/application_helper.rb +4 -4
- data/app/models/spud_menu_item.rb +3 -3
- data/app/models/spud_page.rb +21 -10
- data/app/models/spud_page_partial.rb +3 -20
- data/app/models/spud_snippet.rb +1 -4
- data/app/views/admin/pages/show.html.erb +12 -15
- data/app/views/pages/show.html.erb +2 -2
- data/db/migrate/20120101192412_create_spud_pages.rb +1 -1
- data/db/migrate/20120101193138_create_spud_menus.rb +1 -1
- data/db/migrate/20120101193255_create_spud_menu_items.rb +1 -1
- data/db/migrate/20120101194124_create_spud_templates.rb +1 -1
- data/db/migrate/20120103034659_create_spud_page_partials.rb +1 -1
- data/db/migrate/20120104194032_add_visibility_to_spud_pages.rb +1 -1
- data/db/migrate/20120107181337_add_menu_name_to_spud_menu_items.rb +1 -1
- data/db/migrate/20120111134754_add_use_custom_url_name_to_spud_pages.rb +1 -1
- data/db/migrate/20120118141852_add_notes_to_spud_pages.rb +1 -1
- data/db/migrate/20120126232428_add_menu_id_to_spud_menu_items.rb +1 -1
- data/db/migrate/20120128163601_add_classes_to_spud_menu_items.rb +1 -1
- data/db/migrate/20120329132314_add_site_id_to_spud_pages.rb +1 -1
- data/db/migrate/20120329132322_add_site_id_to_spud_templates.rb +1 -1
- data/db/migrate/20120329132330_add_site_id_to_spud_menus.rb +1 -1
- data/db/migrate/20120510195151_create_spud_page_partial_revisions.rb +1 -1
- data/db/migrate/20120911190030_add_symbol_name_to_spud_page_partials.rb +1 -1
- data/db/migrate/20120912121313_modify_site_id_for_spud_pages.rb +1 -1
- data/db/migrate/20121016233715_add_content_processed_to_spud_page_partials.rb +1 -1
- data/db/migrate/20121112151110_add_layout_to_spud_pages.rb +1 -1
- data/db/migrate/20121119025608_create_spud_snippets.rb +1 -1
- data/db/migrate/20150108162839_remove_site_id_from_cms_tables.rb +1 -1
- data/db/migrate/20150622161403_add_title_tag_to_spud_page.rb +1 -1
- data/lib/spud_cms/engine.rb +4 -15
- data/lib/spud_cms/template_parser.rb +2 -2
- data/lib/spud_cms/version.rb +1 -1
- data/lib/tb_cms.rb +0 -1
- data/spec/controllers/admin/menu_items_controller_spec.rb +18 -18
- data/spec/controllers/admin/menus_controller_spec.rb +9 -9
- data/spec/controllers/admin/pages_controller_spec.rb +9 -9
- data/spec/controllers/pages_controller_spec.rb +5 -5
- data/spec/dummy/app/controllers/application_controller.rb +1 -1
- data/spec/dummy/config/application.rb +1 -1
- data/spec/dummy/config/database.yml +3 -6
- data/spec/dummy/config/environments/development.rb +2 -2
- data/spec/dummy/db/migrate/20141231214446_create_spud_admin_permissions.tb_core.rb +1 -1
- data/spec/dummy/db/migrate/20141231214447_create_spud_users.tb_core.rb +1 -1
- data/spec/dummy/db/migrate/20141231214448_add_time_zone_to_spud_user.tb_core.rb +1 -1
- data/spec/dummy/db/migrate/20141231214449_add_scope_to_spud_admin_permissions.tb_core.rb +1 -1
- data/spec/dummy/db/migrate/20141231214450_create_spud_user_settings.tb_core.rb +1 -1
- data/spec/dummy/db/migrate/20141231214451_create_spud_roles.tb_core.rb +1 -1
- data/spec/dummy/db/migrate/20141231214452_create_spud_permissions.tb_core.rb +1 -1
- data/spec/dummy/db/migrate/20141231214453_create_spud_role_permissions.tb_core.rb +1 -1
- data/spec/dummy/db/migrate/20141231214454_drop_spud_admin_permissions.tb_core.rb +1 -1
- data/spec/dummy/db/migrate/20141231214455_create_spud_permalinks.tb_permalinks.rb +1 -1
- data/spec/dummy/db/migrate/20141231214456_add_site_id_to_spud_permalinks.tb_permalinks.rb +1 -1
- data/spec/dummy/db/migrate/20141231214457_modify_site_id_for_spud_permalinks.tb_permalinks.rb +1 -1
- data/spec/dummy/db/migrate/20141231214459_create_spud_pages.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214460_create_spud_menus.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214461_create_spud_menu_items.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214462_create_spud_templates.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214463_create_spud_page_partials.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214464_add_visibility_to_spud_pages.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214465_add_menu_name_to_spud_menu_items.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214466_add_use_custom_url_name_to_spud_pages.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214467_add_notes_to_spud_pages.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214468_add_menu_id_to_spud_menu_items.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214469_add_classes_to_spud_menu_items.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214470_add_site_id_to_spud_pages.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214471_add_site_id_to_spud_templates.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214472_add_site_id_to_spud_menus.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214473_create_spud_page_partial_revisions.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214474_add_symbol_name_to_spud_page_partials.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214475_modify_site_id_for_spud_pages.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214476_add_content_processed_to_spud_page_partials.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214477_add_layout_to_spud_pages.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20141231214479_create_spud_snippets.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20150108164814_remove_site_id_from_cms_tables.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20150911185843_add_requires_password_change_to_spud_users.tb_core.rb +1 -1
- data/spec/dummy/db/migrate/20150911185844_add_title_tag_to_spud_page.tb_cms.rb +1 -1
- data/spec/dummy/db/migrate/20160215180157_create_tb_redirects.tb_redirects.rb +1 -1
- data/spec/dummy/db/schema.rb +138 -145
- data/spec/helpers/cms/application_helper_spec.rb +37 -37
- data/spec/models/spud_menu_item_spec.rb +4 -4
- data/spec/models/spud_page_partial_spec.rb +5 -5
- data/spec/models/spud_page_spec.rb +20 -12
- data/spec/rails_helper.rb +1 -1
- metadata +68 -95
- data/db/migrate/20121112212113_create_spud_page_liquid_tags.rb +0 -11
- data/db/migrate/20121119030136_change_liquid_tags_to_polymorphic.rb +0 -17
- data/db/migrate/20140110142037_drop_spud_page_liquid_tags.rb +0 -31
- data/lib/spud_cms/liquid_snippet.rb +0 -27
- data/spec/dummy/db/migrate/20141231214458_create_tb_liquid_spud_liquid_tags.tb_liquid.rb +0 -13
- data/spec/dummy/db/migrate/20141231214478_create_spud_page_liquid_tags.tb_cms.rb +0 -12
- data/spec/dummy/db/migrate/20141231214480_change_liquid_tags_to_polymorphic.tb_cms.rb +0 -18
- data/spec/dummy/db/migrate/20141231214481_drop_spud_page_liquid_tags.tb_cms.rb +0 -30
@@ -1,11 +0,0 @@
|
|
1
|
-
class CreateSpudPageLiquidTags < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table :spud_page_liquid_tags do |t|
|
4
|
-
t.integer :spud_page_partial_id
|
5
|
-
t.string :tag_name
|
6
|
-
t.string :value
|
7
|
-
t.timestamps
|
8
|
-
end
|
9
|
-
add_index :spud_page_liquid_tags, [:tag_name,:value]
|
10
|
-
end
|
11
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
class ChangeLiquidTagsToPolymorphic < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
rename_column :spud_page_liquid_tags, :spud_page_partial_id, :attachment_id
|
4
|
-
add_column :spud_page_liquid_tags, :attachment_type, :string
|
5
|
-
add_index :spud_page_liquid_tags, [:attachment_type, :attachment_id], :name => 'inde_spud_page_liquid_tags_on_attachment'
|
6
|
-
if defined?(SpudPageLiquidTag)
|
7
|
-
SpudPageLiquidTag.all.each do |f|
|
8
|
-
f.update_attributes(:attachment_type => "SpudPagePartial")
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def down
|
14
|
-
rename_column :spud_page_liquid_tags, :attachment_id, :spud_page_partial_id
|
15
|
-
remove_column :spud_page_liquid_tags, :attachment_type
|
16
|
-
end
|
17
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
class DropSpudPageLiquidTags < ActiveRecord::Migration
|
2
|
-
|
3
|
-
class SpudPageLiquidTag < ActiveRecord::Base
|
4
|
-
end
|
5
|
-
|
6
|
-
def up
|
7
|
-
if defined?(SpudLiquidTag)
|
8
|
-
SpudPageLiquidTag.all.each do |tag|
|
9
|
-
SpudLiquidTag.create({
|
10
|
-
:attachment_id => tag.attachment_id,
|
11
|
-
:attachment_type => tag.attachment_type,
|
12
|
-
:tag_name => tag.tag_name,
|
13
|
-
:value => tag.value
|
14
|
-
})
|
15
|
-
end
|
16
|
-
end
|
17
|
-
drop_table :spud_page_liquid_tags
|
18
|
-
end
|
19
|
-
|
20
|
-
def down
|
21
|
-
create_table :spud_page_liquid_tags do |t|
|
22
|
-
t.integer :attachment_id
|
23
|
-
t.string :attachment_type
|
24
|
-
t.string :tag_name
|
25
|
-
t.string :value
|
26
|
-
t.timestamps
|
27
|
-
end
|
28
|
-
add_index :spud_page_liquid_tags, [:tag_name,:value]
|
29
|
-
add_index :spud_page_liquid_tags, [:attachment_type,:attachment_id]
|
30
|
-
end
|
31
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'liquid'
|
2
|
-
module Spud
|
3
|
-
module Cms
|
4
|
-
class LiquidSnippet < Liquid::Tag
|
5
|
-
def initialize(_tag_name, snippet_name, _tokens)
|
6
|
-
@snippet_name = snippet_name
|
7
|
-
@snippet = SpudSnippet.where(name: snippet_name).first
|
8
|
-
end
|
9
|
-
|
10
|
-
def tag_name
|
11
|
-
return 'snippet'
|
12
|
-
end
|
13
|
-
|
14
|
-
def tag_value
|
15
|
-
return @snippet_name
|
16
|
-
end
|
17
|
-
|
18
|
-
def render(_context)
|
19
|
-
if !@snippet.blank?
|
20
|
-
return @snippet.content_processed.html_safe
|
21
|
-
else
|
22
|
-
return ''
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# This migration comes from tb_liquid (originally 20140110142037)
|
2
|
-
class CreateTbLiquidSpudLiquidTags < 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
|
@@ -1,12 +0,0 @@
|
|
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
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# This migration comes from tb_cms (originally 20121119030136)
|
2
|
-
class ChangeLiquidTagsToPolymorphic < ActiveRecord::Migration
|
3
|
-
def up
|
4
|
-
rename_column :spud_page_liquid_tags, :spud_page_partial_id, :attachment_id
|
5
|
-
add_column :spud_page_liquid_tags, :attachment_type, :string
|
6
|
-
add_index :spud_page_liquid_tags, [:attachment_type, :attachment_id], name: 'inde_spud_page_liquid_tags_on_attachment'
|
7
|
-
if defined?(SpudPageLiquidTag)
|
8
|
-
SpudPageLiquidTag.all.each do |f|
|
9
|
-
f.update_attributes(attachment_type: 'SpudPagePartial')
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def down
|
15
|
-
rename_column :spud_page_liquid_tags, :attachment_id, :spud_page_partial_id
|
16
|
-
remove_column :spud_page_liquid_tags, :attachment_type
|
17
|
-
end
|
18
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# This migration comes from tb_cms (originally 20140110142037)
|
2
|
-
class DropSpudPageLiquidTags < ActiveRecord::Migration
|
3
|
-
|
4
|
-
class SpudPageLiquidTag < ActiveRecord::Base
|
5
|
-
end
|
6
|
-
|
7
|
-
def up
|
8
|
-
if defined?(SpudLiquidTag)
|
9
|
-
SpudPageLiquidTag.all.each do |tag|
|
10
|
-
SpudLiquidTag.create(attachment_id: tag.attachment_id,
|
11
|
-
attachment_type: tag.attachment_type,
|
12
|
-
tag_name: tag.tag_name,
|
13
|
-
value: tag.value)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
drop_table :spud_page_liquid_tags
|
17
|
-
end
|
18
|
-
|
19
|
-
def down
|
20
|
-
create_table :spud_page_liquid_tags do |t|
|
21
|
-
t.integer :attachment_id
|
22
|
-
t.string :attachment_type
|
23
|
-
t.string :tag_name
|
24
|
-
t.string :value
|
25
|
-
t.timestamps
|
26
|
-
end
|
27
|
-
add_index :spud_page_liquid_tags, [:tag_name, :value]
|
28
|
-
add_index :spud_page_liquid_tags, [:attachment_type, :attachment_id]
|
29
|
-
end
|
30
|
-
end
|