pages_core 3.12.3 → 3.12.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/assets/builds/pages_core/admin-dist.js +1 -44
- data/app/assets/builds/pages_core/admin-dist.js.map +3 -3
- data/app/assets/builds/pages_core/admin.css +79 -46
- data/app/assets/stylesheets/pages_core/admin/components/attachments.css +3 -4
- data/app/assets/stylesheets/pages_core/admin/components/forms.css +17 -16
- data/app/assets/stylesheets/pages_core/admin/components/image_editor.css +8 -4
- data/app/assets/stylesheets/pages_core/admin/components/image_grid.css +1 -1
- data/app/assets/stylesheets/pages_core/admin/components/list_table.css +11 -3
- data/app/assets/stylesheets/pages_core/admin/components/modal.css +9 -5
- data/app/assets/stylesheets/pages_core/admin/components/page_tree.css +5 -1
- data/app/assets/stylesheets/pages_core/admin/components/toast.css +2 -2
- data/app/assets/stylesheets/pages_core/admin/controllers/pages.css +4 -2
- data/app/assets/stylesheets/pages_core/admin/vars.css +2 -1
- data/app/controllers/admin/calendars_controller.rb +2 -2
- data/app/controllers/admin/categories_controller.rb +3 -3
- data/app/controllers/admin/news_controller.rb +6 -6
- data/app/controllers/admin/pages_controller.rb +12 -11
- data/app/controllers/admin/users_controller.rb +1 -1
- data/app/controllers/concerns/pages_core/preview_pages_controller.rb +15 -17
- data/app/controllers/pages_core/admin_controller.rb +2 -2
- data/app/controllers/pages_core/base_controller.rb +1 -8
- data/app/controllers/pages_core/frontend/pages_controller.rb +13 -5
- data/app/controllers/pages_core/frontend_controller.rb +12 -7
- data/app/helpers/admin/menu_helper.rb +2 -0
- data/app/helpers/admin/pages_helper.rb +1 -4
- data/app/helpers/pages_core/admin/admin_helper.rb +0 -1
- data/app/helpers/pages_core/admin/content_tabs_helper.rb +9 -2
- data/app/helpers/pages_core/application_helper.rb +2 -3
- data/app/helpers/pages_core/frontend_helper.rb +1 -1
- data/app/helpers/pages_core/head_tags_helper.rb +15 -46
- data/app/helpers/pages_core/images_helper.rb +76 -21
- data/app/helpers/pages_core/locales_helper.rb +9 -0
- data/app/helpers/pages_core/open_graph_tags_helper.rb +3 -5
- data/app/helpers/pages_core/page_path_helper.rb +1 -1
- data/app/javascript/components/Attachments/Attachment.tsx +55 -52
- data/app/javascript/components/Attachments/AttachmentEditor.tsx +45 -50
- data/app/javascript/components/Attachments/Placeholder.tsx +1 -2
- data/app/javascript/components/Attachments.jsx +69 -57
- data/app/javascript/components/DateRangeSelect.jsx +94 -54
- data/app/javascript/components/EditableImage.tsx +20 -16
- data/app/javascript/components/FileUploadButton.tsx +12 -12
- data/app/javascript/components/ImageCropper/FocalPoint.tsx +22 -20
- data/app/javascript/components/ImageCropper/Image.tsx +20 -16
- data/app/javascript/components/ImageCropper/Toolbar.tsx +35 -27
- data/app/javascript/components/ImageCropper/useCrop.ts +105 -91
- data/app/javascript/components/ImageCropper.tsx +34 -25
- data/app/javascript/components/ImageEditor/Form.tsx +32 -43
- data/app/javascript/components/ImageEditor.tsx +29 -21
- data/app/javascript/components/ImageGrid/DragElement.tsx +6 -4
- data/app/javascript/components/ImageGrid/GridImage.tsx +56 -52
- data/app/javascript/components/ImageGrid/Placeholder.tsx +1 -1
- data/app/javascript/components/ImageGrid.jsx +132 -101
- data/app/javascript/components/ImageUploader.tsx +59 -55
- data/app/javascript/components/Modal.tsx +2 -4
- data/app/javascript/components/PageDates.jsx +25 -20
- data/app/javascript/components/PageFiles.jsx +7 -5
- data/app/javascript/components/PageImages.tsx +9 -7
- data/app/javascript/components/PageTree/Draggable.tsx +46 -40
- data/app/javascript/components/PageTree/Node.tsx +111 -95
- data/app/javascript/components/PageTree/types.ts +9 -9
- data/app/javascript/components/PageTree.tsx +44 -29
- data/app/javascript/components/RichTextArea.jsx +51 -37
- data/app/javascript/components/RichTextToolbarButton.tsx +8 -5
- data/app/javascript/components/TagEditor/AddTagForm.tsx +11 -10
- data/app/javascript/components/TagEditor/Tag.tsx +10 -8
- data/app/javascript/components/TagEditor.tsx +15 -10
- data/app/javascript/components/Toast.tsx +3 -7
- data/app/javascript/components/drag/draggedOrder.ts +17 -16
- data/app/javascript/components/drag/types.ts +12 -12
- data/app/javascript/components/drag/useDragCollection.ts +36 -42
- data/app/javascript/components/drag/useDragUploader.ts +3 -2
- data/app/javascript/components/drag.ts +5 -4
- data/app/javascript/controllers/LoginController.ts +0 -1
- data/app/javascript/controllers/MainController.ts +6 -2
- data/app/javascript/controllers/PageOptionsController.js +7 -2
- data/app/javascript/features/RichText.tsx +9 -7
- data/app/javascript/index.ts +5 -3
- data/app/javascript/lib/Tree.ts +27 -24
- data/app/javascript/lib/copyToClipboard.ts +5 -4
- data/app/javascript/lib/readyHandler.ts +4 -4
- data/app/javascript/lib/request.ts +7 -3
- data/app/javascript/stores/useModalStore.ts +3 -3
- data/app/javascript/stores/useToastStore.ts +14 -12
- data/app/javascript/types.ts +22 -22
- data/app/models/concerns/pages_core/page_model/templateable.rb +1 -1
- data/app/views/admin/calendars/show.html.erb +1 -1
- data/app/views/admin/news/index.html.erb +1 -1
- data/app/views/admin/pages/_edit_files.html.erb +1 -1
- data/app/views/admin/pages/_edit_images.html.erb +1 -1
- data/app/views/admin/pages/_list_item.html.erb +1 -1
- data/app/views/admin/pages/_search_bar.html.erb +1 -1
- data/app/views/admin/pages/deleted.html.erb +2 -2
- data/app/views/admin/pages/edit.html.erb +3 -3
- data/app/views/admin/pages/index.html.erb +4 -4
- data/app/views/admin/pages/new.html.erb +1 -1
- data/app/views/admin/pages/search.html.erb +3 -3
- data/app/views/feeds/pages.rss.builder +2 -2
- data/app/views/layouts/admin/_page_header.html.erb +4 -4
- data/app/views/layouts/admin.html.erb +1 -2
- data/config/locales/en.yml +1 -0
- data/lib/pages_core/pages_plugin.rb +5 -3
- data/lib/rails/generators/pages_core/frontend/templates/application.html.erb +15 -13
- data/lib/tasks/pages/reports.rake +26 -0
- metadata +32 -4
- data/app/helpers/pages_core/admin/deprecated_admin_helper.rb +0 -40
- data/app/views/pages_core/_google_analytics.html.erb +0 -8
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<% content_for :page_description do %>
|
4
4
|
All pages /
|
5
|
-
<%= link_to("Deleted pages", deleted_admin_pages_path(
|
5
|
+
<%= link_to("Deleted pages", deleted_admin_pages_path(content_locale)) %>
|
6
6
|
<% end %>
|
7
7
|
|
8
8
|
<% content_for :page_description_links do %>
|
@@ -13,12 +13,12 @@
|
|
13
13
|
locals: { query: search_query }) %>
|
14
14
|
|
15
15
|
<div class="content">
|
16
|
-
<% cache Page.visible.roots.to_a + [current_user,
|
16
|
+
<% cache Page.visible.roots.to_a + [current_user, content_locale] do %>
|
17
17
|
<%= react_component(
|
18
18
|
"PageTree", {
|
19
19
|
pages: @pages.map { |p| page_json(p) },
|
20
|
-
locale:
|
21
|
-
dir: locale_direction(
|
20
|
+
locale: content_locale,
|
21
|
+
dir: locale_direction(content_locale),
|
22
22
|
permissions: [(:create if policy(Page).create?)] }
|
23
23
|
) %>
|
24
24
|
<% end %>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<%= render(partial: "admin/pages/search_bar",
|
12
12
|
locals: { query: search_query }) %>
|
13
13
|
|
14
|
-
<% if @search_documents
|
14
|
+
<% if @search_documents&.any? %>
|
15
15
|
<table class="list calendar-item-list">
|
16
16
|
<tr>
|
17
17
|
<th>Name</th>
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<td class="name">
|
25
25
|
<%= link_to_if(policy(page).edit?,
|
26
26
|
page_name(page),
|
27
|
-
edit_admin_page_url(
|
27
|
+
edit_admin_page_url(content_locale, page),
|
28
28
|
class: 'name_link') %>
|
29
29
|
<%= autopublish_notice(page) %>
|
30
30
|
</td>
|
@@ -45,7 +45,7 @@
|
|
45
45
|
<% end %>
|
46
46
|
</table>
|
47
47
|
<%= will_paginate(@search_documents, renderer: PagesCore::LinkRenderer) %>
|
48
|
-
<%
|
48
|
+
<% elsif @search_documents %>
|
49
49
|
<div class="content">
|
50
50
|
<p>
|
51
51
|
Found no results for your search query.
|
@@ -12,11 +12,11 @@ xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do
|
|
12
12
|
@items.each do |item|
|
13
13
|
xml.item do
|
14
14
|
xml.title { xml.cdata! item.name.to_s }
|
15
|
-
xml.link page_url(
|
15
|
+
xml.link page_url(content_locale, item, only_path: false)
|
16
16
|
xml.description do
|
17
17
|
xml.cdata! item.excerpt.to_html + item.body.to_html
|
18
18
|
end
|
19
|
-
xml.guid page_url(
|
19
|
+
xml.guid page_url(content_locale, item, only_path: false)
|
20
20
|
xml.pubDate item.published_at.to_fs(:rfc822)
|
21
21
|
xml.tag!("dc:creator", item.author.name)
|
22
22
|
if item.image
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<% if content_for?(:page_description) ||
|
2
|
-
<div class="page-description"<% if
|
1
|
+
<% if content_for?(:page_description) || content_tabs? %>
|
2
|
+
<div class="page-description"<% if content_tabs? %> class="with_content_tabs"<% end %>>
|
3
3
|
<% if content_for?(:page_description_links) %>
|
4
4
|
<div class="links">
|
5
5
|
<%= content_for(:page_description_links) %>
|
@@ -8,10 +8,10 @@
|
|
8
8
|
<h3>
|
9
9
|
<%= content_for(:page_description) || content_for(:page_title) %>
|
10
10
|
</h3>
|
11
|
-
<% if
|
11
|
+
<% if content_tabs? %>
|
12
12
|
<ul class="content-tabs"
|
13
13
|
role="tablist">
|
14
|
-
<%
|
14
|
+
<% content_tabs.map do |t| %>
|
15
15
|
<li id="content-tab-link-<%= t[:key] %>"
|
16
16
|
data-tab="<%= t[:key] %>"
|
17
17
|
data-main-target="link">
|
@@ -31,13 +31,12 @@
|
|
31
31
|
<%= csrf_meta_tag %>
|
32
32
|
<meta name="viewport"
|
33
33
|
content="width=device-width, initial-scale=1, user-scalable=no">
|
34
|
-
<%= google_analytics_tags "UA-5468672-21" %>
|
35
34
|
</head>
|
36
35
|
|
37
36
|
<body class="<%= content_for(:body_class) %>"
|
38
37
|
data-controller="<%= controller.class.to_s %>"
|
39
38
|
data-action="<%= controller.action_name %>"
|
40
|
-
data-locale="<%=
|
39
|
+
data-locale="<%= content_locale %>">
|
41
40
|
|
42
41
|
<div class="wrapper">
|
43
42
|
<%= render partial: "layouts/admin/header" %>
|
data/config/locales/en.yml
CHANGED
@@ -34,6 +34,7 @@ en:
|
|
34
34
|
invalid_request: Invalid password reset request
|
35
35
|
not_found: Couldn't find a user with that email address
|
36
36
|
sent: An email with further instructions has been sent
|
37
|
+
problems_saving: There were problems saving your changes
|
37
38
|
templates:
|
38
39
|
default:
|
39
40
|
blocks:
|
@@ -15,15 +15,17 @@ module PagesCore
|
|
15
15
|
|
16
16
|
paths["db/migrate"] = "db/migrate"
|
17
17
|
|
18
|
-
admin_menu_item "News",
|
18
|
+
admin_menu_item "News", proc { admin_news_index_path(content_locale) },
|
19
|
+
:pages,
|
19
20
|
if: proc { Page.news_pages.any? },
|
20
21
|
current: proc { @page && @page.parent.try(&:news_page?) }
|
21
22
|
|
22
|
-
admin_menu_item "Calendar", proc { admin_calendar_path(
|
23
|
+
admin_menu_item "Calendar", proc { admin_calendar_path(content_locale) },
|
24
|
+
:pages,
|
23
25
|
if: proc { Page.with_dates.any? },
|
24
26
|
current: proc { @page && @page.starts_at? }
|
25
27
|
|
26
|
-
admin_menu_item "Pages", proc { admin_pages_path(
|
28
|
+
admin_menu_item "Pages", proc { admin_pages_path(content_locale) }, :pages
|
27
29
|
|
28
30
|
admin_menu_item "Users", proc { admin_users_path }, :account
|
29
31
|
end
|
@@ -1,14 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<%=
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
<
|
9
|
-
<% if Rails.env.development? %>
|
10
|
-
<div class="grid-overlay"></div>
|
1
|
+
<!doctype html>
|
2
|
+
<%= tag.html(lang: locale) do %>
|
3
|
+
<%= head_tag do %>
|
4
|
+
<%# default_meta_image "/images/facebook-share.png" %>
|
5
|
+
<%= stylesheet_link_tag "application" %>
|
6
|
+
<%= javascript_include_tag "application" %>
|
7
|
+
<%= feed_tags %>
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
11
9
|
<% end %>
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
<body>
|
11
|
+
<% if Rails.env.development? %>
|
12
|
+
<div class="grid-overlay"></div>
|
13
|
+
<% end %>
|
14
|
+
<%= yield %>
|
15
|
+
</body>
|
16
|
+
<% end %>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "tty-table"
|
4
|
+
|
5
|
+
namespace :pages do
|
6
|
+
namespace :reports do
|
7
|
+
desc "Template usage report"
|
8
|
+
task templates: :environment do
|
9
|
+
pastel = Pastel.new
|
10
|
+
files = PagesCore::Templates.names
|
11
|
+
rows = (Page.pluck(:template).to_a + files).uniq.sort.map do |t|
|
12
|
+
[t,
|
13
|
+
Page.published.where(template: t).count,
|
14
|
+
Page.where(template: t).count,
|
15
|
+
files.include?(t) ? pastel.green("Yes") : pastel.red("No")]
|
16
|
+
end
|
17
|
+
|
18
|
+
table = TTY::Table.new(
|
19
|
+
%w[Name Published Total File],
|
20
|
+
rows
|
21
|
+
)
|
22
|
+
puts table.render(:unicode, padding: [0, 1, 0, 1])
|
23
|
+
puts " Total: #{rows.length} templates"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pages_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.12.
|
4
|
+
version: 3.12.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Inge Jørgensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: pastel
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: pg_search
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,6 +206,20 @@ dependencies:
|
|
192
206
|
- - "~>"
|
193
207
|
- !ruby/object:Gem::Version
|
194
208
|
version: 4.3.2
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: tty-table
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :runtime
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
195
223
|
- !ruby/object:Gem::Dependency
|
196
224
|
name: typhoeus
|
197
225
|
requirement: !ruby/object:Gem::Requirement
|
@@ -444,7 +472,6 @@ files:
|
|
444
472
|
- app/helpers/pages_core/admin/admin_helper.rb
|
445
473
|
- app/helpers/pages_core/admin/content_tabs_helper.rb
|
446
474
|
- app/helpers/pages_core/admin/date_range_helper.rb
|
447
|
-
- app/helpers/pages_core/admin/deprecated_admin_helper.rb
|
448
475
|
- app/helpers/pages_core/admin/form_builder.rb
|
449
476
|
- app/helpers/pages_core/admin/image_uploads_helper.rb
|
450
477
|
- app/helpers/pages_core/admin/labelled_field_helper.rb
|
@@ -460,6 +487,7 @@ files:
|
|
460
487
|
- app/helpers/pages_core/head_tags_helper.rb
|
461
488
|
- app/helpers/pages_core/images_helper.rb
|
462
489
|
- app/helpers/pages_core/labelled_form_builder.rb
|
490
|
+
- app/helpers/pages_core/locales_helper.rb
|
463
491
|
- app/helpers/pages_core/meta_tags_helper.rb
|
464
492
|
- app/helpers/pages_core/open_graph_tags_helper.rb
|
465
493
|
- app/helpers/pages_core/page_path_helper.rb
|
@@ -621,7 +649,6 @@ files:
|
|
621
649
|
- app/views/layouts/admin/_header.html.erb
|
622
650
|
- app/views/layouts/admin/_page_header.html.erb
|
623
651
|
- app/views/layouts/errors.html.erb
|
624
|
-
- app/views/pages_core/_google_analytics.html.erb
|
625
652
|
- app/views/sitemaps/show.xml.builder
|
626
653
|
- config/locales/en.yml
|
627
654
|
- config/routes.rb
|
@@ -695,6 +722,7 @@ files:
|
|
695
722
|
- lib/tasks/pages/cache.rake
|
696
723
|
- lib/tasks/pages/export.rake
|
697
724
|
- lib/tasks/pages/page_paths.rake
|
725
|
+
- lib/tasks/pages/reports.rake
|
698
726
|
- template.rb
|
699
727
|
homepage: ''
|
700
728
|
licenses: []
|
@@ -1,40 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module PagesCore
|
4
|
-
module Admin
|
5
|
-
module DeprecatedAdminHelper
|
6
|
-
def link_separator
|
7
|
-
ActiveSupport::Deprecation.warn("link_separator is deprecated")
|
8
|
-
|
9
|
-
safe_join [" ", tag.span("|", class: "separator"), " "]
|
10
|
-
end
|
11
|
-
|
12
|
-
def page_description=(description)
|
13
|
-
ActiveSupport::Deprecation.warn(content_helper_deprecation)
|
14
|
-
content_for(:page_description, description.html_safe)
|
15
|
-
end
|
16
|
-
alias page_description page_description=
|
17
|
-
|
18
|
-
def page_description_links=(links)
|
19
|
-
ActiveSupport::Deprecation.warn(content_helper_deprecation)
|
20
|
-
content_for(:page_description_links, links.html_safe)
|
21
|
-
end
|
22
|
-
alias page_description_links page_description_links=
|
23
|
-
|
24
|
-
def page_title=(title)
|
25
|
-
ActiveSupport::Deprecation.warn(content_helper_deprecation)
|
26
|
-
content_for(:page_title, title)
|
27
|
-
end
|
28
|
-
alias page_title page_title=
|
29
|
-
|
30
|
-
private
|
31
|
-
|
32
|
-
def content_helper_deprecation
|
33
|
-
name = caller_locations(1, 1)[0].label
|
34
|
-
replacement = name.gsub(/=$/, "")
|
35
|
-
|
36
|
-
"The #{name} helper is deprecated, use content_for(:#{replacement})"
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
<!-- Global site tag (gtag.js) - Google Analytics -->
|
2
|
-
<script async src="https://www.googletagmanager.com/gtag/js?id=<%= account_id %>"></script>
|
3
|
-
<script>
|
4
|
-
window.dataLayer = window.dataLayer || [];
|
5
|
-
function gtag(){dataLayer.push(arguments);}
|
6
|
-
gtag('js', new Date());
|
7
|
-
gtag('config', '<%= account_id %>', { 'anonymize_ip': true });
|
8
|
-
</script>
|