pages_core 3.12.0 → 3.12.2
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/fonts/661557ef.ttf +0 -0
- data/app/assets/builds/fonts/a18fc2d2.woff2 +0 -0
- data/app/assets/builds/fonts/b2c7b78f.woff2 +0 -0
- data/app/assets/builds/fonts/ceddc204.ttf +0 -0
- data/app/assets/builds/pages_core/admin-dist.js +60 -14
- data/app/assets/builds/pages_core/admin-dist.js.map +7 -0
- data/app/assets/builds/pages_core/admin.css +9272 -0
- data/app/assets/images/pages/admin/angle-down-solid.svg +1 -0
- data/app/assets/images/pages/admin/icon.svg +1 -0
- data/app/assets/stylesheets/pages_core/admin/components/archive.css +6 -0
- data/app/assets/stylesheets/{pages/admin/components/attachments.scss → pages_core/admin/components/attachments.css} +35 -28
- data/app/assets/stylesheets/{pages/admin.scss → pages_core/admin/components/base.css} +125 -123
- data/app/assets/stylesheets/pages_core/admin/components/forms.css +223 -0
- data/app/assets/stylesheets/{pages/admin/components/header.scss → pages_core/admin/components/header.css} +76 -46
- data/app/assets/stylesheets/{pages/admin/components/image_editor.scss → pages_core/admin/components/image_editor.css} +42 -31
- data/app/assets/stylesheets/{pages/admin/components/image_grid.scss → pages_core/admin/components/image_grid.css} +76 -64
- data/app/assets/stylesheets/{pages/admin/components/image_uploader.scss → pages_core/admin/components/image_uploader.css} +12 -12
- data/app/assets/stylesheets/{pages/admin/components/layout.scss → pages_core/admin/components/layout.css} +13 -9
- data/app/assets/stylesheets/pages_core/admin/components/links.css +40 -0
- data/app/assets/stylesheets/pages_core/admin/components/list_table.css +66 -0
- data/app/assets/stylesheets/{pages/admin/components/login.scss → pages_core/admin/components/login.css} +6 -5
- data/app/assets/stylesheets/{pages/admin/components/modal.scss → pages_core/admin/components/modal.css} +10 -12
- data/app/assets/stylesheets/{pages/admin/components/page_tree.scss → pages_core/admin/components/page_tree.css} +54 -55
- data/app/assets/stylesheets/{pages/admin/components/pagination.scss → pages_core/admin/components/pagination.css} +17 -17
- data/app/assets/stylesheets/pages_core/admin/components/search.css +27 -0
- data/app/assets/stylesheets/{pages/admin/components/sidebar.scss → pages_core/admin/components/sidebar.css} +8 -7
- data/app/assets/stylesheets/{pages/admin/components/tag_editor.scss → pages_core/admin/components/tag_editor.css} +10 -15
- data/app/assets/stylesheets/{pages/admin/components/textarea.scss → pages_core/admin/components/textarea.css} +1 -1
- data/app/assets/stylesheets/{pages/admin/components/toast.scss → pages_core/admin/components/toast.css} +5 -3
- data/app/assets/stylesheets/{pages/admin/components/toolbar.scss → pages_core/admin/components/toolbar.css} +56 -29
- data/app/assets/stylesheets/{pages/admin/controllers/pages.scss → pages_core/admin/controllers/pages.css} +69 -52
- data/app/assets/stylesheets/pages_core/admin/controllers/users.css +3 -0
- data/app/assets/stylesheets/pages_core/admin/vars.css +34 -0
- data/app/assets/stylesheets/pages_core/admin.postcss.css +9 -0
- data/app/controllers/admin/pages_controller.rb +12 -11
- data/app/controllers/concerns/pages_core/rss_controller.rb +17 -1
- data/app/controllers/pages_core/admin_controller.rb +6 -0
- data/app/controllers/pages_core/frontend/pages_controller.rb +9 -5
- data/app/controllers/pages_core/sitemaps_controller.rb +3 -5
- data/app/formatters/pages_core/image_embedder.rb +5 -27
- data/app/helpers/admin/calendars_helper.rb +8 -0
- data/app/helpers/admin/news_helper.rb +13 -0
- data/app/helpers/admin/pages_helper.rb +32 -0
- data/app/helpers/pages_core/admin/admin_helper.rb +11 -54
- data/app/helpers/pages_core/admin/deprecated_admin_helper.rb +40 -0
- data/app/helpers/pages_core/images_helper.rb +37 -0
- data/app/javascript/admin-dist.ts +2 -0
- data/app/javascript/components/Attachments/{Attachment.jsx → Attachment.tsx} +44 -35
- data/app/javascript/components/Attachments/{AttachmentEditor.jsx → AttachmentEditor.tsx} +23 -23
- data/app/javascript/components/{EditableImage.jsx → EditableImage.tsx} +28 -25
- data/app/javascript/components/{FileUploadButton.jsx → FileUploadButton.tsx} +15 -16
- data/app/javascript/components/ImageCropper/FocalPoint.tsx +94 -0
- data/app/javascript/components/ImageCropper/{Image.jsx → Image.tsx} +13 -14
- data/app/javascript/components/ImageCropper/{Toolbar.jsx → Toolbar.tsx} +19 -15
- data/app/javascript/components/ImageCropper/{useCrop.js → useCrop.ts} +80 -37
- data/app/javascript/components/{ImageCropper.jsx → ImageCropper.tsx} +17 -15
- data/app/javascript/components/ImageEditor/{Form.jsx → Form.tsx} +24 -23
- data/app/javascript/components/{ImageEditor.jsx → ImageEditor.tsx} +17 -15
- data/app/javascript/components/ImageGrid/{DragElement.jsx → DragElement.tsx} +12 -10
- data/app/javascript/components/ImageGrid/{GridImage.jsx → GridImage.tsx} +40 -30
- data/app/javascript/components/ImageGrid/{Placeholder.jsx → Placeholder.tsx} +5 -6
- data/app/javascript/components/ImageGrid.jsx +3 -4
- data/app/javascript/components/{ImageUploader.jsx → ImageUploader.tsx} +46 -41
- data/app/javascript/components/Modal.tsx +48 -0
- data/app/javascript/components/PageImages.tsx +28 -0
- data/app/javascript/components/{PageTreeDraggable.jsx → PageTree/Draggable.tsx} +79 -57
- data/app/javascript/components/{PageTreeNode.jsx → PageTree/Node.tsx} +86 -77
- data/app/javascript/components/PageTree/types.ts +15 -0
- data/app/javascript/components/PageTree.tsx +206 -0
- data/app/javascript/components/RichTextToolbarButton.tsx +17 -0
- data/app/javascript/components/TagEditor/{AddTagForm.jsx → AddTagForm.tsx} +9 -10
- data/app/javascript/components/TagEditor/{Tag.jsx → Tag.tsx} +8 -9
- data/app/javascript/components/{TagEditor.jsx → TagEditor.tsx} +12 -13
- data/app/javascript/components/Toast.tsx +61 -0
- data/app/javascript/components/drag/{draggedOrder.js → draggedOrder.ts} +22 -12
- data/app/javascript/components/drag/types.ts +28 -0
- data/app/javascript/components/drag/{useDragCollection.js → useDragCollection.ts} +40 -22
- data/app/javascript/components/drag/{useDragUploader.js → useDragUploader.ts} +34 -25
- data/app/javascript/components/drag/useDraggable.ts +21 -0
- data/app/javascript/components/{drag.js → drag.ts} +1 -0
- data/app/javascript/controllers/{EditPageController.js → EditPageController.ts} +3 -1
- data/app/javascript/controllers/{LoginController.js → LoginController.ts} +7 -3
- data/app/javascript/controllers/{MainController.js → MainController.ts} +19 -14
- data/app/javascript/{index.js → index.ts} +8 -7
- data/app/javascript/lib/{Tree.js → Tree.ts} +106 -85
- data/app/javascript/lib/{copyToClipboard.js → copyToClipboard.ts} +1 -1
- data/app/javascript/lib/{readyHandler.js → readyHandler.ts} +4 -2
- data/app/javascript/lib/{request.js → request.ts} +11 -5
- data/app/javascript/stores/useModalStore.ts +15 -0
- data/app/javascript/stores/useToastStore.ts +26 -0
- data/app/javascript/stores.ts +2 -0
- data/app/javascript/types.ts +30 -0
- data/app/mailers/admin_mailer.rb +1 -0
- data/app/models/invite.rb +8 -0
- data/app/policies/page_policy.rb +4 -0
- data/app/views/admin/calendars/_sidebar.html.erb +50 -0
- data/app/views/admin/calendars/show.html.erb +15 -53
- data/app/views/admin/invites/new.html.erb +2 -8
- data/app/views/admin/invites/show.html.erb +2 -4
- data/app/views/admin/news/_sidebar.html.erb +51 -0
- data/app/views/admin/news/index.html.erb +21 -56
- data/app/views/admin/pages/_list_item.html.erb +4 -22
- data/app/views/admin/pages/_search_bar.html.erb +12 -0
- data/app/views/admin/pages/deleted.html.erb +10 -8
- data/app/views/admin/pages/edit.html.erb +20 -11
- data/app/views/admin/pages/index.html.erb +10 -8
- data/app/views/admin/pages/new.html.erb +10 -14
- data/app/views/admin/pages/search.html.erb +54 -0
- data/app/views/admin/password_resets/show.html.erb +3 -5
- data/app/views/admin/users/deactivated.html.erb +6 -7
- data/app/views/admin/users/edit.html.erb +7 -9
- data/app/views/admin/users/index.html.erb +3 -6
- data/app/views/admin/users/login.html.erb +4 -5
- data/app/views/admin/users/new.html.erb +2 -4
- data/app/views/admin/users/new_password.html.erb +4 -5
- data/app/views/admin/users/show.html.erb +11 -9
- data/app/views/errors/401.html.erb +2 -1
- data/app/views/errors/403.html.erb +2 -1
- data/app/views/errors/404.html.erb +1 -3
- data/app/views/errors/405.html.erb +2 -1
- data/app/views/errors/422.html.erb +2 -1
- data/app/views/errors/500.html.erb +2 -3
- data/app/views/feeds/pages.rss.builder +3 -9
- data/app/views/layouts/admin/_header.html.erb +1 -2
- data/app/views/layouts/admin/_page_header.html.erb +4 -4
- data/app/views/layouts/admin.html.erb +3 -3
- data/app/views/layouts/errors.html.erb +127 -4
- data/config/routes.rb +1 -0
- data/lib/pages_core/configuration/pages.rb +0 -1
- data/lib/pages_core/engine.rb +4 -3
- data/lib/pages_core.rb +0 -1
- data/lib/rails/generators/pages_core/frontend/frontend_generator.rb +33 -17
- data/lib/rails/generators/pages_core/frontend/templates/application.html.erb +0 -1
- data/lib/rails/generators/pages_core/frontend/templates/javascript/lib/gridOverlay.ts +40 -0
- data/lib/rails/generators/pages_core/frontend/templates/javascript/lib/responsiveEmbeds.ts +68 -0
- data/lib/rails/generators/pages_core/frontend/templates/postcss.config.js +17 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/application.postcss.css +4 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/components/base.css +24 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/components/layout.css +21 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/config.css +5 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/animation.css +5 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/colors.css +18 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/fonts.css +6 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/grid.css +65 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/typography.css +131 -0
- data/lib/rails/generators/pages_core/install/templates/pages_initializer.rb +0 -3
- metadata +104 -255
- data/app/assets/images/pages/admin/icon.png +0 -0
- data/app/assets/images/pages/admin/image-editor-bg.png +0 -0
- data/app/assets/images/pages/admin/list-table-pin-blue.gif +0 -0
- data/app/assets/images/pages/admin/list-table-pin-disabled.gif +0 -0
- data/app/assets/images/pages/admin/list-table-pin-green.gif +0 -0
- data/app/assets/images/pages/admin/list-table-pin-red.gif +0 -0
- data/app/assets/images/pages/admin/list-table-pin-yellow.gif +0 -0
- data/app/assets/images/pages/admin/loading-modal.gif +0 -0
- data/app/assets/images/pages/feed-icon-14x14.png +0 -0
- data/app/assets/stylesheets/pages/admin/components/archive.scss +0 -6
- data/app/assets/stylesheets/pages/admin/components/buttons.scss +0 -23
- data/app/assets/stylesheets/pages/admin/components/forms.scss +0 -169
- data/app/assets/stylesheets/pages/admin/components/links.scss +0 -43
- data/app/assets/stylesheets/pages/admin/components/list_table.scss +0 -61
- data/app/assets/stylesheets/pages/admin/controllers/users.scss +0 -3
- data/app/assets/stylesheets/pages/admin/mixins/breakpoints.scss +0 -21
- data/app/assets/stylesheets/pages/admin/mixins/clearfix.scss +0 -7
- data/app/assets/stylesheets/pages/admin/mixins/gradients.scss +0 -7
- data/app/assets/stylesheets/pages/admin/vars.scss +0 -30
- data/app/assets/stylesheets/pages/errors.css +0 -128
- data/app/javascript/admin-dist.js +0 -2
- data/app/javascript/components/ImageCropper/FocalPoint.jsx +0 -93
- data/app/javascript/components/Modal.jsx +0 -59
- data/app/javascript/components/PageImages.jsx +0 -25
- data/app/javascript/components/PageTree.jsx +0 -196
- data/app/javascript/components/RichTextToolbarButton.jsx +0 -20
- data/app/javascript/components/Toast.jsx +0 -72
- data/app/javascript/components/drag/useDraggable.js +0 -17
- data/app/javascript/stores/ModalStore.jsx +0 -12
- data/app/javascript/stores/ToastStore.jsx +0 -14
- data/app/javascript/stores.js +0 -2
- data/lib/rails/generators/pages_core/frontend/templates/javascript/lib/GridOverlay.js +0 -66
- data/lib/rails/generators/pages_core/frontend/templates/javascript/lib/ResponsiveEmbeds.js +0 -72
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/application.sass.scss +0 -15
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/components/base.scss +0 -12
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/config.scss +0 -26
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/framework/breakpoints.scss +0 -42
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/framework/clearfix.scss +0 -7
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/framework/fonts.scss +0 -32
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/framework/grid.scss +0 -168
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/framework/grid_overlay.scss +0 -44
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/colors.scss +0 -8
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/typography.scss +0 -90
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/vendor/normalize.css +0 -349
- data/vendor/assets/stylesheets/ReactCrop.css +0 -167
- /data/app/assets/stylesheets/{pages/admin/components/tabs.scss → pages_core/admin/components/tabs.css} +0 -0
- /data/app/javascript/components/Attachments/{Placeholder.jsx → Placeholder.tsx} +0 -0
- /data/app/javascript/components/ImageGrid/{FilePlaceholder.jsx → FilePlaceholder.tsx} +0 -0
- /data/app/javascript/{components.js → components.ts} +0 -0
- /data/app/javascript/{hooks.js → hooks.ts} +0 -0
@@ -1,12 +1,11 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
self.page_description = "Viewing deactivated users"
|
4
|
-
self.page_description_links = link_to("View active users", admin_users_path)
|
5
|
-
%>
|
1
|
+
<% content_for :page_title, "Deactivated users" %>
|
2
|
+
<% content_for :page_description, "Viewing deactivated users" %>
|
6
3
|
|
4
|
+
<% content_for(:page_description_links) do %>
|
5
|
+
<%= link_to("View active users", admin_users_path) %>
|
6
|
+
<% end %>
|
7
7
|
|
8
8
|
<% content_for :sidebar do %>
|
9
9
|
<% end %>
|
10
10
|
|
11
|
-
|
12
|
-
<%= render partial: 'list', locals: {users: @users} %>
|
11
|
+
<%= render partial: "list", locals: { users: @users } %>
|
@@ -1,12 +1,10 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
self.page_description_links = link_to("View all users", admin_users_path)
|
9
|
-
%>
|
1
|
+
<% content_for :page_title, "Editing user: #{@user.name}" %>
|
2
|
+
|
3
|
+
<% content_for :page_description do %>
|
4
|
+
You are editing
|
5
|
+
<%= link_to((@user == current_user ? "your own profile" : "#{@user.name}"),
|
6
|
+
[:admin, @user]) %>
|
7
|
+
<% end %>
|
10
8
|
|
11
9
|
<% content_for :sidebar do %>
|
12
10
|
<% if @user != current_user %>
|
@@ -1,8 +1,5 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
self.page_description = "Viewing active users"
|
4
|
-
%>
|
5
|
-
|
1
|
+
<% content_for :page_title, "Users" %>
|
2
|
+
<% content_for :page_description, "Viewing active users" %>
|
6
3
|
|
7
4
|
<% content_for :sidebar do %>
|
8
5
|
<% if policy(User).new? %>
|
@@ -24,4 +21,4 @@
|
|
24
21
|
<% end %>
|
25
22
|
|
26
23
|
|
27
|
-
<%= render partial:
|
24
|
+
<%= render partial: "list", locals: { users: @users } %>
|
@@ -1,8 +1,7 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
-%>
|
1
|
+
<% content_for :page_title, "Sign in" %>
|
2
|
+
<% content_for(:page_description,
|
3
|
+
"Please enter your email address and password to sign in") %>
|
4
|
+
<% content_for :body_class, "login" %>
|
6
5
|
|
7
6
|
<% content_for :sidebar do %>
|
8
7
|
<h2>Please note</h2>
|
@@ -1,7 +1,5 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
self.page_description = "Welcome to Pages"
|
4
|
-
%>
|
1
|
+
<% content_for :page_title, "Welcome" %>
|
2
|
+
<% content_for :page_description, "Welcome to Pages" %>
|
5
3
|
|
6
4
|
<div class="content">
|
7
5
|
<p>Welcome to Pages! Before you can log on, we need to create the first user account.</p>
|
@@ -1,8 +1,7 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
%>
|
1
|
+
<% content_for :page_title, "Log in » Forgotten password" %>
|
2
|
+
<% content_for :page_description, "Creating a new password" %>
|
3
|
+
<% content_for :body_class, "login" -%>
|
4
|
+
|
6
5
|
<div class="content">
|
7
6
|
<p>
|
8
7
|
Did you lose your password? Don't worry, it happens.
|
@@ -1,12 +1,14 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
%>
|
1
|
+
<% content_for :page_title, @user.name %>
|
2
|
+
|
3
|
+
<% content_for :page_description do %>
|
4
|
+
You are viewing
|
5
|
+
<%= link_to((@user == current_user ? "your own profile" : "#{@user.name}"),
|
6
|
+
[:admin, @user]) %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<% content_for(:page_description_links) do %>
|
10
|
+
<%= link_to("Edit", edit_admin_user_path(@user)) if policy(@user).edit? %>
|
11
|
+
<% end %>
|
10
12
|
|
11
13
|
<% content_for :sidebar do %>
|
12
14
|
<h2>People</h2>
|
@@ -4,9 +4,7 @@ xml << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
|
4
4
|
xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do
|
5
5
|
xml.channel do
|
6
6
|
xml.title(@title || PagesCore.config(:site_name))
|
7
|
-
xml.link(
|
8
|
-
url_for(controller: "pages", action: "index", only_path: false)
|
9
|
-
)
|
7
|
+
xml.link(root_url)
|
10
8
|
xml.description "Recent items"
|
11
9
|
xml.language locale
|
12
10
|
xml.generator "Pages"
|
@@ -15,12 +13,8 @@ xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do
|
|
15
13
|
xml.item do
|
16
14
|
xml.title { xml.cdata! item.name.to_s }
|
17
15
|
xml.link page_url(@locale, item, only_path: false)
|
18
|
-
|
19
|
-
xml.
|
20
|
-
else
|
21
|
-
xml.description do
|
22
|
-
xml.cdata!((item.extended? ? item.excerpt : item.body).to_html)
|
23
|
-
end
|
16
|
+
xml.description do
|
17
|
+
xml.cdata! item.excerpt.to_html + item.body.to_html
|
24
18
|
end
|
25
19
|
xml.guid page_url(@locale, item, only_path: false)
|
26
20
|
xml.pubDate item.published_at.to_fs(:rfc822)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<header>
|
2
2
|
<div class="logo">
|
3
|
-
<%= link_to image_tag("pages/admin/icon.
|
3
|
+
<%= link_to image_tag("pages/admin/icon.svg"), '/admin' %>
|
4
4
|
</div>
|
5
5
|
<div class="site-name">
|
6
6
|
<h1>
|
@@ -10,7 +10,6 @@
|
|
10
10
|
<% if logged_in? %>
|
11
11
|
<div class="user">
|
12
12
|
Hello, <%= link_to(current_user.name, admin_user_url(current_user)) %>
|
13
|
-
<%= link_separator %>
|
14
13
|
<%= link_to("Log out", session_path, method: "delete") %>
|
15
14
|
</div>
|
16
15
|
<% end %>
|
@@ -1,12 +1,12 @@
|
|
1
|
-
<% if
|
1
|
+
<% if content_for?(:page_description) || @content_tabs %>
|
2
2
|
<div class="page-description"<% if @content_tabs %> class="with_content_tabs"<% end %>>
|
3
|
-
<% if
|
3
|
+
<% if content_for?(:page_description_links) %>
|
4
4
|
<div class="links">
|
5
|
-
<%=
|
5
|
+
<%= content_for(:page_description_links) %>
|
6
6
|
</div>
|
7
7
|
<% end %>
|
8
8
|
<h3>
|
9
|
-
<%= (
|
9
|
+
<%= content_for(:page_description) || content_for(:page_title) %>
|
10
10
|
</h3>
|
11
11
|
<% if @content_tabs %>
|
12
12
|
<ul class="content-tabs"
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<head>
|
4
4
|
<meta charset="utf-8">
|
5
5
|
<title>
|
6
|
-
<%= [
|
6
|
+
<%= [content_for(:page_title), "Pages"].reject(&:blank?).uniq.join(" - ") %>
|
7
7
|
</title>
|
8
8
|
|
9
9
|
<link rel="shortcut icon"
|
@@ -13,7 +13,7 @@
|
|
13
13
|
href="<%= asset_path 'pages/favicon.gif' %>"
|
14
14
|
type="image/gif" />
|
15
15
|
|
16
|
-
<%= stylesheet_link_tag "
|
16
|
+
<%= stylesheet_link_tag "pages_core/admin" %>
|
17
17
|
|
18
18
|
<% if Dir.glob(Rails.root.join("app/assets/stylesheets/admin.*")).any? %>
|
19
19
|
<%= stylesheet_link_tag "admin" %>
|
@@ -34,7 +34,7 @@
|
|
34
34
|
<%= google_analytics_tags "UA-5468672-21" %>
|
35
35
|
</head>
|
36
36
|
|
37
|
-
<body class="<%=
|
37
|
+
<body class="<%= content_for(:body_class) %>"
|
38
38
|
data-controller="<%= controller.class.to_s %>"
|
39
39
|
data-action="<%= controller.action_name %>"
|
40
40
|
data-locale="<%= @locale %>">
|
@@ -5,13 +5,136 @@
|
|
5
5
|
<head>
|
6
6
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
|
-
<title><%=
|
9
|
-
|
8
|
+
<title><%= content_for(:page_title) || "We're sorry" %></title>
|
9
|
+
<style>
|
10
|
+
body {
|
11
|
+
background: #fff;
|
12
|
+
background: linear-gradient(180deg, rgba(236, 236, 236, 1) 0%, rgba(255, 255, 255, 1) 50%);
|
13
|
+
background-repeat: no-repeat;
|
14
|
+
margin: 0;
|
15
|
+
padding: 0;
|
16
|
+
border: 0;
|
17
|
+
font-family: Helvetica, Arial, sans-serif;
|
18
|
+
font-size: 16px;
|
19
|
+
color: #111;
|
20
|
+
line-height: 1.5;
|
21
|
+
}
|
22
|
+
|
23
|
+
main {
|
24
|
+
width: 600px;
|
25
|
+
margin: 150px auto;
|
26
|
+
}
|
27
|
+
|
28
|
+
h1, h2, h3, h4, h5, h6, p, ul, form {
|
29
|
+
margin: 0 0 16px 0;
|
30
|
+
}
|
31
|
+
|
32
|
+
h4 {
|
33
|
+
margin-bottom: 0;
|
34
|
+
font-size: 1em;
|
35
|
+
font-weight: bold;
|
36
|
+
}
|
37
|
+
|
38
|
+
h4 em {
|
39
|
+
font-weight: normal;
|
40
|
+
font-style: normal;
|
41
|
+
}
|
42
|
+
|
43
|
+
ul {
|
44
|
+
list-style-type: disc;
|
45
|
+
list-style-position: inside;
|
46
|
+
padding: 0;
|
47
|
+
}
|
48
|
+
|
49
|
+
ul li {
|
50
|
+
margin: 0;
|
51
|
+
padding: 0;
|
52
|
+
}
|
53
|
+
|
54
|
+
h1 {
|
55
|
+
font-weight: bold;
|
56
|
+
color: #111;
|
57
|
+
font-size: 36px;
|
58
|
+
}
|
59
|
+
|
60
|
+
p.footer {
|
61
|
+
margin-top: 64px;
|
62
|
+
font-size: 12px;
|
63
|
+
color: #868686;
|
64
|
+
}
|
65
|
+
|
66
|
+
p.error_id {
|
67
|
+
margin-top: 64px;
|
68
|
+
font-size: 12px;
|
69
|
+
color: #dcdbd2;
|
70
|
+
}
|
71
|
+
|
72
|
+
input[type=text],
|
73
|
+
textarea {
|
74
|
+
vertical-align: top;
|
75
|
+
border: 1px solid #c4c2bb;
|
76
|
+
color: #444;
|
77
|
+
font-family: Helvetica, Arial, sans-serif;
|
78
|
+
font-size: 18px;
|
79
|
+
padding: 6px 8px 6px 8px;
|
80
|
+
width: 490px;
|
81
|
+
border-radius: 3px;
|
82
|
+
}
|
83
|
+
|
84
|
+
input.with_button {
|
85
|
+
width: 400px;
|
86
|
+
margin-right: 4px;
|
87
|
+
}
|
88
|
+
|
89
|
+
a,
|
90
|
+
a:visited {
|
91
|
+
color: #0751b6;
|
92
|
+
text-decoration: underline;
|
93
|
+
}
|
94
|
+
|
95
|
+
a:hover {
|
96
|
+
color: #042d65;
|
97
|
+
}
|
98
|
+
|
99
|
+
form {
|
100
|
+
vertical-align: top;
|
101
|
+
}
|
102
|
+
|
103
|
+
button.clean-gray {
|
104
|
+
background-color: #eeeeee;
|
105
|
+
background-image: linear-gradient(top, #f8f8f8, #e0e0e0);
|
106
|
+
border: 1px solid #ccc;
|
107
|
+
border-bottom: 1px solid #bbb;
|
108
|
+
border-radius: 3px;
|
109
|
+
color: #333;
|
110
|
+
font: bold 15px Helvetica, Arial, sans-serif;
|
111
|
+
line-height: 1;
|
112
|
+
padding: 9px 0;
|
113
|
+
text-align: center;
|
114
|
+
text-shadow: 0 1px 0 #eee;
|
115
|
+
width: 150px;
|
116
|
+
}
|
117
|
+
|
118
|
+
button.clean-gray:hover {
|
119
|
+
background-color: #dddddd;
|
120
|
+
background-image: linear-gradient(top, #f0f0f0, #dddddd);
|
121
|
+
border: 1px solid #bbb;
|
122
|
+
border-bottom: 1px solid #aaa;
|
123
|
+
cursor: pointer;
|
124
|
+
text-shadow: 0 1px 0 #ddd;
|
125
|
+
}
|
126
|
+
|
127
|
+
button.clean-gray:active {
|
128
|
+
border: 1px solid #aaa;
|
129
|
+
border-bottom: 1px solid #888;
|
130
|
+
box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
|
131
|
+
}
|
132
|
+
</style>
|
10
133
|
</head>
|
11
134
|
<body>
|
12
135
|
<main>
|
13
|
-
<% if
|
14
|
-
<h1><%=
|
136
|
+
<% if content_for?(:page_title) %>
|
137
|
+
<h1><%= content_for(:page_title) %></h1>
|
15
138
|
<% end %>
|
16
139
|
<%= yield %>
|
17
140
|
</main>
|
data/config/routes.rb
CHANGED
@@ -11,7 +11,6 @@ module PagesCore
|
|
11
11
|
setting :localizations, :boolean, false
|
12
12
|
setting :locales, :hash
|
13
13
|
setting :text_filter, :symbol, :textile
|
14
|
-
setting :rss_fulltext, :boolean, true
|
15
14
|
setting :image_fallback_url, :string
|
16
15
|
setting :default_author, :string
|
17
16
|
setting :error_404_layout, :string
|
data/lib/pages_core/engine.rb
CHANGED
@@ -28,10 +28,11 @@ module PagesCore
|
|
28
28
|
initializer :assets do |_config|
|
29
29
|
Rails.application.config.assets.precompile += %w[
|
30
30
|
pages_core/admin-dist.js
|
31
|
-
|
32
|
-
|
31
|
+
pages_core/admin.css
|
32
|
+
pages_core/fonts/*.ttf
|
33
|
+
pages_core/fonts/*.woff2
|
33
34
|
pages/favicon.gif
|
34
|
-
pages/admin/icon.
|
35
|
+
pages/admin/icon.svg
|
35
36
|
pages/*.gif
|
36
37
|
pages/*.png
|
37
38
|
pages/*.jpg
|
data/lib/pages_core.rb
CHANGED
@@ -14,40 +14,56 @@ module PagesCore
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def create_css_framework
|
17
|
-
["application.
|
18
|
-
"config.
|
19
|
-
"components/base.
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"
|
23
|
-
"
|
24
|
-
"
|
25
|
-
"global/
|
26
|
-
"global/typography.scss",
|
27
|
-
"vendor/normalize.css"].each do |f|
|
17
|
+
["application.postcss.css",
|
18
|
+
"config.css",
|
19
|
+
"components/base.css",
|
20
|
+
"components/layout.css",
|
21
|
+
"global/animation.css",
|
22
|
+
"global/colors.css",
|
23
|
+
"global/fonts.css",
|
24
|
+
"global/grid.css",
|
25
|
+
"global/typography.css"].each do |f|
|
28
26
|
template("stylesheets/#{f}", File.join("app/assets/stylesheets/#{f}"))
|
29
27
|
end
|
30
28
|
end
|
31
29
|
|
32
30
|
def create_js_framework
|
33
|
-
["lib/
|
34
|
-
"lib/
|
31
|
+
["lib/responsiveEmbeds.ts",
|
32
|
+
"lib/gridOverlay.ts"].each do |f|
|
35
33
|
template("javascript/#{f}", File.join("app/javascript/#{f}"))
|
36
34
|
end
|
37
35
|
|
38
36
|
append_to_file "app/javascript/application.js" do
|
39
37
|
<<~JS
|
40
38
|
// Responsive embeds
|
41
|
-
import
|
42
|
-
|
39
|
+
import responsiveEmbeds from "./lib/responsiveEmbeds";
|
40
|
+
responsiveEmbeds();
|
43
41
|
|
44
42
|
// Grid overlay
|
45
|
-
import
|
46
|
-
|
43
|
+
import gridOverlay from "./lib/gridOverlay";
|
44
|
+
gridOverlay();
|
47
45
|
JS
|
48
46
|
end
|
49
47
|
end
|
50
48
|
|
49
|
+
def install_js_dependencies
|
50
|
+
run("yarn add autoprefixer cssnano normalize.css postcss " \
|
51
|
+
"postcss-calc postcss-cli postcss-import " \
|
52
|
+
"postcss-import-ext-glob postcss-mixins postcss-preset-env " \
|
53
|
+
"postcss-url")
|
54
|
+
end
|
55
|
+
|
56
|
+
def configure_postcss
|
57
|
+
copy_file("postcss.config.js",
|
58
|
+
File.join("postcss.config.js"))
|
59
|
+
end
|
60
|
+
|
61
|
+
def configure_build_script
|
62
|
+
script = "postcss ./app/assets/stylesheets/application.postcss.css " \
|
63
|
+
"-o ./app/assets/builds/application.css"
|
64
|
+
run %(npm set-script build:css "#{script}")
|
65
|
+
end
|
66
|
+
|
51
67
|
def remove_application_css
|
52
68
|
remove_file("app/assets/stylesheets/application.css")
|
53
69
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
function ready(callback: () => void) {
|
2
|
+
if (document.readyState === "complete" ||
|
3
|
+
(document.readyState !== "loading" && !document.documentElement.doScroll)) {
|
4
|
+
callback();
|
5
|
+
} else {
|
6
|
+
document.addEventListener("DOMContentLoaded", callback);
|
7
|
+
}
|
8
|
+
}
|
9
|
+
|
10
|
+
function applyGrid () {
|
11
|
+
let showGrid = false;
|
12
|
+
const gridOverlay = document.querySelector(".grid-overlay");
|
13
|
+
|
14
|
+
const setState = (newState: boolean) => {
|
15
|
+
showGrid = newState;
|
16
|
+
|
17
|
+
if (newState) {
|
18
|
+
window.localStorage.setItem("showGrid", "true");
|
19
|
+
gridOverlay.classList.add("grid-overlay--active");
|
20
|
+
} else {
|
21
|
+
window.localStorage.removeItem("showGrid");
|
22
|
+
gridOverlay.classList.remove("grid-overlay--active");
|
23
|
+
}
|
24
|
+
};
|
25
|
+
|
26
|
+
if (gridOverlay) {
|
27
|
+
setState(window.localStorage.getItem("showGrid") == "true");
|
28
|
+
|
29
|
+
// Keyboard toggle
|
30
|
+
document.addEventListener("keyup", (evt: KeyboardEvent) => {
|
31
|
+
if (evt.ctrlKey && evt.which == 71) {
|
32
|
+
setState(!showGrid);
|
33
|
+
}
|
34
|
+
});
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
export default function gridOverlay() {
|
39
|
+
ready(applyGrid);
|
40
|
+
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
const selectors = [
|
2
|
+
"iframe[src*=\"bandcamp.com\"]",
|
3
|
+
"iframe[src*=\"player.vimeo.com\"]",
|
4
|
+
"iframe[src*=\"youtube.com\"]",
|
5
|
+
"iframe[src*=\"youtube-nocookie.com\"]",
|
6
|
+
"iframe[src*=\"spotify.com\"]",
|
7
|
+
"iframe[src*=\"kickstarter.com\"][src*=\"video.html\"]"
|
8
|
+
];
|
9
|
+
|
10
|
+
function readyHandler(fn: () => void) {
|
11
|
+
if (document.readyState === "complete" || document.readyState === "interactive") {
|
12
|
+
setTimeout(fn, 1);
|
13
|
+
} else {
|
14
|
+
document.addEventListener("DOMContentLoaded", fn);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
function wrapEmbed(embed: HTMLElement): HTMLElement {
|
19
|
+
const parent = embed.parentNode as HTMLElement;
|
20
|
+
|
21
|
+
// Recycle the existing container if the embed is already responsive.
|
22
|
+
if (parent &&
|
23
|
+
parent.tagName === "DIV" &&
|
24
|
+
parent.childNodes.length === 1 &&
|
25
|
+
parent.style.position === "relative") {
|
26
|
+
return parent;
|
27
|
+
}
|
28
|
+
|
29
|
+
const wrapper = document.createElement("div");
|
30
|
+
if (parent.tagName === "P") {
|
31
|
+
parent.parentNode.replaceChild(wrapper, parent);
|
32
|
+
} else {
|
33
|
+
parent.replaceChild(wrapper, embed);
|
34
|
+
}
|
35
|
+
wrapper.appendChild(embed);
|
36
|
+
return wrapper;
|
37
|
+
}
|
38
|
+
|
39
|
+
function applyEmbed(embed: HTMLElement) {
|
40
|
+
const parent = embed.parentNode as HTMLElement;
|
41
|
+
|
42
|
+
if (parent && parent.classList.contains("responsive-embed")) {
|
43
|
+
return;
|
44
|
+
}
|
45
|
+
|
46
|
+
const width = embed.offsetWidth;
|
47
|
+
const height = embed.offsetHeight;
|
48
|
+
const ratio = height / width;
|
49
|
+
const wrapper = wrapEmbed(embed);
|
50
|
+
|
51
|
+
wrapper.classList.add("responsive-embed");
|
52
|
+
wrapper.style.position = "relative";
|
53
|
+
wrapper.style.width = "100%";
|
54
|
+
wrapper.style.paddingTop = 0;
|
55
|
+
wrapper.style.paddingBottom = `${ratio * 100}%`;
|
56
|
+
|
57
|
+
embed.style.position = "absolute";
|
58
|
+
embed.style.width = "100%";
|
59
|
+
embed.style.height = "100%";
|
60
|
+
embed.style.top = "0";
|
61
|
+
embed.style.left = "0";
|
62
|
+
}
|
63
|
+
|
64
|
+
export default function responsiveEmbeds() {
|
65
|
+
readyHandler(() => {
|
66
|
+
document.querySelectorAll(selectors.join(",")).forEach(applyEmbed);
|
67
|
+
});
|
68
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module.exports = {
|
2
|
+
plugins: [
|
3
|
+
require("postcss-import-ext-glob"),
|
4
|
+
require("postcss-import"),
|
5
|
+
require("postcss-url")(
|
6
|
+
{ filter: "**/*.svg",
|
7
|
+
url: "inline",
|
8
|
+
basePath: "../images" }
|
9
|
+
),
|
10
|
+
require("postcss-mixins"),
|
11
|
+
require("postcss-simple-vars"),
|
12
|
+
require("postcss-preset-env")({ stage: 1 }),
|
13
|
+
require("postcss-calc")({ precision: 10 }),
|
14
|
+
require("autoprefixer"),
|
15
|
+
require("postcss-discard-duplicates")
|
16
|
+
],
|
17
|
+
};
|