panda-cms 0.10.0 → 0.10.3
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.
- checksums.yaml +4 -4
- data/README.md +79 -11
- data/app/assets/tailwind/panda/cms/_application.css +1 -0
- data/app/components/panda/cms/admin/popular_pages_component.rb +62 -0
- data/app/components/panda/cms/code_component.rb +46 -9
- data/app/components/panda/cms/menu_component.rb +18 -5
- data/app/components/panda/cms/page_menu_component.rb +9 -1
- data/app/components/panda/cms/rich_text_component.rb +49 -17
- data/app/components/panda/cms/text_component.rb +46 -14
- data/app/controllers/panda/cms/admin/menus_controller.rb +2 -2
- data/app/controllers/panda/cms/admin/pages_controller.rb +6 -2
- data/app/controllers/panda/cms/admin/posts_controller.rb +3 -1
- data/app/controllers/panda/cms/form_submissions_controller.rb +134 -11
- data/app/controllers/panda/cms/pages_controller.rb +7 -2
- data/app/controllers/panda/cms/posts_controller.rb +16 -0
- data/app/helpers/panda/cms/application_helper.rb +2 -3
- data/app/helpers/panda/cms/asset_helper.rb +14 -72
- data/app/helpers/panda/cms/forms_helper.rb +60 -0
- data/app/helpers/panda/cms/seo_helper.rb +85 -0
- data/app/javascript/panda/cms/{application_panda_cms.js → application.js} +4 -0
- data/app/javascript/panda/cms/controllers/editor_form_controller.js +3 -3
- data/app/javascript/panda/cms/controllers/editor_iframe_controller.js +35 -8
- data/app/javascript/panda/cms/controllers/file_upload_controller.js +165 -0
- data/app/javascript/panda/cms/controllers/index.js +6 -0
- data/app/javascript/panda/cms/controllers/menu_form_controller.js +14 -1
- data/app/javascript/panda/cms/controllers/page_form_controller.js +454 -0
- data/app/javascript/panda/cms/stimulus-loading.js +2 -1
- data/app/jobs/panda/cms/record_visit_job.rb +2 -1
- data/app/models/panda/cms/menu.rb +12 -0
- data/app/models/panda/cms/page.rb +106 -0
- data/app/models/panda/cms/post.rb +97 -0
- data/app/models/panda/cms/visit.rb +16 -1
- data/app/services/panda/social/instagram_feed_service.rb +54 -54
- data/app/views/layouts/homepage.html.erb +1 -4
- data/app/views/layouts/page.html.erb +1 -4
- data/app/views/panda/cms/admin/dashboard/show.html.erb +11 -4
- data/app/views/panda/cms/admin/files/index.html.erb +1 -1
- data/app/views/panda/cms/admin/forms/new.html.erb +1 -1
- data/app/views/panda/cms/admin/forms/show.html.erb +3 -3
- data/app/views/panda/cms/admin/menus/_menu_item_fields.html.erb +3 -3
- data/app/views/panda/cms/admin/menus/edit.html.erb +12 -14
- data/app/views/panda/cms/admin/menus/index.html.erb +1 -1
- data/app/views/panda/cms/admin/menus/new.html.erb +6 -8
- data/app/views/panda/cms/admin/pages/edit.html.erb +213 -20
- data/app/views/panda/cms/admin/pages/index.html.erb +6 -6
- data/app/views/panda/cms/admin/posts/_form.html.erb +47 -8
- data/app/views/panda/cms/admin/posts/edit.html.erb +1 -1
- data/app/views/panda/cms/admin/posts/index.html.erb +4 -4
- data/app/views/panda/cms/shared/_favicons.html.erb +7 -7
- data/app/views/shared/_header.html.erb +1 -4
- data/config/brakeman.ignore +38 -0
- data/config/importmap.rb +7 -6
- data/config/initializers/groupdate.rb +5 -0
- data/config/locales/en.yml +42 -2
- data/config/routes.rb +1 -1
- data/db/migrate/20240315125421_add_nested_sets_to_panda_cms_pages.rb +0 -10
- data/db/migrate/20240316230706_add_nested_to_panda_cms_menu_items.rb +0 -6
- data/db/migrate/20240317230622_create_panda_cms_visits.rb +1 -1
- data/db/migrate/20240805121123_create_panda_cms_posts.rb +1 -1
- data/db/migrate/20240806112735_fix_panda_cms_visits_column_names.rb +1 -1
- data/db/migrate/20240923234535_add_depth_to_panda_cms_menus.rb +0 -6
- data/db/migrate/20250106223303_add_author_id_to_panda_cms_posts.rb +1 -3
- data/db/migrate/20251109131150_add_seo_fields_to_pages.rb +32 -0
- data/db/migrate/20251109131205_add_seo_fields_to_posts.rb +27 -0
- data/db/migrate/20251110114258_add_spam_tracking_to_form_submissions.rb +7 -0
- data/db/migrate/20251110122812_add_performance_indexes_to_pages_and_redirects.rb +13 -0
- data/db/migrate/20251117234530_add_index_to_visited_at_on_panda_cms_visits.rb +7 -0
- data/db/migrate/20251118015100_backfill_visited_at_for_existing_visits.rb +17 -0
- data/db/seeds.rb +5 -0
- data/lib/panda/cms/asset_loader.rb +42 -78
- data/lib/panda/cms/bulk_editor.rb +288 -12
- data/lib/panda/cms/engine/asset_config.rb +49 -0
- data/lib/panda/cms/engine/autoload_config.rb +37 -0
- data/lib/panda/cms/engine/backtrace_config.rb +42 -0
- data/lib/panda/cms/engine/core_config.rb +106 -0
- data/lib/panda/cms/engine/helper_config.rb +20 -0
- data/lib/panda/cms/engine/route_config.rb +33 -0
- data/lib/panda/cms/engine/view_component_config.rb +31 -0
- data/lib/panda/cms/engine.rb +32 -228
- data/lib/{panda-cms → panda/cms}/version.rb +1 -1
- data/lib/panda/cms.rb +12 -0
- data/lib/panda-cms.rb +24 -3
- data/lib/tasks/ci.rake +0 -0
- metadata +32 -67
- data/app/assets/builds/panda.cms.css +0 -2754
- data/app/assets/stylesheets/panda/cms/application.tailwind.css +0 -162
- data/app/assets/stylesheets/panda/cms/editor.css +0 -120
- data/app/assets/tailwind/application.css +0 -178
- data/app/assets/tailwind/tailwind.config.js +0 -15
- data/app/javascript/panda_cms/stimulus-loading.js +0 -39
- data/app/views/panda/cms/shared/_importmap.html.erb +0 -34
- data/config/initializers/inflections.rb +0 -5
- data/config/initializers/panda/cms/healthcheck_log_silencer.rb.disabled +0 -31
- data/db/migrate/20240317010532_create_panda_cms_users.rb +0 -14
- data/db/migrate/20240324205703_create_active_storage_tables.active_storage.rb +0 -61
- data/db/migrate/20240408084718_default_panda_cms_users_admin_to_false.rb +0 -7
- data/db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb +0 -24
- data/db/migrate/20240701225423_create_active_storage_variant_records.active_storage.rb +0 -30
- data/db/migrate/20240701225424_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb +0 -10
- data/db/migrate/20241119214548_convert_post_content_to_editor_js.rb +0 -37
- data/db/migrate/20250809231125_migrate_users_to_panda_core.rb +0 -113
- data/lib/generators/panda/cms/install_generator.rb +0 -28
- data/lib/tasks/assets.rake +0 -540
- data/public/panda-cms-assets/editor-js/core/editorjs.min.js +0 -83
- data/public/panda-cms-assets/editor-js/plugins/embed.min.js +0 -2
- data/public/panda-cms-assets/editor-js/plugins/header.min.js +0 -9
- data/public/panda-cms-assets/editor-js/plugins/nested-list.min.js +0 -2
- data/public/panda-cms-assets/editor-js/plugins/paragraph.min.js +0 -9
- data/public/panda-cms-assets/editor-js/plugins/quote.min.js +0 -2
- data/public/panda-cms-assets/editor-js/plugins/simple-image.min.js +0 -2
- data/public/panda-cms-assets/editor-js/plugins/table.min.js +0 -2
- data/public/panda-cms-assets/favicons/android-chrome-192x192.png +0 -0
- data/public/panda-cms-assets/favicons/android-chrome-512x512.png +0 -0
- data/public/panda-cms-assets/favicons/apple-touch-icon.png +0 -0
- data/public/panda-cms-assets/favicons/browserconfig.xml +0 -9
- data/public/panda-cms-assets/favicons/favicon-16x16.png +0 -0
- data/public/panda-cms-assets/favicons/favicon-32x32.png +0 -0
- data/public/panda-cms-assets/favicons/favicon.ico +0 -0
- data/public/panda-cms-assets/favicons/mstile-150x150.png +0 -0
- data/public/panda-cms-assets/favicons/safari-pinned-tab.svg +0 -61
- data/public/panda-cms-assets/favicons/site.webmanifest +0 -14
- data/public/panda-cms-assets/manifest.json +0 -20
- data/public/panda-cms-assets/panda-cms-0.7.4.css +0 -26
- data/public/panda-cms-assets/panda-cms-0.7.4.js +0 -150
- data/public/panda-cms-assets/panda-logo-screenprint.png +0 -0
- data/public/panda-cms-assets/panda-nav.png +0 -0
- data/public/panda-cms-assets/rich_text_editor.css +0 -568
- /data/db/migrate/{20251105000001_add_pending_review_status_to_pages_and_posts.panda_cms.rb → 20251105000001_add_pending_review_status_to_pages_and_posts.rb} +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Panda
|
|
4
|
+
module CMS
|
|
5
|
+
class Engine < ::Rails::Engine
|
|
6
|
+
# ViewComponent configuration
|
|
7
|
+
module ViewComponentConfig
|
|
8
|
+
extend ActiveSupport::Concern
|
|
9
|
+
|
|
10
|
+
included do
|
|
11
|
+
# Set up ViewComponent
|
|
12
|
+
initializer "panda.cms.view_component" do |app|
|
|
13
|
+
app.config.view_component.preview_paths ||= []
|
|
14
|
+
app.config.view_component.preview_paths << root.join("spec/components/previews")
|
|
15
|
+
app.config.view_component.generate.sidecar = true
|
|
16
|
+
app.config.view_component.generate.preview = true
|
|
17
|
+
|
|
18
|
+
# Add preview directories to autoload paths in development
|
|
19
|
+
if Rails.env.development?
|
|
20
|
+
# Handle frozen autoload_paths array
|
|
21
|
+
if app.config.autoload_paths.frozen?
|
|
22
|
+
app.config.autoload_paths = app.config.autoload_paths.dup
|
|
23
|
+
end
|
|
24
|
+
app.config.autoload_paths << root.join("spec/components/previews")
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
data/lib/panda/cms/engine.rb
CHANGED
|
@@ -9,248 +9,52 @@ require "panda/cms/railtie"
|
|
|
9
9
|
|
|
10
10
|
require "invisible_captcha"
|
|
11
11
|
|
|
12
|
+
require_relative "engine/autoload_config"
|
|
13
|
+
require_relative "engine/asset_config"
|
|
14
|
+
require_relative "engine/route_config"
|
|
15
|
+
require_relative "engine/core_config"
|
|
16
|
+
require_relative "engine/helper_config"
|
|
17
|
+
require_relative "engine/backtrace_config"
|
|
18
|
+
|
|
12
19
|
module Panda
|
|
13
20
|
module CMS
|
|
14
21
|
class Engine < ::Rails::Engine
|
|
15
22
|
isolate_namespace Panda::CMS
|
|
16
23
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
#{root}/app/services
|
|
20
|
-
]
|
|
21
|
-
|
|
22
|
-
# Session configuration is left to the consuming application
|
|
23
|
-
# The CMS engine does not impose session store requirements
|
|
24
|
-
|
|
25
|
-
config.to_prepare do
|
|
26
|
-
ApplicationController.helper(::ApplicationHelper)
|
|
27
|
-
ApplicationController.helper(Panda::CMS::AssetHelper)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
# Set our generators
|
|
31
|
-
config.generators do |g|
|
|
32
|
-
g.orm :active_record, primary_key_type: :uuid
|
|
33
|
-
g.test_framework :rspec, fixture: true
|
|
34
|
-
g.fixture_replacement nil
|
|
35
|
-
g.view_specs false
|
|
36
|
-
g.templates.unshift File.expand_path("../templates", __dir__)
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
# Make files in public available to the main app (e.g. /panda_cms-assets/favicon.ico)
|
|
40
|
-
config.middleware.use Rack::Static,
|
|
41
|
-
urls: ["/panda-cms-assets"],
|
|
42
|
-
root: Panda::CMS::Engine.root.join("public")
|
|
43
|
-
|
|
44
|
-
# Make JavaScript files available for importmap
|
|
45
|
-
# Serve from app/javascript with proper MIME types
|
|
46
|
-
config.middleware.use Rack::Static,
|
|
47
|
-
urls: ["/panda/cms"],
|
|
48
|
-
root: Panda::CMS::Engine.root.join("app/javascript"),
|
|
49
|
-
header_rules: [
|
|
50
|
-
[:all, {"Cache-Control" => Rails.env.development? ? "no-cache, no-store, must-revalidate" : "public, max-age=31536000",
|
|
51
|
-
"Content-Type" => "text/javascript; charset=utf-8"}]
|
|
52
|
-
]
|
|
53
|
-
|
|
54
|
-
# Custom error handling
|
|
55
|
-
# config.exceptions_app = Panda::CMS::ExceptionsApp.new(exceptions_app: routes)
|
|
56
|
-
|
|
57
|
-
initializer "panda.cms.assets" do |app|
|
|
58
|
-
if Rails.configuration.respond_to?(:assets)
|
|
59
|
-
# Add JavaScript paths
|
|
60
|
-
app.config.assets.paths << root.join("app/javascript")
|
|
61
|
-
app.config.assets.paths << root.join("app/javascript/panda")
|
|
62
|
-
app.config.assets.paths << root.join("app/javascript/panda/cms")
|
|
63
|
-
app.config.assets.paths << root.join("app/javascript/panda/cms/controllers")
|
|
64
|
-
|
|
65
|
-
# Make sure these files are precompiled
|
|
66
|
-
app.config.assets.precompile += %w[
|
|
67
|
-
panda_cms_manifest.js
|
|
68
|
-
panda/cms/controllers/**/*.js
|
|
69
|
-
panda/cms/application_panda_cms.js
|
|
70
|
-
]
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
# Add importmap paths from the engine
|
|
75
|
-
initializer "panda.cms.importmap", before: "importmap" do |app|
|
|
76
|
-
if app.config.respond_to?(:importmap)
|
|
77
|
-
# Create a new array if frozen
|
|
78
|
-
app.config.importmap.paths = app.config.importmap.paths.dup if app.config.importmap.paths.frozen?
|
|
24
|
+
include Panda::Core::Shared::InflectionsConfig
|
|
25
|
+
include Panda::Core::Shared::GeneratorConfig
|
|
79
26
|
|
|
80
|
-
|
|
81
|
-
|
|
27
|
+
include AutoloadConfig
|
|
28
|
+
include AssetConfig
|
|
29
|
+
include RouteConfig
|
|
30
|
+
include CoreConfig
|
|
31
|
+
include HelperConfig
|
|
32
|
+
include BacktraceConfig
|
|
82
33
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
end
|
|
87
|
-
app.config.importmap.cache_sweepers << root.join("app/javascript")
|
|
34
|
+
initializer "panda_cms.importmap", before: "importmap" do |app|
|
|
35
|
+
Panda::CMS.importmap = Importmap::Map.new.tap do |map|
|
|
36
|
+
map.draw(Panda::CMS::Engine.root.join("config/importmap.rb"))
|
|
88
37
|
end
|
|
89
38
|
end
|
|
90
39
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
mount Panda::CMS::Engine => "/", :as => "panda_cms"
|
|
96
|
-
post "/_forms/:id", to: "panda/cms/form_submissions#create", as: :panda_cms_form_submit
|
|
97
|
-
get "/_maintenance", to: "panda/cms/errors#error_503", as: :panda_cms_maintenance
|
|
98
|
-
|
|
99
|
-
# Catch-all route for CMS pages, but exclude admin paths and assets
|
|
100
|
-
admin_path = Panda::Core.config.admin_path.delete_prefix("/")
|
|
101
|
-
constraints = ->(request) {
|
|
102
|
-
!request.path.start_with?("/#{admin_path}") &&
|
|
103
|
-
!request.path.start_with?("/panda-cms-assets/")
|
|
104
|
-
}
|
|
105
|
-
get "/*path", to: "panda/cms/pages#show", as: :panda_cms_page, constraints: constraints
|
|
106
|
-
|
|
107
|
-
root to: "panda/cms/pages#root"
|
|
108
|
-
end
|
|
109
|
-
end
|
|
110
|
-
|
|
111
|
-
initializer "#{engine_name}.backtrace_cleaner" do |_app|
|
|
112
|
-
engine_root_regex = Regexp.escape(root.to_s + File::SEPARATOR)
|
|
113
|
-
|
|
114
|
-
# Clean those ERB lines, we don't need the internal autogenerated
|
|
115
|
-
# ERB method, what we do need (line number in ERB file) is already there
|
|
116
|
-
Rails.backtrace_cleaner.add_filter do |line|
|
|
117
|
-
line.sub(/(\.erb:\d+):in `__.*$/, '\\1')
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
# Remove our own engine's path prefix, even if it's
|
|
121
|
-
# being used from a local path rather than the gem directory.
|
|
122
|
-
Rails.backtrace_cleaner.add_filter do |line|
|
|
123
|
-
line.sub(/^#{engine_root_regex}/, "#{engine_name} ")
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
# Keep Umlaut's own stacktrace in the backtrace -- we have to remove Rails
|
|
127
|
-
# silencers and re-add them how we want.
|
|
128
|
-
Rails.backtrace_cleaner.remove_silencers!
|
|
129
|
-
|
|
130
|
-
# Silence what Rails silenced, UNLESS it looks like
|
|
131
|
-
# it's from Umlaut engine
|
|
132
|
-
Rails.backtrace_cleaner.add_silencer do |line|
|
|
133
|
-
(line !~ Rails::BacktraceCleaner::APP_DIRS_PATTERN) &&
|
|
134
|
-
(line !~ /^#{engine_root_regex}/) &&
|
|
135
|
-
(line !~ /^#{engine_name} /)
|
|
136
|
-
end
|
|
137
|
-
end
|
|
138
|
-
|
|
139
|
-
# Set up ViewComponent
|
|
140
|
-
initializer "panda.cms.view_component" do |app|
|
|
141
|
-
app.config.view_component.preview_paths ||= []
|
|
142
|
-
app.config.view_component.preview_paths << root.join("spec/components/previews")
|
|
143
|
-
app.config.view_component.generate.sidecar = true
|
|
144
|
-
app.config.view_component.generate.preview = true
|
|
145
|
-
|
|
146
|
-
# Add preview directories to autoload paths in development
|
|
147
|
-
if Rails.env.development?
|
|
148
|
-
# Handle frozen autoload_paths array
|
|
149
|
-
if app.config.autoload_paths.frozen?
|
|
150
|
-
app.config.autoload_paths = app.config.autoload_paths.dup
|
|
151
|
-
end
|
|
152
|
-
app.config.autoload_paths << root.join("spec/components/previews")
|
|
153
|
-
end
|
|
154
|
-
end
|
|
155
|
-
|
|
156
|
-
# Authentication is now handled by Panda::Core::Engine
|
|
157
|
-
|
|
158
|
-
# Configure Core for CMS (runs before app initializers so apps can override)
|
|
159
|
-
initializer "panda.cms.configure_core", before: :load_config_initializers do |app|
|
|
160
|
-
Panda::Core.configure do |config|
|
|
161
|
-
# Core now provides the admin interface foundation
|
|
162
|
-
# Apps using CMS can customize login_logo_path, login_page_title, etc. in their own initializers
|
|
163
|
-
|
|
164
|
-
# Register CMS navigation items
|
|
165
|
-
config.admin_navigation_items = ->(user) {
|
|
166
|
-
items = []
|
|
167
|
-
|
|
168
|
-
# Dashboard
|
|
169
|
-
items << {
|
|
170
|
-
path: "#{config.admin_path}/cms",
|
|
171
|
-
label: "Dashboard",
|
|
172
|
-
icon: "fa-solid fa-house"
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
# Pages
|
|
176
|
-
items << {
|
|
177
|
-
path: "#{config.admin_path}/cms/pages",
|
|
178
|
-
label: "Pages",
|
|
179
|
-
icon: "fa-solid fa-file"
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
# Collections (if enabled)
|
|
183
|
-
if Panda::CMS::Features.enabled?(:collections)
|
|
184
|
-
items << {
|
|
185
|
-
path: "#{config.admin_path}/cms/collections",
|
|
186
|
-
label: "Collections",
|
|
187
|
-
icon: "fa-solid fa-table-cells"
|
|
188
|
-
}
|
|
189
|
-
end
|
|
190
|
-
|
|
191
|
-
# Posts
|
|
192
|
-
items << {
|
|
193
|
-
path: "#{config.admin_path}/cms/posts",
|
|
194
|
-
label: "Posts",
|
|
195
|
-
icon: "fa-solid fa-newspaper"
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
# Forms
|
|
199
|
-
items << {
|
|
200
|
-
path: "#{config.admin_path}/cms/forms",
|
|
201
|
-
label: "Forms",
|
|
202
|
-
icon: "fa-solid fa-inbox"
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
# Files
|
|
206
|
-
items << {
|
|
207
|
-
path: "#{config.admin_path}/cms/files",
|
|
208
|
-
label: "Files",
|
|
209
|
-
icon: "fa-solid fa-image"
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
# Menus
|
|
213
|
-
items << {
|
|
214
|
-
path: "#{config.admin_path}/cms/menus",
|
|
215
|
-
label: "Menus",
|
|
216
|
-
icon: "fa-solid fa-bars"
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
# Settings
|
|
220
|
-
items << {
|
|
221
|
-
path: "#{config.admin_path}/cms/settings",
|
|
222
|
-
label: "Settings",
|
|
223
|
-
icon: "fa-solid fa-gear"
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
items
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
# Redirect to CMS dashboard after login
|
|
230
|
-
# Apps can override this if they want different behavior
|
|
231
|
-
config.dashboard_redirect_path = -> { "#{Panda::Core.config.admin_path}/cms" }
|
|
232
|
-
|
|
233
|
-
# Customize initial breadcrumb
|
|
234
|
-
config.initial_admin_breadcrumb = ->(controller) {
|
|
235
|
-
# Use CMS dashboard path - just use the string path
|
|
236
|
-
["Admin", "#{config.admin_path}/cms"]
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
# Dashboard widgets
|
|
240
|
-
config.admin_dashboard_widgets = ->(user) {
|
|
241
|
-
widgets = []
|
|
242
|
-
|
|
243
|
-
# TODO: Add CMS statistics widgets when StatisticsComponent is implemented
|
|
244
|
-
# This was removed along with Pro code migration
|
|
245
|
-
|
|
246
|
-
widgets
|
|
247
|
-
}
|
|
248
|
-
end
|
|
40
|
+
initializer "panda.cms.static_assets", after: :load_config_initializers do |app|
|
|
41
|
+
app.config.middleware.insert_before Rack::Sendfile, Rack::Static,
|
|
42
|
+
urls: ["/panda-cms-assets"],
|
|
43
|
+
root: Panda::CMS::Engine.root.join("public")
|
|
249
44
|
end
|
|
250
45
|
end
|
|
251
46
|
|
|
252
47
|
class MissingBlockError < StandardError; end
|
|
253
|
-
|
|
254
48
|
class BlockError < StandardError; end
|
|
255
49
|
end
|
|
256
50
|
end
|
|
51
|
+
|
|
52
|
+
Panda::Core::ModuleRegistry.register(
|
|
53
|
+
gem_name: "panda-cms",
|
|
54
|
+
engine: "Panda::CMS::Engine",
|
|
55
|
+
paths: {
|
|
56
|
+
views: "app/views/panda/cms/**/*.erb",
|
|
57
|
+
components: "app/components/panda/cms/**/*.rb",
|
|
58
|
+
stylesheets: "app/assets/tailwind/panda/cms/**/*.css"
|
|
59
|
+
}
|
|
60
|
+
)
|
data/lib/panda/cms.rb
CHANGED
data/lib/panda-cms.rb
CHANGED
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
require "rubygems"
|
|
4
4
|
require "panda/core"
|
|
5
5
|
require "panda/cms/railtie"
|
|
6
|
-
require "view_component"
|
|
7
6
|
|
|
8
7
|
module Panda
|
|
9
8
|
module CMS
|
|
10
9
|
class Configuration
|
|
11
10
|
attr_accessor :title, :require_login_to_view, :authentication,
|
|
12
|
-
:posts, :url, :instagram, :analytics
|
|
11
|
+
:posts, :url, :instagram, :analytics, :performance
|
|
13
12
|
|
|
14
13
|
def initialize
|
|
15
14
|
@title = "Demo Site"
|
|
@@ -28,6 +27,21 @@ module Panda
|
|
|
28
27
|
tracking_id: nil
|
|
29
28
|
}
|
|
30
29
|
}
|
|
30
|
+
@performance = {
|
|
31
|
+
http_caching: {
|
|
32
|
+
enabled: true,
|
|
33
|
+
public: true
|
|
34
|
+
},
|
|
35
|
+
fragment_caching: {
|
|
36
|
+
enabled: true,
|
|
37
|
+
expires_in: 1.hour
|
|
38
|
+
},
|
|
39
|
+
cache_store: {
|
|
40
|
+
type: :memory_store, # :memory_store, :redis_cache_store, :file_store
|
|
41
|
+
redis_url: ENV.fetch("REDIS_URL", "redis://localhost:6379/0"),
|
|
42
|
+
namespace: "panda_cms"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
31
45
|
end
|
|
32
46
|
end
|
|
33
47
|
|
|
@@ -64,6 +78,9 @@ module Panda
|
|
|
64
78
|
Panda::Core.config.admin_path
|
|
65
79
|
end
|
|
66
80
|
end
|
|
81
|
+
|
|
82
|
+
# Store the engine's importmap separately from the app's
|
|
83
|
+
mattr_accessor :importmap
|
|
67
84
|
end
|
|
68
85
|
end
|
|
69
86
|
|
|
@@ -81,13 +98,17 @@ Panda::CMS.loader.push_dir(File.expand_path("panda/cms", __dir__), namespace: Pa
|
|
|
81
98
|
Panda::CMS.loader.ignore(__dir__.to_s)
|
|
82
99
|
Panda::CMS.loader.ignore(File.expand_path("panda", __dir__))
|
|
83
100
|
|
|
101
|
+
# Ignore version.rb since it's manually required and defines VERSION constant
|
|
102
|
+
# rather than a Version class that zeitwerk would expect
|
|
103
|
+
Panda::CMS.loader.ignore(File.expand_path("panda/cms/version.rb", __dir__))
|
|
104
|
+
|
|
84
105
|
# Configure Zeitwerk inflections
|
|
85
106
|
Panda::CMS.loader.inflector.inflect(
|
|
86
107
|
"cms" => "CMS"
|
|
87
108
|
)
|
|
88
109
|
|
|
89
110
|
# Manually require files from panda-cms directory
|
|
90
|
-
require_relative "panda
|
|
111
|
+
require_relative "panda/cms/version"
|
|
91
112
|
require_relative "panda/cms/debug"
|
|
92
113
|
require_relative "panda/cms/exceptions_app"
|
|
93
114
|
require_relative "panda/cms/engine"
|
data/lib/tasks/ci.rake
ADDED
|
File without changes
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: panda-cms
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.10.
|
|
4
|
+
version: 0.10.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Otaina Limited
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
19
|
+
version: 3.8.0
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version:
|
|
26
|
+
version: 3.8.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: down
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -98,16 +98,16 @@ dependencies:
|
|
|
98
98
|
name: http
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
|
101
|
-
- - "
|
|
101
|
+
- - "~>"
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
|
-
version:
|
|
103
|
+
version: 5.1.1
|
|
104
104
|
type: :runtime
|
|
105
105
|
prerelease: false
|
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
|
108
|
-
- - "
|
|
108
|
+
- - "~>"
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
|
-
version:
|
|
110
|
+
version: 5.1.1
|
|
111
111
|
- !ruby/object:Gem::Dependency
|
|
112
112
|
name: importmap-rails
|
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -248,20 +248,6 @@ dependencies:
|
|
|
248
248
|
- - ">="
|
|
249
249
|
- !ruby/object:Gem::Version
|
|
250
250
|
version: '0'
|
|
251
|
-
- !ruby/object:Gem::Dependency
|
|
252
|
-
name: view_component
|
|
253
|
-
requirement: !ruby/object:Gem::Requirement
|
|
254
|
-
requirements:
|
|
255
|
-
- - ">="
|
|
256
|
-
- !ruby/object:Gem::Version
|
|
257
|
-
version: '0'
|
|
258
|
-
type: :runtime
|
|
259
|
-
prerelease: false
|
|
260
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
261
|
-
requirements:
|
|
262
|
-
- - ">="
|
|
263
|
-
- !ruby/object:Gem::Version
|
|
264
|
-
version: '0'
|
|
265
251
|
email:
|
|
266
252
|
- james@otaina.co.uk
|
|
267
253
|
executables: []
|
|
@@ -270,12 +256,9 @@ extra_rdoc_files: []
|
|
|
270
256
|
files:
|
|
271
257
|
- README.md
|
|
272
258
|
- Rakefile
|
|
273
|
-
- app/assets/builds/panda.cms.css
|
|
274
259
|
- app/assets/config/panda_cms_manifest.js
|
|
275
|
-
- app/assets/
|
|
276
|
-
- app/
|
|
277
|
-
- app/assets/tailwind/application.css
|
|
278
|
-
- app/assets/tailwind/tailwind.config.js
|
|
260
|
+
- app/assets/tailwind/panda/cms/_application.css
|
|
261
|
+
- app/components/panda/cms/admin/popular_pages_component.rb
|
|
279
262
|
- app/components/panda/cms/code_component.rb
|
|
280
263
|
- app/components/panda/cms/grid_component.rb
|
|
281
264
|
- app/components/panda/cms/menu_component.rb
|
|
@@ -302,28 +285,31 @@ files:
|
|
|
302
285
|
- app/helpers/panda/cms/admin/posts_helper.rb
|
|
303
286
|
- app/helpers/panda/cms/application_helper.rb
|
|
304
287
|
- app/helpers/panda/cms/asset_helper.rb
|
|
288
|
+
- app/helpers/panda/cms/forms_helper.rb
|
|
305
289
|
- app/helpers/panda/cms/pages_helper.rb
|
|
306
290
|
- app/helpers/panda/cms/posts_helper.rb
|
|
291
|
+
- app/helpers/panda/cms/seo_helper.rb
|
|
307
292
|
- app/helpers/panda/cms/theme_helper.rb
|
|
308
293
|
- app/javascript/panda/cms/@editorjs--editorjs.js
|
|
309
294
|
- app/javascript/panda/cms/@hotwired--stimulus.js
|
|
310
295
|
- app/javascript/panda/cms/@hotwired--turbo.js
|
|
311
296
|
- app/javascript/panda/cms/@rails--actioncable--src.js
|
|
312
|
-
- app/javascript/panda/cms/
|
|
297
|
+
- app/javascript/panda/cms/application.js
|
|
313
298
|
- app/javascript/panda/cms/controllers/code_editor_controller.js
|
|
314
299
|
- app/javascript/panda/cms/controllers/dashboard_controller.js
|
|
315
300
|
- app/javascript/panda/cms/controllers/editor_form_controller.js
|
|
316
301
|
- app/javascript/panda/cms/controllers/editor_iframe_controller.js
|
|
317
302
|
- app/javascript/panda/cms/controllers/file_gallery_controller.js
|
|
303
|
+
- app/javascript/panda/cms/controllers/file_upload_controller.js
|
|
318
304
|
- app/javascript/panda/cms/controllers/index.js
|
|
319
305
|
- app/javascript/panda/cms/controllers/inline_code_editor_controller.js
|
|
320
306
|
- app/javascript/panda/cms/controllers/menu_form_controller.js
|
|
321
307
|
- app/javascript/panda/cms/controllers/nested_form_controller.js
|
|
308
|
+
- app/javascript/panda/cms/controllers/page_form_controller.js
|
|
322
309
|
- app/javascript/panda/cms/controllers/slug_controller.js
|
|
323
310
|
- app/javascript/panda/cms/controllers/tree_controller.js
|
|
324
311
|
- app/javascript/panda/cms/stimulus-loading.js
|
|
325
312
|
- app/javascript/panda/cms/tailwindcss-stimulus-components.js
|
|
326
|
-
- app/javascript/panda_cms/stimulus-loading.js
|
|
327
313
|
- app/jobs/panda/cms/application_job.rb
|
|
328
314
|
- app/jobs/panda/cms/record_visit_job.rb
|
|
329
315
|
- app/mailers/panda/cms/application_mailer.rb
|
|
@@ -375,14 +361,13 @@ files:
|
|
|
375
361
|
- app/views/panda/cms/form_mailer/notification_email.html.erb
|
|
376
362
|
- app/views/panda/cms/shared/_editor.html.erb
|
|
377
363
|
- app/views/panda/cms/shared/_favicons.html.erb
|
|
378
|
-
- app/views/panda/cms/shared/_importmap.html.erb
|
|
379
364
|
- app/views/shared/_footer.html.erb
|
|
380
365
|
- app/views/shared/_header.html.erb
|
|
366
|
+
- config/brakeman.ignore
|
|
381
367
|
- config/importmap.rb
|
|
382
|
-
- config/initializers/
|
|
368
|
+
- config/initializers/groupdate.rb
|
|
383
369
|
- config/initializers/panda/cms.rb
|
|
384
370
|
- config/initializers/panda/cms/form_errors.rb
|
|
385
|
-
- config/initializers/panda/cms/healthcheck_log_silencer.rb.disabled
|
|
386
371
|
- config/initializers/zeitwork.rb
|
|
387
372
|
- config/locales/en.yml
|
|
388
373
|
- config/puma/test.rb
|
|
@@ -404,16 +389,10 @@ files:
|
|
|
404
389
|
- db/migrate/20240316212822_add_kind_to_panda_cms_menus.rb
|
|
405
390
|
- db/migrate/20240316221425_add_start_page_to_panda_cms_menus.rb
|
|
406
391
|
- db/migrate/20240316230706_add_nested_to_panda_cms_menu_items.rb
|
|
407
|
-
- db/migrate/20240317010532_create_panda_cms_users.rb
|
|
408
392
|
- db/migrate/20240317161534_add_max_uses_to_panda_cms_template.rb
|
|
409
393
|
- db/migrate/20240317163053_reset_counter_cache_on_panda_cms_template.rb
|
|
410
394
|
- db/migrate/20240317214827_create_panda_cms_redirects.rb
|
|
411
395
|
- db/migrate/20240317230622_create_panda_cms_visits.rb
|
|
412
|
-
- db/migrate/20240324205703_create_active_storage_tables.active_storage.rb
|
|
413
|
-
- db/migrate/20240408084718_default_panda_cms_users_admin_to_false.rb
|
|
414
|
-
- db/migrate/20240701225422_add_service_name_to_active_storage_blobs.active_storage.rb
|
|
415
|
-
- db/migrate/20240701225423_create_active_storage_variant_records.active_storage.rb
|
|
416
|
-
- db/migrate/20240701225424_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb
|
|
417
396
|
- db/migrate/20240804235210_create_panda_cms_forms.rb
|
|
418
397
|
- db/migrate/20240805013612_create_panda_cms_form_submissions.rb
|
|
419
398
|
- db/migrate/20240805121123_create_panda_cms_posts.rb
|
|
@@ -423,7 +402,6 @@ files:
|
|
|
423
402
|
- db/migrate/20240820081917_change_form_submissions_to_submission_count.rb
|
|
424
403
|
- db/migrate/20240923234535_add_depth_to_panda_cms_menus.rb
|
|
425
404
|
- db/migrate/20241031205109_add_cached_content_to_panda_cms_block_contents.rb
|
|
426
|
-
- db/migrate/20241119214548_convert_post_content_to_editor_js.rb
|
|
427
405
|
- db/migrate/20241120000419_remove_post_tag_references.rb
|
|
428
406
|
- db/migrate/20241120110943_add_editor_js_to_posts.rb
|
|
429
407
|
- db/migrate/20241120113859_add_cached_content_to_panda_cms_posts.rb
|
|
@@ -431,28 +409,39 @@ files:
|
|
|
431
409
|
- db/migrate/20250106223303_add_author_id_to_panda_cms_posts.rb
|
|
432
410
|
- db/migrate/20250120235542_remove_paper_trail.rb
|
|
433
411
|
- db/migrate/20250126234001_create_panda_social_instagram_posts.rb
|
|
434
|
-
- db/migrate/20250809231125_migrate_users_to_panda_core.rb
|
|
435
412
|
- db/migrate/20250811111000_make_post_user_references_nullable.rb
|
|
436
413
|
- db/migrate/20251104150640_add_cached_last_updated_at_to_panda_cms_pages.rb
|
|
437
414
|
- db/migrate/20251104172242_add_page_type_to_panda_cms_pages.rb
|
|
438
415
|
- db/migrate/20251104172638_set_page_types_for_existing_pages.rb
|
|
439
|
-
- db/migrate/20251105000001_add_pending_review_status_to_pages_and_posts.
|
|
416
|
+
- db/migrate/20251105000001_add_pending_review_status_to_pages_and_posts.rb
|
|
417
|
+
- db/migrate/20251109131150_add_seo_fields_to_pages.rb
|
|
418
|
+
- db/migrate/20251109131205_add_seo_fields_to_posts.rb
|
|
419
|
+
- db/migrate/20251110114258_add_spam_tracking_to_form_submissions.rb
|
|
420
|
+
- db/migrate/20251110122812_add_performance_indexes_to_pages_and_redirects.rb
|
|
421
|
+
- db/migrate/20251117234530_add_index_to_visited_at_on_panda_cms_visits.rb
|
|
422
|
+
- db/migrate/20251118015100_backfill_visited_at_for_existing_visits.rb
|
|
440
423
|
- db/migrate/migrate
|
|
441
424
|
- db/seeds.rb
|
|
442
|
-
- lib/generators/panda/cms/install_generator.rb
|
|
443
425
|
- lib/panda-cms.rb
|
|
444
|
-
- lib/panda-cms/version.rb
|
|
445
426
|
- lib/panda/cms.rb
|
|
446
427
|
- lib/panda/cms/asset_loader.rb
|
|
447
428
|
- lib/panda/cms/bulk_editor.rb
|
|
448
429
|
- lib/panda/cms/debug.rb
|
|
449
430
|
- lib/panda/cms/demo_site_generator.rb
|
|
450
431
|
- lib/panda/cms/engine.rb
|
|
432
|
+
- lib/panda/cms/engine/asset_config.rb
|
|
433
|
+
- lib/panda/cms/engine/autoload_config.rb
|
|
434
|
+
- lib/panda/cms/engine/backtrace_config.rb
|
|
435
|
+
- lib/panda/cms/engine/core_config.rb
|
|
436
|
+
- lib/panda/cms/engine/helper_config.rb
|
|
437
|
+
- lib/panda/cms/engine/route_config.rb
|
|
438
|
+
- lib/panda/cms/engine/view_component_config.rb
|
|
451
439
|
- lib/panda/cms/exceptions_app.rb
|
|
452
440
|
- lib/panda/cms/features.rb
|
|
453
441
|
- lib/panda/cms/railtie.rb
|
|
454
442
|
- lib/panda/cms/slug.rb
|
|
455
|
-
- lib/
|
|
443
|
+
- lib/panda/cms/version.rb
|
|
444
|
+
- lib/tasks/ci.rake
|
|
456
445
|
- lib/tasks/panda/cms/install.rake
|
|
457
446
|
- lib/tasks/panda/cms/migrations.rake
|
|
458
447
|
- lib/tasks/panda/social/instagram.rake
|
|
@@ -464,30 +453,6 @@ files:
|
|
|
464
453
|
- lib/templates/erb/scaffold/new.html.erb.tt
|
|
465
454
|
- lib/templates/erb/scaffold/partial.html.erb.tt
|
|
466
455
|
- lib/templates/erb/scaffold/show.html.erb.tt
|
|
467
|
-
- public/panda-cms-assets/editor-js/core/editorjs.min.js
|
|
468
|
-
- public/panda-cms-assets/editor-js/plugins/embed.min.js
|
|
469
|
-
- public/panda-cms-assets/editor-js/plugins/header.min.js
|
|
470
|
-
- public/panda-cms-assets/editor-js/plugins/nested-list.min.js
|
|
471
|
-
- public/panda-cms-assets/editor-js/plugins/paragraph.min.js
|
|
472
|
-
- public/panda-cms-assets/editor-js/plugins/quote.min.js
|
|
473
|
-
- public/panda-cms-assets/editor-js/plugins/simple-image.min.js
|
|
474
|
-
- public/panda-cms-assets/editor-js/plugins/table.min.js
|
|
475
|
-
- public/panda-cms-assets/favicons/android-chrome-192x192.png
|
|
476
|
-
- public/panda-cms-assets/favicons/android-chrome-512x512.png
|
|
477
|
-
- public/panda-cms-assets/favicons/apple-touch-icon.png
|
|
478
|
-
- public/panda-cms-assets/favicons/browserconfig.xml
|
|
479
|
-
- public/panda-cms-assets/favicons/favicon-16x16.png
|
|
480
|
-
- public/panda-cms-assets/favicons/favicon-32x32.png
|
|
481
|
-
- public/panda-cms-assets/favicons/favicon.ico
|
|
482
|
-
- public/panda-cms-assets/favicons/mstile-150x150.png
|
|
483
|
-
- public/panda-cms-assets/favicons/safari-pinned-tab.svg
|
|
484
|
-
- public/panda-cms-assets/favicons/site.webmanifest
|
|
485
|
-
- public/panda-cms-assets/manifest.json
|
|
486
|
-
- public/panda-cms-assets/panda-cms-0.7.4.css
|
|
487
|
-
- public/panda-cms-assets/panda-cms-0.7.4.js
|
|
488
|
-
- public/panda-cms-assets/panda-logo-screenprint.png
|
|
489
|
-
- public/panda-cms-assets/panda-nav.png
|
|
490
|
-
- public/panda-cms-assets/rich_text_editor.css
|
|
491
456
|
homepage: https://pandacms.io
|
|
492
457
|
licenses:
|
|
493
458
|
- BSD-3-Clause
|