comfy_middle_seat 4.4.0 → 4.6.0
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/CHANGELOG.md +32 -1
- data/README.md +56 -2
- data/app/assets/javascripts/comfy/admin/cms/cms_tag_completions.js +3 -3
- data/app/controllers/comfy/admin/cms/tag_usage_controller.rb +20 -0
- data/app/helpers/comfy/admin/cms/tag_usage_helper.rb +21 -0
- data/app/models/comfy/cms/layout.rb +1 -1
- data/app/views/comfy/admin/cms/tag_usage/_source.html.haml +2 -0
- data/app/views/comfy/admin/cms/tag_usage/index.html.haml +54 -0
- data/app/views/layouts/comfy/admin/cms/_left.html.haml +3 -0
- data/config/initializers/comfy_middle_seat.rb +3 -3
- data/config/locales/ar.yml +20 -0
- data/config/locales/ca.yml +20 -0
- data/config/locales/cs.yml +20 -0
- data/config/locales/da.yml +20 -0
- data/config/locales/de.yml +20 -0
- data/config/locales/en.yml +20 -0
- data/config/locales/es.yml +20 -0
- data/config/locales/fi.yml +20 -0
- data/config/locales/fr.yml +20 -0
- data/config/locales/gr.yml +20 -0
- data/config/locales/hr.yml +20 -0
- data/config/locales/it.yml +20 -0
- data/config/locales/ja.yml +20 -0
- data/config/locales/nb.yml +20 -0
- data/config/locales/nl.yml +20 -0
- data/config/locales/pl.yml +20 -0
- data/config/locales/pt-BR.yml +20 -0
- data/config/locales/ru.yml +20 -0
- data/config/locales/sk.yml +20 -0
- data/config/locales/sv.yml +20 -0
- data/config/locales/tr.yml +20 -0
- data/config/locales/uk.yml +20 -0
- data/config/locales/zh-CN.yml +20 -0
- data/config/locales/zh-TW.yml +20 -0
- data/lib/comfy_middle_seat/configuration.rb +3 -3
- data/lib/comfy_middle_seat/content/tag_usage.rb +124 -0
- data/lib/comfy_middle_seat/content/tag_usage_report.rb +83 -0
- data/lib/comfy_middle_seat/content/tags/asset.rb +12 -17
- data/lib/comfy_middle_seat/content/tags/helper.rb +1 -1
- data/lib/comfy_middle_seat/content/tags/mixins/file_content.rb +6 -10
- data/lib/comfy_middle_seat/content/tags/partial.rb +3 -3
- data/lib/comfy_middle_seat/content/tags/template.rb +3 -3
- data/lib/comfy_middle_seat/content.rb +2 -0
- data/lib/comfy_middle_seat/routing.rb +1 -0
- data/lib/comfy_middle_seat/version.rb +1 -1
- data/lib/tasks/cms_tag_usage.rake +32 -0
- metadata +8 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
namespace :comfy do
|
|
4
|
+
namespace :cms do
|
|
5
|
+
# The development application and engine share a root, so Rails loads this file twice.
|
|
6
|
+
if Rake::Task.task_defined?('comfy:cms:tag_usage') && Rake::Task['comfy:cms:tag_usage'].actions.any? { |action| action.source_location&.first == __FILE__ }
|
|
7
|
+
next
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
desc 'Inventory CMS partials, helpers and templates (SITE=identifier FORMAT=text|json|config)'
|
|
11
|
+
task tag_usage: :environment do
|
|
12
|
+
format = ENV.fetch('FORMAT', 'text')
|
|
13
|
+
abort 'FORMAT must be text, json or config.' unless %w[text json config].include?(format)
|
|
14
|
+
|
|
15
|
+
sites = Comfy::Cms::Site.all
|
|
16
|
+
scope = 'all_sites'
|
|
17
|
+
if ENV.key?('SITE')
|
|
18
|
+
identifier = ENV.fetch('SITE')
|
|
19
|
+
sites = sites.where(identifier: identifier)
|
|
20
|
+
abort "Unknown site identifier: #{identifier.inspect}" unless sites.exists?
|
|
21
|
+
|
|
22
|
+
scope = 'selected_sites'
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
report = ComfyMiddleSeat::Content::TagUsage.new(sites: sites, scope: scope).call
|
|
26
|
+
output = ComfyMiddleSeat::Content::TagUsageReport.new(report)
|
|
27
|
+
$stdout.puts output.public_send(format)
|
|
28
|
+
output.warnings.each { |warning| warn warning }
|
|
29
|
+
abort 'Tag usage scan incomplete; resolve warnings and scan again.' unless report[:complete]
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: comfy_middle_seat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Oleg Khabarov
|
|
@@ -416,12 +416,14 @@ files:
|
|
|
416
416
|
- app/controllers/comfy/admin/cms/revisions/translation_controller.rb
|
|
417
417
|
- app/controllers/comfy/admin/cms/sites_controller.rb
|
|
418
418
|
- app/controllers/comfy/admin/cms/snippets_controller.rb
|
|
419
|
+
- app/controllers/comfy/admin/cms/tag_usage_controller.rb
|
|
419
420
|
- app/controllers/comfy/admin/cms/translations_controller.rb
|
|
420
421
|
- app/controllers/comfy/cms/assets_controller.rb
|
|
421
422
|
- app/controllers/comfy/cms/base_controller.rb
|
|
422
423
|
- app/controllers/comfy/cms/content_controller.rb
|
|
423
424
|
- app/controllers/concerns/comfy/paginate.rb
|
|
424
425
|
- app/controllers/concerns/comfy/reorder_action.rb
|
|
426
|
+
- app/helpers/comfy/admin/cms/tag_usage_helper.rb
|
|
425
427
|
- app/helpers/comfy/admin/cms_helper.rb
|
|
426
428
|
- app/helpers/comfy/cms_helper.rb
|
|
427
429
|
- app/models/comfy/cms/categorization.rb
|
|
@@ -476,6 +478,8 @@ files:
|
|
|
476
478
|
- app/views/comfy/admin/cms/snippets/edit.html.haml
|
|
477
479
|
- app/views/comfy/admin/cms/snippets/index.html.haml
|
|
478
480
|
- app/views/comfy/admin/cms/snippets/new.html.haml
|
|
481
|
+
- app/views/comfy/admin/cms/tag_usage/_source.html.haml
|
|
482
|
+
- app/views/comfy/admin/cms/tag_usage/index.html.haml
|
|
479
483
|
- app/views/comfy/admin/cms/translations/_form.html.haml
|
|
480
484
|
- app/views/comfy/admin/cms/translations/_sidebar.html.haml
|
|
481
485
|
- app/views/comfy/admin/cms/translations/edit.html.haml
|
|
@@ -578,6 +582,8 @@ files:
|
|
|
578
582
|
- lib/comfy_middle_seat/content/params_parser.rb
|
|
579
583
|
- lib/comfy_middle_seat/content/renderer.rb
|
|
580
584
|
- lib/comfy_middle_seat/content/tag.rb
|
|
585
|
+
- lib/comfy_middle_seat/content/tag_usage.rb
|
|
586
|
+
- lib/comfy_middle_seat/content/tag_usage_report.rb
|
|
581
587
|
- lib/comfy_middle_seat/content/tags.rb
|
|
582
588
|
- lib/comfy_middle_seat/content/tags/asset.rb
|
|
583
589
|
- lib/comfy_middle_seat/content/tags/audio.rb
|
|
@@ -643,6 +649,7 @@ files:
|
|
|
643
649
|
- lib/generators/comfy/scaffold/templates/views/show.haml.tt
|
|
644
650
|
- lib/tasks/cms_assets.rake
|
|
645
651
|
- lib/tasks/cms_seeds.rake
|
|
652
|
+
- lib/tasks/cms_tag_usage.rake
|
|
646
653
|
- package-lock.json
|
|
647
654
|
- package.json
|
|
648
655
|
- public/favicon.ico
|