mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-04-13 11:30:54 -04:00
@@ -314,7 +314,7 @@ GEM
|
||||
multipart-post (2.1.1)
|
||||
newrelic_rpm (6.7.0.359)
|
||||
nio4r (2.5.2)
|
||||
nokogiri (1.10.4)
|
||||
nokogiri (1.10.5)
|
||||
mini_portile2 (~> 2.4.0)
|
||||
oauth (0.5.4)
|
||||
oauth2 (1.4.2)
|
||||
@@ -477,7 +477,7 @@ GEM
|
||||
sprockets (> 3.0)
|
||||
sprockets-rails
|
||||
tilt
|
||||
scout_apm (2.6.3)
|
||||
scout_apm (2.6.4)
|
||||
parser
|
||||
searchkick (4.1.0)
|
||||
activemodel (>= 5)
|
||||
|
||||
34
db/migrate/20191119020643_upgrade_cms.rb
Normal file
34
db/migrate/20191119020643_upgrade_cms.rb
Normal file
@@ -0,0 +1,34 @@
|
||||
class UpgradeCms < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
rename_table :comfy_cms_blocks, :comfy_cms_fragments
|
||||
rename_column :comfy_cms_fragments, :blockable_id, :record_id
|
||||
rename_column :comfy_cms_fragments, :blockable_type, :record_type
|
||||
add_column :comfy_cms_fragments, :tag, :string, null: false, default: 'text'
|
||||
add_column :comfy_cms_fragments, :datetime, :datetime
|
||||
add_column :comfy_cms_fragments, :boolean, :boolean, null: false, default: false
|
||||
change_column :comfy_cms_files, :label, :string, null: false, default: ''
|
||||
change_column :comfy_cms_files, :file_file_name, :string, null: true
|
||||
remove_column :comfy_cms_files, :file_content_type
|
||||
remove_column :comfy_cms_files, :file_file_size
|
||||
remove_index :comfy_cms_sites, :is_mirrored
|
||||
remove_column :comfy_cms_sites, :is_mirrored
|
||||
remove_column :comfy_cms_layouts, :is_shared
|
||||
remove_column :comfy_cms_pages, :is_shared
|
||||
remove_column :comfy_cms_snippets, :is_shared
|
||||
|
||||
limit = 16_777_215
|
||||
create_table :comfy_cms_translations, force: true do |t|
|
||||
t.string :locale, null: false
|
||||
t.integer :page_id, null: false
|
||||
t.integer :layout_id
|
||||
t.string :label, null: false
|
||||
t.text :content_cache, limit: limit
|
||||
t.boolean :is_published, null: false, default: true
|
||||
t.timestamps
|
||||
|
||||
t.index [:page_id]
|
||||
t.index [:locale]
|
||||
t.index [:is_published]
|
||||
end
|
||||
end
|
||||
end
|
||||
75
db/migrate/20191119030244_cms_tags.rb
Normal file
75
db/migrate/20191119030244_cms_tags.rb
Normal file
@@ -0,0 +1,75 @@
|
||||
class CmsTags < ActiveRecord::Migration[5.2]
|
||||
def up
|
||||
Comfy::Cms::Layout.all.each do |layout|
|
||||
layout.content = layout.content.gsub(%r{\{\{ ?cms:page:([\w/]+) ?\}\}}, '{{ cms:text \1 }}') if layout.content.is_a? String
|
||||
|
||||
# {{cms:page:page_header:string}} -> {{ cms:text page_header }}
|
||||
layout.content = layout.content.gsub(/\{\{ ?cms:page:([\w]+):string ?\}\}/, '{{ cms:text \1 }}') if layout.content.is_a? String
|
||||
|
||||
# {{cms:page:content:rich_text}} -> {{ cms:wysiwyg content }}
|
||||
layout.content = layout.content.gsub(/\{\{ ?cms:page:([\w]+):rich_text ?\}\}/, '{{ cms:wysiwyg \1 }}') if layout.content.is_a? String
|
||||
layout.content = layout.content.gsub(/\{\{ ?cms:page:([\w]+):([^:]*) ?\}\}/, '{{ cms:\2 \1 }}') if layout.content.is_a? String
|
||||
if layout.content.is_a? String
|
||||
layout.content = layout.content.gsub(/\{\{ ?cms:field:([\w]+):string ?\}\}/, '{{ cms:text \1, render: false }}')
|
||||
end
|
||||
if layout.content.is_a? String
|
||||
layout.content = layout.content.gsub(/\{\{ ?cms:field:([\w]+):([^:]*) ?\}\}/, '{{ cms:\2 \1, render: false }}')
|
||||
end
|
||||
|
||||
# {{ cms:partial:main/homepage }} -> {{ cms:partial "main/homepage" }}
|
||||
if layout.content.is_a? String
|
||||
layout.content = layout.content.gsub(%r{\{\{ ?cms:asset:([\w/-]+):([\w/-]+):([\w/-]+) ?\}\}}, '{{ cms:asset \1 type: \2 as: tag}}')
|
||||
end
|
||||
layout.content = layout.content.gsub(%r{\{\{ ?cms:partial:([\w/]+) ?\}\}}, '{{ cms:partial \1 }}') if layout.content.is_a? String
|
||||
layout.content = layout.content.gsub(%r{\{\{ ?cms:(\w+):([\w/-]+) ?\}\}}, '{{ cms:\1 \2 }}') if layout.content.is_a? String
|
||||
if layout.content.is_a? String
|
||||
layout.content = layout.content.gsub(%r{\{\{ ?cms:(\w+):([\w/-]+):([\w/-]+):([\w/-]+) ?\}\}}, '{{ cms:\1 \2 \3 \4}}')
|
||||
end
|
||||
layout.content = layout.content.gsub(/\{\{ ?cms:(\w+):([\w]+):([^:]*) ?\}\}/, '{{ cms:\1 \2, "\3" }}') if layout.content.is_a? String
|
||||
layout.content = layout.content.gsub(/cms:rich_text/, 'cms:wysiwyg') if layout.content.is_a? String
|
||||
layout.content = layout.content.gsub(/cms:integer/, 'cms:number') if layout.content.is_a? String
|
||||
layout.content = layout.content.gsub(/cms: string/, 'cms:text') if layout.content.is_a? String # probably a result of goofing one of the more general regexps
|
||||
if layout.content.is_a? String
|
||||
layout.content = layout.content.gsub(%r{\{\{ ?cms:page_file ([\w/]+) ?\}\}}, '{{ cms:file \1, render: false }}')
|
||||
end
|
||||
if layout.content.is_a? String
|
||||
layout.content = layout.content.gsub(/<!-- {{ cms:text (\w+)_slide, render: false }} -->/, "{{ cms:text \1, render: false }}")
|
||||
end
|
||||
|
||||
layout.save if layout.changed?
|
||||
end
|
||||
Comfy::Cms::Fragment.all.each do |fragment|
|
||||
# {{ cms:partial:main/homepage }} -> {{ cms:partial "main/homepage" }}
|
||||
fragment.datetime = fragment.updated_at if fragment.datetime.nil?
|
||||
if fragment.content.is_a? String
|
||||
fragment.content = fragment.content.gsub(%r{\{\{ ?cms:partial:([\w/]+) ?\}\}}, '{{ cms:partial \1 }}')
|
||||
end
|
||||
|
||||
fragment.content = fragment.content.gsub(/\{\{ ?cms:page:([\w]+):string ?\}\}/, '{{ cms:text \1 }}') if fragment.content.is_a? String
|
||||
if fragment.content.is_a? String
|
||||
fragment.content = fragment.content.gsub(/\{\{ ?cms:page:([\w]+):rich_text ?\}\}/, '{{ cms:wysiwyg \1 }}')
|
||||
end
|
||||
|
||||
fragment.content = fragment.content.gsub(%r{\{\{ ?cms:page:([\w/]+) ?\}\}}, '{{ cms:text \1 }}') if fragment.content.is_a? String
|
||||
fragment.content = fragment.content.gsub(/\{\{ ?cms:page:([\w]+):([^:]*) ?\}\}/, '{{ cms:\2 \1 }}') if fragment.content.is_a? String
|
||||
if fragment.content.is_a? String
|
||||
fragment.content = fragment.content.gsub(/\{\{ ?cms:field:([\w]+):([^:]*) ?\}\}/, '{{ cms:\2 \1, render: false }}')
|
||||
end
|
||||
|
||||
fragment.content = fragment.content.gsub(/\{\{ ?cms:(\w+):([\w]+) ?\}\}/, '{{ cms:\1 \2 }}') if fragment.content.is_a? String
|
||||
if fragment.content.is_a? String
|
||||
fragment.content = fragment.content.gsub(/\{\{ ?cms:(\w+):([\w]+):([^:]*) ?\}\}/, '{{ cms:\1 \2, "\3" }}')
|
||||
end
|
||||
fragment.save if fragment.changed?
|
||||
end
|
||||
|
||||
# With the change from Block to Fragment, Revision.data hash keys need to be updated
|
||||
Comfy::Cms::Revision.all.each do |revision|
|
||||
next if revision.data['blocks_attributes'].blank?
|
||||
|
||||
revision.data['fragments_attributes'] = revision.data['blocks_attributes']
|
||||
revision.data.delete('blocks_attributes')
|
||||
revision.save
|
||||
end
|
||||
end
|
||||
end
|
||||
52
db/schema.rb
52
db/schema.rb
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2019_10_29_024101) do
|
||||
ActiveRecord::Schema.define(version: 2019_11_19_020643) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
@@ -35,17 +35,6 @@ ActiveRecord::Schema.define(version: 2019_10_29_024101) do
|
||||
t.index ["member_id"], name: "index_authentications_on_member_id"
|
||||
end
|
||||
|
||||
create_table "comfy_cms_blocks", id: :serial, force: :cascade do |t|
|
||||
t.string "identifier", null: false
|
||||
t.text "content"
|
||||
t.string "blockable_type"
|
||||
t.integer "blockable_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.index ["blockable_id", "blockable_type"], name: "index_comfy_cms_blocks_on_blockable_id_and_blockable_type"
|
||||
t.index ["identifier"], name: "index_comfy_cms_blocks_on_identifier"
|
||||
end
|
||||
|
||||
create_table "comfy_cms_categories", id: :serial, force: :cascade do |t|
|
||||
t.integer "site_id", null: false
|
||||
t.string "label", null: false
|
||||
@@ -63,10 +52,8 @@ ActiveRecord::Schema.define(version: 2019_10_29_024101) do
|
||||
create_table "comfy_cms_files", id: :serial, force: :cascade do |t|
|
||||
t.integer "site_id", null: false
|
||||
t.integer "block_id"
|
||||
t.string "label", null: false
|
||||
t.string "file_file_name", null: false
|
||||
t.string "file_content_type", null: false
|
||||
t.integer "file_file_size", null: false
|
||||
t.string "label", default: "", null: false
|
||||
t.string "file_file_name"
|
||||
t.string "description", limit: 2048
|
||||
t.integer "position", default: 0, null: false
|
||||
t.datetime "created_at"
|
||||
@@ -77,6 +64,20 @@ ActiveRecord::Schema.define(version: 2019_10_29_024101) do
|
||||
t.index ["site_id", "position"], name: "index_comfy_cms_files_on_site_id_and_position"
|
||||
end
|
||||
|
||||
create_table "comfy_cms_fragments", id: :serial, force: :cascade do |t|
|
||||
t.string "identifier", null: false
|
||||
t.text "content"
|
||||
t.string "record_type"
|
||||
t.integer "record_id"
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.string "tag", default: "text", null: false
|
||||
t.datetime "datetime"
|
||||
t.boolean "boolean", default: false, null: false
|
||||
t.index ["identifier"], name: "index_comfy_cms_fragments_on_identifier"
|
||||
t.index ["record_id", "record_type"], name: "index_comfy_cms_fragments_on_record_id_and_record_type"
|
||||
end
|
||||
|
||||
create_table "comfy_cms_layouts", id: :serial, force: :cascade do |t|
|
||||
t.integer "site_id", null: false
|
||||
t.integer "parent_id"
|
||||
@@ -87,7 +88,6 @@ ActiveRecord::Schema.define(version: 2019_10_29_024101) do
|
||||
t.text "css"
|
||||
t.text "js"
|
||||
t.integer "position", default: 0, null: false
|
||||
t.boolean "is_shared", default: false, null: false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.index ["parent_id", "position"], name: "index_comfy_cms_layouts_on_parent_id_and_position"
|
||||
@@ -106,7 +106,6 @@ ActiveRecord::Schema.define(version: 2019_10_29_024101) do
|
||||
t.integer "position", default: 0, null: false
|
||||
t.integer "children_count", default: 0, null: false
|
||||
t.boolean "is_published", default: true, null: false
|
||||
t.boolean "is_shared", default: false, null: false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.index ["parent_id", "position"], name: "index_comfy_cms_pages_on_parent_id_and_position"
|
||||
@@ -127,9 +126,7 @@ ActiveRecord::Schema.define(version: 2019_10_29_024101) do
|
||||
t.string "hostname", null: false
|
||||
t.string "path"
|
||||
t.string "locale", default: "en", null: false
|
||||
t.boolean "is_mirrored", default: false, null: false
|
||||
t.index ["hostname"], name: "index_comfy_cms_sites_on_hostname"
|
||||
t.index ["is_mirrored"], name: "index_comfy_cms_sites_on_is_mirrored"
|
||||
end
|
||||
|
||||
create_table "comfy_cms_snippets", id: :serial, force: :cascade do |t|
|
||||
@@ -138,13 +135,26 @@ ActiveRecord::Schema.define(version: 2019_10_29_024101) do
|
||||
t.string "identifier", null: false
|
||||
t.text "content"
|
||||
t.integer "position", default: 0, null: false
|
||||
t.boolean "is_shared", default: false, null: false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.index ["site_id", "identifier"], name: "index_comfy_cms_snippets_on_site_id_and_identifier", unique: true
|
||||
t.index ["site_id", "position"], name: "index_comfy_cms_snippets_on_site_id_and_position"
|
||||
end
|
||||
|
||||
create_table "comfy_cms_translations", force: :cascade do |t|
|
||||
t.string "locale", null: false
|
||||
t.integer "page_id", null: false
|
||||
t.integer "layout_id"
|
||||
t.string "label", null: false
|
||||
t.text "content_cache"
|
||||
t.boolean "is_published", default: true, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["is_published"], name: "index_comfy_cms_translations_on_is_published"
|
||||
t.index ["locale"], name: "index_comfy_cms_translations_on_locale"
|
||||
t.index ["page_id"], name: "index_comfy_cms_translations_on_page_id"
|
||||
end
|
||||
|
||||
create_table "comments", id: :serial, force: :cascade do |t|
|
||||
t.integer "post_id", null: false
|
||||
t.integer "author_id", null: false
|
||||
|
||||
28
yarn.lock
28
yarn.lock
@@ -199,10 +199,10 @@ acorn@^5.5.0:
|
||||
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279"
|
||||
integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==
|
||||
|
||||
agent-base@^4.1.0:
|
||||
version "4.2.1"
|
||||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9"
|
||||
integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==
|
||||
agent-base@^4.3.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee"
|
||||
integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==
|
||||
dependencies:
|
||||
es6-promisify "^5.0.0"
|
||||
|
||||
@@ -795,9 +795,9 @@ es6-promise-pool@^2.5.0:
|
||||
integrity sha1-FHxhKza0fxBQJ/nSv1SlmKmdnMs=
|
||||
|
||||
es6-promise@^4.0.3:
|
||||
version "4.2.6"
|
||||
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.6.tgz#b685edd8258886365ea62b57d30de28fadcd974f"
|
||||
integrity sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==
|
||||
version "4.2.8"
|
||||
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a"
|
||||
integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==
|
||||
|
||||
es6-promisify@^5.0.0:
|
||||
version "5.0.0"
|
||||
@@ -1215,11 +1215,11 @@ http-signature@~1.2.0:
|
||||
sshpk "^1.7.0"
|
||||
|
||||
https-proxy-agent@^2.2.1:
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0"
|
||||
integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==
|
||||
version "2.2.4"
|
||||
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b"
|
||||
integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==
|
||||
dependencies:
|
||||
agent-base "^4.1.0"
|
||||
agent-base "^4.3.0"
|
||||
debug "^3.1.0"
|
||||
|
||||
hyperlinker@^1.0.0:
|
||||
@@ -1541,9 +1541,9 @@ ms@2.0.0:
|
||||
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
|
||||
|
||||
ms@^2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
|
||||
integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
|
||||
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
|
||||
|
||||
mute-stream@0.0.7:
|
||||
version "0.0.7"
|
||||
|
||||
Reference in New Issue
Block a user