pages_core 3.14.0 → 3.15.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/VERSION +1 -1
- data/app/assets/builds/pages_core/admin-dist.js +19 -8
- data/app/assets/builds/pages_core/admin-dist.js.map +4 -4
- data/app/assets/builds/pages_core/admin.css +672 -379
- data/app/assets/fonts/Inter-Black.woff2 +0 -0
- data/app/assets/fonts/Inter-BlackItalic.woff2 +0 -0
- data/app/assets/fonts/Inter-Bold.woff2 +0 -0
- data/app/assets/fonts/Inter-BoldItalic.woff2 +0 -0
- data/app/assets/fonts/Inter-ExtraBold.woff2 +0 -0
- data/app/assets/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
- data/app/assets/fonts/Inter-ExtraLight.woff2 +0 -0
- data/app/assets/fonts/Inter-ExtraLightItalic.woff2 +0 -0
- data/app/assets/fonts/Inter-Italic.woff2 +0 -0
- data/app/assets/fonts/Inter-Light.woff2 +0 -0
- data/app/assets/fonts/Inter-LightItalic.woff2 +0 -0
- data/app/assets/fonts/Inter-Medium.woff2 +0 -0
- data/app/assets/fonts/Inter-MediumItalic.woff2 +0 -0
- data/app/assets/fonts/Inter-Regular.woff2 +0 -0
- data/app/assets/fonts/Inter-SemiBold.woff2 +0 -0
- data/app/assets/fonts/Inter-SemiBoldItalic.woff2 +0 -0
- data/app/assets/fonts/Inter-Thin.woff2 +0 -0
- data/app/assets/fonts/Inter-ThinItalic.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-Black.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-BlackItalic.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-Bold.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-BoldItalic.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-ExtraBold.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-ExtraBoldItalic.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-ExtraLight.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-ExtraLightItalic.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-Italic.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-Light.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-LightItalic.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-Medium.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-MediumItalic.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-Regular.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-SemiBold.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-SemiBoldItalic.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-Thin.woff2 +0 -0
- data/app/assets/fonts/InterDisplay-ThinItalic.woff2 +0 -0
- data/app/assets/fonts/InterVariable-Italic.woff2 +0 -0
- data/app/assets/fonts/InterVariable.woff2 +0 -0
- data/app/assets/stylesheets/pages_core/admin/components/archive.css +1 -1
- data/app/assets/stylesheets/pages_core/admin/components/attachments.css +22 -34
- data/app/assets/stylesheets/pages_core/admin/components/base.css +1 -68
- data/app/assets/stylesheets/pages_core/admin/components/forms.css +107 -48
- data/app/assets/stylesheets/pages_core/admin/components/header.css +56 -58
- data/app/assets/stylesheets/pages_core/admin/components/image_editor.css +35 -24
- data/app/assets/stylesheets/pages_core/admin/components/image_grid.css +28 -27
- data/app/assets/stylesheets/pages_core/admin/components/image_uploader.css +5 -5
- data/app/assets/stylesheets/pages_core/admin/components/layout.css +7 -1
- data/app/assets/stylesheets/pages_core/admin/components/list_table.css +24 -15
- data/app/assets/stylesheets/pages_core/admin/components/page_tree.css +63 -104
- data/app/assets/stylesheets/pages_core/admin/components/pagination.css +12 -13
- data/app/assets/stylesheets/pages_core/admin/components/search.css +1 -16
- data/app/assets/stylesheets/pages_core/admin/components/sidebar.css +5 -11
- data/app/assets/stylesheets/pages_core/admin/components/tag_editor.css +22 -36
- data/app/assets/stylesheets/pages_core/admin/components/toast.css +1 -2
- data/app/assets/stylesheets/pages_core/admin/components/toolbar.css +10 -10
- data/app/assets/stylesheets/pages_core/admin/components/totp.css +1 -1
- data/app/assets/stylesheets/pages_core/admin/controllers/pages.css +37 -51
- data/app/assets/stylesheets/pages_core/admin/global/fonts.css +271 -0
- data/app/assets/stylesheets/pages_core/admin/global/typography.css +109 -0
- data/app/assets/stylesheets/pages_core/admin/vars.css +1 -3
- data/app/assets/stylesheets/pages_core/admin.postcss.css +1 -0
- data/app/controllers/admin/account_recoveries_controller.rb +2 -2
- data/app/controllers/admin/pages_controller.rb +22 -42
- data/app/controllers/concerns/pages_core/error_reporting.rb +1 -1
- data/app/controllers/concerns/pages_core/page_parameters.rb +29 -0
- data/app/controllers/concerns/pages_core/policies_helper.rb +1 -1
- data/app/controllers/concerns/pages_core/preview_pages_controller.rb +20 -20
- data/app/controllers/pages_core/admin_controller.rb +0 -2
- data/app/controllers/pages_core/frontend/pages_controller.rb +2 -6
- data/app/formatters/pages_core/html_formatter.rb +2 -4
- data/app/helpers/admin/menu_helper.rb +5 -4
- data/app/helpers/admin/pages_helper.rb +1 -21
- data/app/helpers/pages_core/admin/admin_helper.rb +2 -3
- data/app/helpers/pages_core/admin/content_tabs_helper.rb +1 -2
- data/app/helpers/pages_core/admin/labelled_field_helper.rb +1 -1
- data/app/helpers/pages_core/frontend_helper.rb +1 -1
- data/app/helpers/pages_core/images_helper.rb +10 -8
- data/app/helpers/pages_core/labelled_form_builder.rb +2 -7
- data/app/helpers/pages_core/page_path_helper.rb +1 -1
- data/app/javascript/components/Attachments/Attachment.tsx +20 -18
- data/app/javascript/components/Attachments/AttachmentEditor.tsx +11 -9
- data/app/javascript/components/{Attachments.jsx → Attachments/List.tsx} +58 -63
- data/app/javascript/components/Attachments/useAttachments.ts +15 -0
- data/app/javascript/components/Attachments.tsx +14 -0
- data/app/javascript/components/DateRangeSelect.tsx +105 -0
- data/app/javascript/components/DateTimeSelect.tsx +136 -0
- data/app/javascript/components/EditableImage.tsx +11 -9
- data/app/javascript/components/FileUploadButton.tsx +7 -7
- data/app/javascript/components/ImageCropper/FocalPoint.tsx +9 -12
- data/app/javascript/components/ImageCropper/Image.tsx +10 -8
- data/app/javascript/components/ImageCropper/Toolbar.tsx +11 -12
- data/app/javascript/components/ImageCropper/useCrop.ts +24 -53
- data/app/javascript/components/ImageCropper.tsx +10 -15
- data/app/javascript/components/ImageEditor/Form.tsx +12 -8
- data/app/javascript/components/ImageEditor.tsx +12 -7
- data/app/javascript/components/ImageGrid/DragElement.tsx +9 -12
- data/app/javascript/components/{ImageGrid.jsx → ImageGrid/Grid.tsx} +62 -71
- data/app/javascript/components/ImageGrid/GridImage.tsx +22 -23
- data/app/javascript/components/ImageGrid/Placeholder.tsx +2 -2
- data/app/javascript/components/ImageGrid/useImageGrid.ts +26 -0
- data/app/javascript/components/ImageGrid.tsx +15 -0
- data/app/javascript/components/ImageUploader.tsx +35 -22
- data/app/javascript/components/LabelledField.tsx +34 -0
- data/app/javascript/components/Modal.tsx +2 -2
- data/app/javascript/components/PageForm/Block.tsx +81 -0
- data/app/javascript/components/PageForm/Content.tsx +54 -0
- data/app/javascript/components/PageForm/Dates.tsx +66 -0
- data/app/javascript/components/PageForm/Files.tsx +28 -0
- data/app/javascript/components/PageForm/Form.tsx +41 -0
- data/app/javascript/components/PageForm/Images.tsx +28 -0
- data/app/javascript/components/PageForm/LocaleLinks.tsx +36 -0
- data/app/javascript/components/PageForm/Metadata.tsx +67 -0
- data/app/javascript/components/PageForm/Options.tsx +180 -0
- data/app/javascript/components/PageForm/PageDescription.tsx +48 -0
- data/app/javascript/components/PageForm/PathSegment.tsx +65 -0
- data/app/javascript/components/PageForm/TabPanel.tsx +21 -0
- data/app/javascript/components/PageForm/Tabs.tsx +33 -0
- data/app/javascript/components/PageForm/UnconfiguredContent.tsx +42 -0
- data/app/javascript/components/PageForm/pageParams.ts +95 -0
- data/app/javascript/components/PageForm/preview.ts +23 -0
- data/app/javascript/components/PageForm/usePage.ts +169 -0
- data/app/javascript/components/PageForm/useTabs.ts +46 -0
- data/app/javascript/components/PageForm.tsx +163 -0
- data/app/javascript/components/PageImages.tsx +7 -9
- data/app/javascript/components/PageTree/Draggable.tsx +40 -39
- data/app/javascript/components/PageTree/Node.tsx +62 -56
- data/app/javascript/components/PageTree/PageName.tsx +28 -0
- data/app/javascript/components/PageTree.tsx +65 -53
- data/app/javascript/components/{RichTextArea.jsx → RichTextArea.tsx} +98 -79
- data/app/javascript/components/RichTextToolbarButton.tsx +4 -6
- data/app/javascript/components/TagEditor/AddTagForm.tsx +19 -12
- data/app/javascript/components/TagEditor/Editor.tsx +32 -0
- data/app/javascript/components/TagEditor/Tag.tsx +6 -4
- data/app/javascript/components/TagEditor/useTags.ts +58 -0
- data/app/javascript/components/TagEditor.tsx +8 -58
- data/app/javascript/components/Toast.tsx +3 -3
- data/app/javascript/components/drag/draggedOrder.ts +22 -14
- data/app/javascript/components/drag/useDragCollection.ts +35 -30
- data/app/javascript/components/drag/useDragUploader.ts +32 -21
- data/app/javascript/components/drag/useDraggable.ts +7 -6
- data/app/javascript/components/drag.ts +0 -1
- data/app/javascript/components.ts +1 -3
- data/app/javascript/features/RichText.tsx +2 -3
- data/app/javascript/features/contentTabs.ts +79 -0
- data/app/javascript/index.ts +5 -12
- data/app/javascript/lib/Tree.ts +31 -45
- data/app/javascript/lib/request.ts +11 -11
- data/app/javascript/stores/useToastStore.ts +1 -1
- data/app/javascript/types/Attachments.ts +29 -0
- data/app/javascript/types/Crop.ts +36 -0
- data/app/javascript/types/Drag.ts +34 -0
- data/app/javascript/types/Images.ts +47 -0
- data/app/javascript/types/PageEditor.ts +26 -0
- data/app/javascript/types/Pages.ts +75 -0
- data/app/javascript/types/Tags.ts +9 -0
- data/app/javascript/types/Template.ts +24 -0
- data/app/javascript/types/Trees.ts +19 -0
- data/app/javascript/types.ts +2 -25
- data/app/models/attachment.rb +1 -1
- data/app/models/concerns/pages_core/authenticable_user.rb +63 -0
- data/app/models/concerns/pages_core/emailable.rb +16 -0
- data/app/models/concerns/pages_core/page_model/templateable.rb +2 -16
- data/app/models/invite.rb +2 -6
- data/app/models/otp_secret.rb +4 -4
- data/app/models/page.rb +0 -3
- data/app/models/user.rb +2 -46
- data/app/policies/page_policy.rb +6 -2
- data/app/resources/admin/page_resource.rb +95 -0
- data/app/resources/admin/page_tree_resource.rb +27 -0
- data/app/resources/admin/template_configuration_resource.rb +50 -0
- data/app/views/admin/news/_sidebar.html.erb +2 -4
- data/app/views/admin/news/index.html.erb +0 -1
- data/app/views/admin/pages/_form.html.erb +10 -30
- data/app/views/admin/pages/_search_bar.html.erb +1 -1
- data/app/views/admin/pages/edit.html.erb +1 -57
- data/app/views/admin/pages/index.html.erb +1 -1
- data/app/views/admin/pages/new.html.erb +1 -44
- data/app/views/admin/sessions/new.html.erb +9 -11
- data/app/views/admin/users/_access_control.html.erb +5 -1
- data/app/views/admin/users/_list.html.erb +12 -7
- data/app/views/layouts/admin/_header.html.erb +2 -4
- data/app/views/layouts/admin/_page_header.html.erb +1 -2
- data/app/views/layouts/admin.html.erb +1 -1
- data/config/locales/en.yml +0 -4
- data/config/routes.rb +3 -7
- data/db/migrate/20240126160700_add_2fa_fields.rb +5 -1
- data/db/migrate/20240131140700_change_email_to_citext.rb +18 -0
- data/db/migrate/20240201160700_remove_persistent_data.rb +7 -0
- data/db/migrate/20240508145300_remove_categories.rb +21 -0
- data/lib/pages_core/configuration/base.rb +2 -2
- data/lib/pages_core/templates/configuration.rb +1 -1
- data/lib/pages_core/templates/configuration_proxy.rb +2 -2
- data/lib/pages_core/templates/template_configuration.rb +11 -1
- data/lib/pages_core/templates.rb +6 -4
- data/lib/pages_core/version.rb +1 -1
- data/lib/rails/generators/pages_core/frontend/templates/javascript/lib/gridOverlay.ts +6 -7
- data/lib/rails/generators/pages_core/frontend/templates/javascript/lib/responsiveEmbeds.ts +17 -12
- data/lib/rails/generators/pages_core/rspec/rspec_generator.rb +0 -2
- data/lib/rails/generators/pages_core/rspec/templates/rails_helper.rb +3 -4
- metadata +95 -29
- data/app/assets/stylesheets/pages_core/admin/components/login.css +0 -27
- data/app/controllers/admin/categories_controller.rb +0 -56
- data/app/controllers/concerns/pages_core/admin/persistent_params.rb +0 -75
- data/app/helpers/pages_core/admin/page_blocks_helper.rb +0 -66
- data/app/helpers/pages_core/admin/page_json_helper.rb +0 -23
- data/app/javascript/components/DateRangeSelect.jsx +0 -225
- data/app/javascript/components/PageDates.jsx +0 -73
- data/app/javascript/components/PageFiles.jsx +0 -25
- data/app/javascript/components/PageTree/types.ts +0 -15
- data/app/javascript/components/drag/types.ts +0 -28
- data/app/javascript/controllers/EditPageController.ts +0 -22
- data/app/javascript/controllers/MainController.ts +0 -74
- data/app/javascript/controllers/PageOptionsController.js +0 -67
- data/app/models/category.rb +0 -22
- data/app/models/concerns/pages_core/has_otp.rb +0 -27
- data/app/models/page_category.rb +0 -6
- data/app/views/admin/pages/_edit_content.html.erb +0 -19
- data/app/views/admin/pages/_edit_files.html.erb +0 -4
- data/app/views/admin/pages/_edit_images.html.erb +0 -4
- data/app/views/admin/pages/_edit_metadata.html.erb +0 -35
- data/app/views/admin/pages/_edit_options.html.erb +0 -91
- data/lib/rails/generators/pages_core/rspec/templates/mailer_macros.rb +0 -11
@@ -1,74 +0,0 @@
|
|
1
|
-
import { Controller } from "@hotwired/stimulus";
|
2
|
-
|
3
|
-
export default class MainController extends Controller {
|
4
|
-
declare readonly linkTargets: HTMLLinkElement[];
|
5
|
-
declare readonly tabTargets: HTMLDivElement[];
|
6
|
-
|
7
|
-
static get targets() {
|
8
|
-
return ["tab", "link"];
|
9
|
-
}
|
10
|
-
|
11
|
-
connect() {
|
12
|
-
const tabs = this.tabNames();
|
13
|
-
if (tabs.length > 0) {
|
14
|
-
let initTab: string = null;
|
15
|
-
const tabExpression = /#(.*)$/;
|
16
|
-
|
17
|
-
if (document.location.toString().match(tabExpression)) {
|
18
|
-
const id = document.location.toString().match(tabExpression)[1];
|
19
|
-
if (tabs.indexOf(id) !== -1) {
|
20
|
-
initTab = id;
|
21
|
-
}
|
22
|
-
}
|
23
|
-
|
24
|
-
this.showTab(initTab || tabs[0]);
|
25
|
-
}
|
26
|
-
|
27
|
-
window.addEventListener("popstate", this.stateHandler);
|
28
|
-
}
|
29
|
-
|
30
|
-
disconnect() {
|
31
|
-
window.removeEventListener("popstate", this.stateHandler);
|
32
|
-
}
|
33
|
-
|
34
|
-
stateHandler = (evt: Event) => {
|
35
|
-
if ("state" in evt && "tabId" in evt.state) {
|
36
|
-
this.showTab(evt.state.tabId);
|
37
|
-
}
|
38
|
-
};
|
39
|
-
|
40
|
-
changeTab(evt: Event) {
|
41
|
-
evt.preventDefault();
|
42
|
-
if ("dataset" in evt.target && "tab" in evt.target.dataset) {
|
43
|
-
const tab = evt.target.dataset.tab as string;
|
44
|
-
this.showTab(tab);
|
45
|
-
history.pushState(
|
46
|
-
{ tabId: tab },
|
47
|
-
"",
|
48
|
-
`${window.location.pathname}#${tab}`
|
49
|
-
);
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
|
-
showTab(tab: string | null) {
|
54
|
-
this.linkTargets.forEach((l) => {
|
55
|
-
if (l.dataset.tab == tab) {
|
56
|
-
l.classList.add("current");
|
57
|
-
} else {
|
58
|
-
l.classList.remove("current");
|
59
|
-
}
|
60
|
-
});
|
61
|
-
|
62
|
-
this.tabTargets.forEach((t) => {
|
63
|
-
if (t.dataset.tab == tab) {
|
64
|
-
t.classList.remove("hidden");
|
65
|
-
} else {
|
66
|
-
t.classList.add("hidden");
|
67
|
-
}
|
68
|
-
});
|
69
|
-
}
|
70
|
-
|
71
|
-
tabNames(): string[] {
|
72
|
-
return this.linkTargets.map((l) => l.dataset.tab);
|
73
|
-
}
|
74
|
-
}
|
@@ -1,67 +0,0 @@
|
|
1
|
-
import { Controller } from "@hotwired/stimulus";
|
2
|
-
|
3
|
-
export default class PageOptionsController extends Controller {
|
4
|
-
static get targets() {
|
5
|
-
return [
|
6
|
-
"advancedOptions",
|
7
|
-
"autoPublishNotice",
|
8
|
-
"published",
|
9
|
-
"publishedDate"
|
10
|
-
];
|
11
|
-
}
|
12
|
-
|
13
|
-
connect() {
|
14
|
-
this.checkAutoPublish();
|
15
|
-
this.checkPublishedDate();
|
16
|
-
}
|
17
|
-
|
18
|
-
checkAutoPublish() {
|
19
|
-
if (this.publishedDate() > new Date()) {
|
20
|
-
this.show(this.autoPublishNoticeTarget);
|
21
|
-
} else {
|
22
|
-
this.hide(this.autoPublishNoticeTarget);
|
23
|
-
}
|
24
|
-
}
|
25
|
-
|
26
|
-
checkPublishedDate() {
|
27
|
-
if (this.publishedTarget.value == 2) {
|
28
|
-
this.show(this.publishedDateTarget);
|
29
|
-
} else {
|
30
|
-
this.hide(this.publishedDateTarget);
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
publishedDate() {
|
35
|
-
const lookup = (name) => {
|
36
|
-
return this.publishedDateTarget.getElementsByClassName(name)[0].value;
|
37
|
-
};
|
38
|
-
return new Date(
|
39
|
-
lookup("year"),
|
40
|
-
lookup("month") - 1,
|
41
|
-
lookup("day"),
|
42
|
-
lookup("hour"),
|
43
|
-
lookup("minute")
|
44
|
-
);
|
45
|
-
}
|
46
|
-
|
47
|
-
show(elem) {
|
48
|
-
elem.classList.add("show");
|
49
|
-
}
|
50
|
-
|
51
|
-
hide(elem) {
|
52
|
-
elem.classList.remove("show");
|
53
|
-
}
|
54
|
-
|
55
|
-
toggle(elem) {
|
56
|
-
if (elem.classList.contains("show")) {
|
57
|
-
this.hide(elem);
|
58
|
-
} else {
|
59
|
-
this.show(elem);
|
60
|
-
}
|
61
|
-
}
|
62
|
-
|
63
|
-
toggleAdvancedOptions(evt) {
|
64
|
-
evt.preventDefault();
|
65
|
-
this.toggle(this.advancedOptionsTarget);
|
66
|
-
}
|
67
|
-
}
|
data/app/models/category.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Category < ApplicationRecord
|
4
|
-
has_many :page_categories, dependent: :destroy
|
5
|
-
has_many :pages, through: :page_categories
|
6
|
-
validates :name, presence: true
|
7
|
-
acts_as_list
|
8
|
-
|
9
|
-
before_save :set_slug
|
10
|
-
|
11
|
-
scope :by_name, -> { order("name ASC") }
|
12
|
-
|
13
|
-
private
|
14
|
-
|
15
|
-
def set_slug
|
16
|
-
self.slug = name.downcase
|
17
|
-
.gsub(/[^\w\s]/, "")
|
18
|
-
.split(/[^\w\d-]+/)
|
19
|
-
.compact
|
20
|
-
.join("-")
|
21
|
-
end
|
22
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module PagesCore
|
4
|
-
module HasOtp
|
5
|
-
extend ActiveSupport::Concern
|
6
|
-
|
7
|
-
included do
|
8
|
-
validates :otp_secret, presence: true, if: :otp_enabled?
|
9
|
-
end
|
10
|
-
|
11
|
-
def recovery_codes=(codes)
|
12
|
-
self.hashed_recovery_codes = codes.map do |c|
|
13
|
-
BCrypt::Password.create(c, cost: 8)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def use_recovery_code!(code)
|
18
|
-
valid_hashes = hashed_recovery_codes.select do |c|
|
19
|
-
BCrypt::Password.new(c) == code
|
20
|
-
end
|
21
|
-
return false unless valid_hashes.any?
|
22
|
-
|
23
|
-
update(hashed_recovery_codes: hashed_recovery_codes - valid_hashes)
|
24
|
-
true
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
data/app/models/page_category.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
<% @page.enabled_blocks do |block_name, block_options| %>
|
2
|
-
<%= page_block_field(f, block_name, block_options) %>
|
3
|
-
<% end %>
|
4
|
-
|
5
|
-
<% if @page.template_config.value(:dates) %>
|
6
|
-
<%= react_component("PageDates",
|
7
|
-
{ starts_at: @page.starts_at,
|
8
|
-
ends_at: @page.ends_at,
|
9
|
-
all_day: @page.all_day }) %>
|
10
|
-
<% end %>
|
11
|
-
|
12
|
-
<% if @page.template_config.value(:tags) %>
|
13
|
-
<div class="field">
|
14
|
-
<label>
|
15
|
-
Tags
|
16
|
-
</label>
|
17
|
-
<%= tag_editor_for(f, @page) %>
|
18
|
-
</div>
|
19
|
-
<% end %>
|
@@ -1,35 +0,0 @@
|
|
1
|
-
<div class="field">
|
2
|
-
<% if f.object.pathable? %>
|
3
|
-
<%= labelled_field(f.text_field(:path_segment, dir: "ltr", lang: nil),
|
4
|
-
"Path segment",
|
5
|
-
description: "Only alpanumeric characters and dashes " \
|
6
|
-
"are allowed.") %>
|
7
|
-
<% else %>
|
8
|
-
<div class="field">
|
9
|
-
<label>Path segment</label>
|
10
|
-
<p class="description">
|
11
|
-
Unable to add a path segment,
|
12
|
-
please add one to
|
13
|
-
<%= link_to("this page's parent",
|
14
|
-
edit_admin_page_path(f.object.parent,
|
15
|
-
locale: f.object.locale,
|
16
|
-
anchor: "metadata")) %>
|
17
|
-
first.
|
18
|
-
</p>
|
19
|
-
</div>
|
20
|
-
<% end %>
|
21
|
-
</div>
|
22
|
-
|
23
|
-
<div class="field">
|
24
|
-
<%= f.label_for :meta_image, "Image" %>
|
25
|
-
<p class="description">
|
26
|
-
Image displayed when sharing on social media.
|
27
|
-
Will fall back to the primary image if absent.
|
28
|
-
Recommended size is at least 1200x630.
|
29
|
-
</p>
|
30
|
-
<%= f.image_uploader :meta_image %>
|
31
|
-
</div>
|
32
|
-
|
33
|
-
<% @page.template_config.metadata_blocks do |block_name, block_options| %>
|
34
|
-
<%= page_block_field(f, block_name, block_options) %>
|
35
|
-
<% end %>
|
@@ -1,91 +0,0 @@
|
|
1
|
-
<div class="page-options"
|
2
|
-
data-controller="page-options">
|
3
|
-
<%= labelled_field(f.select(:status,
|
4
|
-
Page.status_labels.invert,
|
5
|
-
{},
|
6
|
-
data: {
|
7
|
-
"page-options-target": "published",
|
8
|
-
action: "change->page-options#checkPublishedDate"
|
9
|
-
}),
|
10
|
-
"Status",
|
11
|
-
errors: @page.errors[:status]) %>
|
12
|
-
<div class="published-date"
|
13
|
-
data-page-options-target="publishedDate">
|
14
|
-
<%= labelled_field (
|
15
|
-
f.date_select(
|
16
|
-
:published_at,
|
17
|
-
{ start_year: (Time.now.year - 20),
|
18
|
-
end_year: (Time.now.year + 5),
|
19
|
-
with_css_classes: true },
|
20
|
-
data: { action: "change->page-options#checkAutoPublish" }
|
21
|
-
) +
|
22
|
-
'<br />'.html_safe +
|
23
|
-
f.time_select(:published_at,
|
24
|
-
{ with_css_classes: true,
|
25
|
-
ignore_date: true },
|
26
|
-
data: { action: "change->page-options#checkAutoPublish" })
|
27
|
-
),
|
28
|
-
"Date",
|
29
|
-
errors: @page.errors[:published_at]
|
30
|
-
%>
|
31
|
-
<p class="autopublish-notice"
|
32
|
-
data-page-options-target="autoPublishNotice">
|
33
|
-
This page will publish later
|
34
|
-
</p>
|
35
|
-
</div>
|
36
|
-
|
37
|
-
<%= labelled_field (
|
38
|
-
f.select(:user_id, page_authors(@page).map{|a| [a.name, a.id]})
|
39
|
-
),
|
40
|
-
"Author",
|
41
|
-
errors: @page.errors[:user_id]
|
42
|
-
%>
|
43
|
-
|
44
|
-
<div class="field">
|
45
|
-
<label>
|
46
|
-
Pin to top
|
47
|
-
</label>
|
48
|
-
<%= f.check_box(:pinned) %>
|
49
|
-
Make post featured<br />
|
50
|
-
</div>
|
51
|
-
|
52
|
-
<% if @categories.length > 0 %>
|
53
|
-
<div class="field">
|
54
|
-
<label>Categories</label>
|
55
|
-
<% @categories.each do |category| %>
|
56
|
-
<%= check_box_tag("category[#{category.id}]",
|
57
|
-
"1",
|
58
|
-
@page.categories.map { |c| c.id }.include?(category.id)) %>
|
59
|
-
<%= category.name %><br />
|
60
|
-
<% end %>
|
61
|
-
</div>
|
62
|
-
<% end %>
|
63
|
-
|
64
|
-
<%= labelled_field(f.select(:template, available_templates_for_select),
|
65
|
-
"Template",
|
66
|
-
errors: @page.errors[:template]) %>
|
67
|
-
|
68
|
-
<%= link_to("Advanced options",
|
69
|
-
"#",
|
70
|
-
class: "advanced-toggle",
|
71
|
-
data: { action: "click->page-options#toggleAdvancedOptions" }) %>
|
72
|
-
|
73
|
-
<div class="advanced-options"
|
74
|
-
data-page-options-target="advancedOptions">
|
75
|
-
<div class="field">
|
76
|
-
<label>Subpages</label>
|
77
|
-
<%= f.check_box(:feed_enabled) %> RSS feed enabled<br />
|
78
|
-
<%= f.check_box(:news_page) %> Show in News<br />
|
79
|
-
</div>
|
80
|
-
<%= labelled_field f.text_field(:unique_name), "Unique name", errors: @page.errors[:unique_name] %>
|
81
|
-
<%= labelled_field f.text_field(:redirect_to), "Redirect", errors: @page.errors[:redirect_to] %>
|
82
|
-
</div>
|
83
|
-
|
84
|
-
<% if @page.id? && @page.name? %>
|
85
|
-
<div class="field">
|
86
|
-
<label>Page link</label>
|
87
|
-
<%= link_to(page_path(@page.locale, @page),
|
88
|
-
page_path(@page.locale, @page)) %>
|
89
|
-
</div>
|
90
|
-
<% end %>
|
91
|
-
</div>
|