pages_core 3.12.1 → 3.12.3
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 +135 -50
- data/app/assets/builds/pages_core/admin-dist.js.map +7 -0
- data/app/assets/builds/pages_core/admin.css +72 -20
- data/app/assets/stylesheets/pages_core/admin/components/attachments.css +1 -1
- data/app/assets/stylesheets/pages_core/admin/components/image_editor.css +2 -2
- data/app/assets/stylesheets/pages_core/admin/components/image_grid.css +8 -8
- data/app/assets/stylesheets/pages_core/admin/components/image_uploader.css +2 -2
- data/app/assets/stylesheets/pages_core/admin/components/layout.css +2 -2
- data/app/assets/stylesheets/pages_core/admin/components/modal.css +2 -2
- data/app/assets/stylesheets/pages_core/admin/components/search.css +27 -0
- data/app/assets/stylesheets/pages_core/admin/controllers/pages.css +6 -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/helpers/admin/pages_helper.rb +32 -0
- data/app/helpers/pages_core/images_helper.rb +28 -7
- data/app/javascript/admin-dist.ts +2 -0
- data/app/javascript/components/Attachments/{Attachment.jsx → Attachment.tsx} +42 -33
- data/app/javascript/components/Attachments/{AttachmentEditor.jsx → AttachmentEditor.tsx} +23 -23
- data/app/javascript/components/{EditableImage.jsx → EditableImage.tsx} +27 -24
- 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} +16 -12
- 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} +79 -70
- 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/features/{RichText.jsx → RichText.tsx} +3 -3
- 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/policies/page_policy.rb +4 -0
- data/app/views/admin/calendars/_sidebar.html.erb +3 -0
- data/app/views/admin/news/_sidebar.html.erb +3 -0
- 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/index.html.erb +3 -0
- data/app/views/admin/pages/search.html.erb +54 -0
- data/app/views/feeds/pages.rss.builder +3 -9
- data/config/routes.rb +1 -0
- data/lib/pages_core/configuration/pages.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 +69 -63
- 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/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
@@ -83,10 +83,11 @@ a {
|
|
83
83
|
*/
|
84
84
|
|
85
85
|
abbr[title] {
|
86
|
-
border-bottom: none; /* 1 */
|
86
|
+
border-bottom: none; /* 1 */
|
87
|
+
-webkit-text-decoration: underline; /* 2 */
|
87
88
|
text-decoration: underline;
|
88
|
-
-webkit-text-decoration: underline dotted
|
89
|
-
text-decoration: underline dotted
|
89
|
+
-webkit-text-decoration: underline dotted;
|
90
|
+
text-decoration: underline dotted; /* 2 */
|
90
91
|
}
|
91
92
|
|
92
93
|
/**
|
@@ -7454,6 +7455,7 @@ header .site-name h1 {
|
|
7454
7455
|
|
7455
7456
|
header .site-name h1 a {
|
7456
7457
|
font-weight: bold;
|
7458
|
+
-webkit-text-decoration: none;
|
7457
7459
|
text-decoration: none;
|
7458
7460
|
padding-right: 6px;
|
7459
7461
|
}
|
@@ -7517,6 +7519,7 @@ header .tabs a,
|
|
7517
7519
|
line-height: 32px;
|
7518
7520
|
height: 32px;
|
7519
7521
|
margin: 0 2px 0 0;
|
7522
|
+
-webkit-text-decoration: none;
|
7520
7523
|
text-decoration: none;
|
7521
7524
|
}
|
7522
7525
|
|
@@ -7553,6 +7556,7 @@ header .tabs a:hover,
|
|
7553
7556
|
|
7554
7557
|
.content-tabs li.current a,
|
7555
7558
|
.content-tabs li.current a:visited {
|
7559
|
+
-webkit-text-decoration: none;
|
7556
7560
|
text-decoration: none;
|
7557
7561
|
color: #444;
|
7558
7562
|
}
|
@@ -7590,6 +7594,7 @@ header .tabs a:hover,
|
|
7590
7594
|
|
7591
7595
|
.page-description .links a.current {
|
7592
7596
|
font-weight: bold;
|
7597
|
+
-webkit-text-decoration: none;
|
7593
7598
|
text-decoration: none;
|
7594
7599
|
color: #111;
|
7595
7600
|
color: var(--text-color);
|
@@ -7778,18 +7783,6 @@ main .page-description h3 {
|
|
7778
7783
|
overflow: hidden;
|
7779
7784
|
}
|
7780
7785
|
|
7781
|
-
.image-editor .focal-editor .focal-point:after {
|
7782
|
-
content: "";
|
7783
|
-
display: block;
|
7784
|
-
width: 32px;
|
7785
|
-
height: 32px;
|
7786
|
-
border-radius: 16px;
|
7787
|
-
border: 1px solid rgba(0, 0, 0, 0.3);
|
7788
|
-
margin-left: -4px;
|
7789
|
-
margin-top: -4px;
|
7790
|
-
transition: all 200ms ease-out;
|
7791
|
-
}
|
7792
|
-
|
7793
7786
|
.image-editor .focal-editor .focal-point {
|
7794
7787
|
position: absolute;
|
7795
7788
|
width: 30px;
|
@@ -7808,11 +7801,17 @@ main .page-description h3 {
|
|
7808
7801
|
transition: border-radius 200ms, margin 200ms, width 200ms, height 200ms, border-color 200ms ease-out;
|
7809
7802
|
}
|
7810
7803
|
|
7811
|
-
.image-editor .focal-editor .focal-point:
|
7812
|
-
|
7813
|
-
|
7814
|
-
|
7815
|
-
|
7804
|
+
.image-editor .focal-editor .focal-point:after {
|
7805
|
+
content: "";
|
7806
|
+
display: block;
|
7807
|
+
width: 32px;
|
7808
|
+
height: 32px;
|
7809
|
+
border-radius: 16px;
|
7810
|
+
border: 1px solid rgba(0, 0, 0, 0.3);
|
7811
|
+
margin-left: -4px;
|
7812
|
+
margin-top: -4px;
|
7813
|
+
transition: all 200ms ease-out;
|
7814
|
+
}
|
7816
7815
|
|
7817
7816
|
.image-editor .focal-editor .focal-point:hover {
|
7818
7817
|
border-color: rgba(222, 255, 255, 0.9);
|
@@ -7823,6 +7822,12 @@ main .page-description h3 {
|
|
7823
7822
|
margin-top: -20px;
|
7824
7823
|
}
|
7825
7824
|
|
7825
|
+
.image-editor .focal-editor .focal-point:hover:after {
|
7826
|
+
width: 42px;
|
7827
|
+
height: 42px;
|
7828
|
+
border-radius: 21px;
|
7829
|
+
}
|
7830
|
+
|
7826
7831
|
.image-grid {
|
7827
7832
|
--image-padding: 7px;
|
7828
7833
|
margin-bottom: 40px;
|
@@ -8197,6 +8202,7 @@ a,
|
|
8197
8202
|
a:visited {
|
8198
8203
|
color: #1d7195;
|
8199
8204
|
color: var(--link-color);
|
8205
|
+
-webkit-text-decoration: underline;
|
8200
8206
|
text-decoration: underline;
|
8201
8207
|
}
|
8202
8208
|
|
@@ -8241,6 +8247,7 @@ button a {
|
|
8241
8247
|
|
8242
8248
|
button a {
|
8243
8249
|
padding: 5px 0;
|
8250
|
+
-webkit-text-decoration: none;
|
8244
8251
|
text-decoration: none;
|
8245
8252
|
}
|
8246
8253
|
|
@@ -8543,11 +8550,13 @@ body.modal > .wrapper {
|
|
8543
8550
|
.page-tree .page a:visited {
|
8544
8551
|
color: #111;
|
8545
8552
|
color: var(--text-color);
|
8553
|
+
-webkit-text-decoration: none;
|
8546
8554
|
text-decoration: none;
|
8547
8555
|
}
|
8548
8556
|
|
8549
8557
|
.page-tree .page a:hover,
|
8550
8558
|
.page-tree .page a:focus {
|
8559
|
+
-webkit-text-decoration: underline;
|
8551
8560
|
text-decoration: underline;
|
8552
8561
|
}
|
8553
8562
|
|
@@ -8652,6 +8661,7 @@ body.modal > .wrapper {
|
|
8652
8661
|
display: inline-block;
|
8653
8662
|
font-style: normal;
|
8654
8663
|
margin: 0px 1px;
|
8664
|
+
-webkit-text-decoration: none;
|
8655
8665
|
text-decoration: none;
|
8656
8666
|
padding: 2px;
|
8657
8667
|
border-radius: 12px;
|
@@ -8661,6 +8671,7 @@ body.modal > .wrapper {
|
|
8661
8671
|
|
8662
8672
|
.pagination a:hover,
|
8663
8673
|
.pagination a:focus {
|
8674
|
+
-webkit-text-decoration: underline;
|
8664
8675
|
text-decoration: underline;
|
8665
8676
|
}
|
8666
8677
|
|
@@ -8690,6 +8701,38 @@ body.modal > .wrapper {
|
|
8690
8701
|
margin: 20px -2px;
|
8691
8702
|
}
|
8692
8703
|
|
8704
|
+
.search-bar {
|
8705
|
+
display: flex;
|
8706
|
+
}
|
8707
|
+
|
8708
|
+
.search-bar input {
|
8709
|
+
flex: 1 1 auto;
|
8710
|
+
border-right: none;
|
8711
|
+
max-width: 600px;
|
8712
|
+
min-width: 50px;
|
8713
|
+
}
|
8714
|
+
|
8715
|
+
.search-bar input:focus {
|
8716
|
+
z-index: 20;
|
8717
|
+
}
|
8718
|
+
|
8719
|
+
.search-bar button {
|
8720
|
+
border-top-left-radius: 0px;
|
8721
|
+
border-bottom-left-radius: 0px;
|
8722
|
+
white-space: nowrap;
|
8723
|
+
}
|
8724
|
+
|
8725
|
+
main .search-bar {
|
8726
|
+
background: #f8f8f8;
|
8727
|
+
background: var(--background-disabled-color);
|
8728
|
+
padding: 16px 32px;
|
8729
|
+
margin: 0px 0px 16px 0px;
|
8730
|
+
}
|
8731
|
+
|
8732
|
+
.sidebar .search-bar {
|
8733
|
+
margin-top: 16px;
|
8734
|
+
}
|
8735
|
+
|
8693
8736
|
.sidebar {
|
8694
8737
|
background: #f8f8f8;
|
8695
8738
|
background: var(--background-disabled-color);
|
@@ -9065,11 +9108,13 @@ td.drag-handle {
|
|
9065
9108
|
|
9066
9109
|
.page-list .page a.page-name,
|
9067
9110
|
.page-list .page a.page-name:visited {
|
9111
|
+
-webkit-text-decoration: none;
|
9068
9112
|
text-decoration: none;
|
9069
9113
|
color: #222;
|
9070
9114
|
}
|
9071
9115
|
|
9072
9116
|
.page-list .page a.page-name:hover {
|
9117
|
+
-webkit-text-decoration: underline;
|
9073
9118
|
text-decoration: underline;
|
9074
9119
|
}
|
9075
9120
|
|
@@ -9131,6 +9176,13 @@ td.drag-handle {
|
|
9131
9176
|
font-weight: normal;
|
9132
9177
|
}
|
9133
9178
|
|
9179
|
+
.news-item-list .autopublish-notice, .calendar-item-list .autopublish-notice {
|
9180
|
+
font-size: 0.75rem;
|
9181
|
+
font-weight: normal;
|
9182
|
+
color: #666;
|
9183
|
+
color: var(--text-light-color);
|
9184
|
+
}
|
9185
|
+
|
9134
9186
|
.news-item-list .draft,
|
9135
9187
|
.calendar-item-list .draft,
|
9136
9188
|
.news-item-list .hidden,
|
@@ -33,7 +33,7 @@
|
|
33
33
|
height: 80vh;
|
34
34
|
display: flex;
|
35
35
|
|
36
|
-
@media --mobile {
|
36
|
+
@media (--mobile) {
|
37
37
|
width: 100%;
|
38
38
|
height: 100%;
|
39
39
|
flex-direction: column;
|
@@ -145,7 +145,7 @@
|
|
145
145
|
}
|
146
146
|
}
|
147
147
|
|
148
|
-
@media --mobile {
|
148
|
+
@media (--mobile) {
|
149
149
|
width: 100%;
|
150
150
|
margin-left: 0px;
|
151
151
|
padding-bottom: 20px;
|
@@ -3,7 +3,7 @@
|
|
3
3
|
margin-bottom: 40px;
|
4
4
|
display: flex;
|
5
5
|
|
6
|
-
@media --mobile {
|
6
|
+
@media (--mobile) {
|
7
7
|
flex-direction: column;
|
8
8
|
}
|
9
9
|
|
@@ -87,7 +87,7 @@
|
|
87
87
|
flex-direction: row;
|
88
88
|
visibility: hidden;
|
89
89
|
|
90
|
-
@media --mobile {
|
90
|
+
@media (--mobile) {
|
91
91
|
visibility: visible;
|
92
92
|
}
|
93
93
|
|
@@ -106,7 +106,7 @@
|
|
106
106
|
& .primary-image {
|
107
107
|
width: 33.33%;
|
108
108
|
|
109
|
-
@media --mobile {
|
109
|
+
@media (--mobile) {
|
110
110
|
width: 100%;
|
111
111
|
}
|
112
112
|
|
@@ -147,11 +147,11 @@
|
|
147
147
|
justify-content: flex-end;
|
148
148
|
width: 16.66%;
|
149
149
|
|
150
|
-
@media --narrow {
|
150
|
+
@media (--narrow) {
|
151
151
|
width: 50%;
|
152
152
|
}
|
153
153
|
|
154
|
-
@media --mobile {
|
154
|
+
@media (--mobile) {
|
155
155
|
width: 50%;
|
156
156
|
}
|
157
157
|
}
|
@@ -185,7 +185,7 @@
|
|
185
185
|
& .grid {
|
186
186
|
width: 66.67%;
|
187
187
|
|
188
|
-
@media --mobile {
|
188
|
+
@media (--mobile) {
|
189
189
|
width: 100%;
|
190
190
|
}
|
191
191
|
}
|
@@ -193,11 +193,11 @@
|
|
193
193
|
& .images .grid-image {
|
194
194
|
width: 25%;
|
195
195
|
|
196
|
-
@media --narrow {
|
196
|
+
@media (--narrow) {
|
197
197
|
width: 50%;
|
198
198
|
}
|
199
199
|
|
200
|
-
@media --mobile {
|
200
|
+
@media (--mobile) {
|
201
201
|
width: 50%;
|
202
202
|
}
|
203
203
|
}
|
@@ -9,7 +9,7 @@
|
|
9
9
|
box-shadow: inset 0px 0px 1px rgba(0, 0, 0, 0.1);
|
10
10
|
padding: 1px;
|
11
11
|
|
12
|
-
@media --mobile {
|
12
|
+
@media (--mobile) {
|
13
13
|
flex-direction: column;
|
14
14
|
}
|
15
15
|
|
@@ -29,7 +29,7 @@
|
|
29
29
|
max-height: 400px;
|
30
30
|
}
|
31
31
|
|
32
|
-
@media --mobile {
|
32
|
+
@media (--mobile) {
|
33
33
|
max-width: 100%;
|
34
34
|
}
|
35
35
|
}
|
@@ -28,7 +28,7 @@ body {
|
|
28
28
|
display: flex;
|
29
29
|
flex-flow: row nowrap;
|
30
30
|
|
31
|
-
@media --mobile {
|
31
|
+
@media (--mobile) {
|
32
32
|
flex-flow: column nowrap;
|
33
33
|
}
|
34
34
|
|
@@ -42,7 +42,7 @@ body {
|
|
42
42
|
width: 20%;
|
43
43
|
padding: 0px 16px;
|
44
44
|
|
45
|
-
@media --mobile {
|
45
|
+
@media (--mobile) {
|
46
46
|
width: 100%;
|
47
47
|
}
|
48
48
|
}
|
@@ -3,7 +3,7 @@ body.modal {
|
|
3
3
|
transition: filter 1000ms linear;
|
4
4
|
filter: blur(10px);
|
5
5
|
|
6
|
-
@media --mobile {
|
6
|
+
@media (--mobile) {
|
7
7
|
filter: none;
|
8
8
|
}
|
9
9
|
}
|
@@ -41,7 +41,7 @@ body.modal {
|
|
41
41
|
animation-fill-mode: forwards;
|
42
42
|
z-index: 2;
|
43
43
|
|
44
|
-
@media --mobile {
|
44
|
+
@media (--mobile) {
|
45
45
|
max-width: 100%;
|
46
46
|
width: 100vw;
|
47
47
|
height: 100vh;
|
@@ -0,0 +1,27 @@
|
|
1
|
+
.search-bar {
|
2
|
+
display: flex;
|
3
|
+
& input {
|
4
|
+
flex: 1 1 auto;
|
5
|
+
border-right: none;
|
6
|
+
max-width: 600px;
|
7
|
+
min-width: 50px;
|
8
|
+
&:focus {
|
9
|
+
z-index: 20;
|
10
|
+
}
|
11
|
+
}
|
12
|
+
& button {
|
13
|
+
border-top-left-radius: 0px;
|
14
|
+
border-bottom-left-radius: 0px;
|
15
|
+
white-space: nowrap;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
main .search-bar {
|
20
|
+
background: var(--background-disabled-color);
|
21
|
+
padding: 16px 32px;
|
22
|
+
margin: 0px 0px 16px 0px;
|
23
|
+
}
|
24
|
+
|
25
|
+
.sidebar .search-bar {
|
26
|
+
margin-top: 16px;
|
27
|
+
}
|
@@ -9,8 +9,6 @@ module Admin
|
|
9
9
|
|
10
10
|
require_authorization
|
11
11
|
|
12
|
-
helper_method :page_json
|
13
|
-
|
14
12
|
def index
|
15
13
|
@pages = Page.admin_list(@locale)
|
16
14
|
end
|
@@ -19,6 +17,15 @@ module Admin
|
|
19
17
|
@pages = Page.deleted.by_updated_at.in_locale(@locale)
|
20
18
|
end
|
21
19
|
|
20
|
+
def search
|
21
|
+
return if search_query.blank?
|
22
|
+
|
23
|
+
@search_documents =
|
24
|
+
SearchDocument.where(searchable_type: "Page")
|
25
|
+
.search(search_query, locale: @locale)
|
26
|
+
.paginate(per_page: 50, page: params[:page])
|
27
|
+
end
|
28
|
+
|
22
29
|
def show
|
23
30
|
redirect_to edit_admin_page_url(@locale, @page)
|
24
31
|
end
|
@@ -26,19 +33,14 @@ module Admin
|
|
26
33
|
def new
|
27
34
|
build_params = params[:page] ? page_params : nil
|
28
35
|
@page = build_page(@locale, build_params)
|
29
|
-
@page.parent =
|
30
|
-
Page.find(params[:parent])
|
31
|
-
elsif @news_pages
|
32
|
-
@news_pages.first
|
33
|
-
end
|
36
|
+
@page.parent = Page.find_by(id: params[:parent])
|
34
37
|
end
|
35
38
|
|
36
39
|
def edit; end
|
37
40
|
|
38
41
|
def create
|
39
|
-
@page = build_page(@locale, page_params, param_categories)
|
42
|
+
@page = build_page(@locale, page_params, param_categories).tap(&:save)
|
40
43
|
if @page.valid?
|
41
|
-
@page.save
|
42
44
|
respond_with_page(@page) do
|
43
45
|
redirect_to(edit_admin_page_url(@locale, @page))
|
44
46
|
end
|
@@ -103,8 +105,7 @@ module Admin
|
|
103
105
|
def param_categories
|
104
106
|
return [] unless params[:category]
|
105
107
|
|
106
|
-
params.permit(category: {})[:category]
|
107
|
-
.to_hash
|
108
|
+
params.permit(category: {})[:category].to_hash
|
108
109
|
.map { |id, _| Category.find(id) }
|
109
110
|
end
|
110
111
|
|
@@ -11,10 +11,26 @@ module PagesCore
|
|
11
11
|
Page.where(parent_page_id: feeds)
|
12
12
|
.order("published_at DESC")
|
13
13
|
.published
|
14
|
-
.limit(20)
|
15
14
|
.localized(locale)
|
16
15
|
end
|
17
16
|
|
17
|
+
def per_page_rss_param(default = 20, max = 1000)
|
18
|
+
return default unless params[:per_page].is_a?(String)
|
19
|
+
|
20
|
+
params[:per_page].to_i.clamp(1, max)
|
21
|
+
end
|
22
|
+
|
23
|
+
def render_page_rss(page, pagination_page = 1)
|
24
|
+
if page.feed_enabled?
|
25
|
+
render_rss(page.pages.paginate(per_page: per_page_rss_param,
|
26
|
+
page: pagination_page)
|
27
|
+
.includes(:image, :author),
|
28
|
+
title: page.name)
|
29
|
+
else
|
30
|
+
render_error 404
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
18
34
|
def render_rss(items, title: nil)
|
19
35
|
@title = PagesCore.config.site_name
|
20
36
|
@title += ": #{title}" if title
|
@@ -13,6 +13,8 @@ module PagesCore
|
|
13
13
|
|
14
14
|
layout "admin"
|
15
15
|
|
16
|
+
helper_method :search_query
|
17
|
+
|
16
18
|
class << self
|
17
19
|
# Get name of class with in lowercase, with underscores.
|
18
20
|
def underscore
|
@@ -30,6 +32,10 @@ module PagesCore
|
|
30
32
|
|
31
33
|
protected
|
32
34
|
|
35
|
+
def search_query
|
36
|
+
params[:q] || ""
|
37
|
+
end
|
38
|
+
|
33
39
|
def set_i18n_locale
|
34
40
|
I18n.locale = :en
|
35
41
|
end
|
@@ -20,7 +20,10 @@ module PagesCore
|
|
20
20
|
def index
|
21
21
|
respond_to do |format|
|
22
22
|
format.html { render_published_page(root_pages.try(&:first)) }
|
23
|
-
format.rss
|
23
|
+
format.rss do
|
24
|
+
render_rss(all_feed_items.paginate(per_page: per_page_rss_param,
|
25
|
+
page: page_param))
|
26
|
+
end
|
24
27
|
end
|
25
28
|
end
|
26
29
|
|
@@ -28,10 +31,7 @@ module PagesCore
|
|
28
31
|
respond_to do |format|
|
29
32
|
format.html { render_published_page(@page) }
|
30
33
|
format.json { render json: PageResource.new(@page) }
|
31
|
-
format.rss
|
32
|
-
render_rss(@page.pages.limit(20).includes(:image, :author),
|
33
|
-
title: @page.name)
|
34
|
-
end
|
34
|
+
format.rss { render_page_rss(@page, page_param) }
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -64,6 +64,10 @@ module PagesCore
|
|
64
64
|
super
|
65
65
|
end
|
66
66
|
|
67
|
+
def page_param
|
68
|
+
params[:page].is_a?(String) ? params[:page] : 1
|
69
|
+
end
|
70
|
+
|
67
71
|
def page_template(page)
|
68
72
|
if PagesCore::Templates.names.include?(page.template)
|
69
73
|
page.template
|
@@ -20,10 +20,8 @@ module PagesCore
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def format_record(record)
|
23
|
-
{
|
24
|
-
|
25
|
-
lastmod: format_time(record.updated_at)
|
26
|
-
}
|
23
|
+
{ loc: record_url(record),
|
24
|
+
lastmod: format_time(record.updated_at) }
|
27
25
|
end
|
28
26
|
|
29
27
|
def formatted_entries
|
@@ -46,7 +44,7 @@ module PagesCore
|
|
46
44
|
([Page.root.try(:localize, I18n.default_locale)] +
|
47
45
|
locales.flat_map do |locale|
|
48
46
|
Page.published.localized(locale).includes(:parent)
|
49
|
-
end).compact
|
47
|
+
end).compact
|
50
48
|
end
|
51
49
|
|
52
50
|
def page_record_url(record)
|
@@ -4,6 +4,15 @@ module Admin
|
|
4
4
|
module PagesHelper
|
5
5
|
include PagesCore::Admin::PageBlocksHelper
|
6
6
|
|
7
|
+
def autopublish_notice(page)
|
8
|
+
return unless page.autopublish?
|
9
|
+
|
10
|
+
tag.div(class: "autopublish-notice") do
|
11
|
+
safe_join(["This page will be published",
|
12
|
+
tag.b(publish_time(page.published_at))], " ")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
7
16
|
def available_templates_for_select
|
8
17
|
PagesCore::Templates.names.collect do |template|
|
9
18
|
if template == "index"
|
@@ -30,6 +39,14 @@ module Admin
|
|
30
39
|
([page.author] + User.activated).uniq
|
31
40
|
end
|
32
41
|
|
42
|
+
def page_list_row(page, &block)
|
43
|
+
classes = [page.status_label.downcase]
|
44
|
+
classes << "autopublish" if page.autopublish?
|
45
|
+
classes << "pinned" if page.pinned?
|
46
|
+
|
47
|
+
tag.tr(capture(&block), class: classes.join(" "))
|
48
|
+
end
|
49
|
+
|
33
50
|
def page_name(page, options = {})
|
34
51
|
page_names = if options[:include_parents]
|
35
52
|
page.self_and_ancestors.reverse
|
@@ -42,6 +59,21 @@ module Admin
|
|
42
59
|
)
|
43
60
|
end
|
44
61
|
|
62
|
+
def page_published_status(page)
|
63
|
+
return page_published_date(page) if page.published?
|
64
|
+
return tag.em("Not published") if page.status_label == "Published"
|
65
|
+
|
66
|
+
tag.em(page.status_label)
|
67
|
+
end
|
68
|
+
|
69
|
+
def page_published_date(page)
|
70
|
+
if page.published_at.year == Time.zone.now.year
|
71
|
+
l(page.published_at, format: :pages_date)
|
72
|
+
else
|
73
|
+
l(page.published_at, format: :pages_full)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
45
77
|
def publish_time(time)
|
46
78
|
if time.year != Time.zone.now.year
|
47
79
|
time.strftime("on %b %d %Y at %H:%M")
|
@@ -20,13 +20,22 @@ module PagesCore
|
|
20
20
|
tag.figcaption(caption)
|
21
21
|
end
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
# Renders an image figure tag with caption.
|
24
|
+
#
|
25
|
+
# ==== Options
|
26
|
+
# * <tt>:caption</tt>: Override caption with a string, or set to false to
|
27
|
+
# disable captions.
|
28
|
+
# * <tt>:class_name</tt>: Class name to add to figure tag.
|
29
|
+
# * <tt>:link</tt>: Link target for image.
|
30
|
+
# * <tt>:ratio</tt>: Ratio to constrain image by.
|
31
|
+
# * <tt>:size</tt>: Max size for image.
|
32
|
+
def image_figure(image, opts = {})
|
33
|
+
class_name = ["image", image_class_name(image), opts[:class_name]].compact
|
34
|
+
image_tag = image_figure_image_tag(image,
|
35
|
+
size: opts[:size], ratio:
|
36
|
+
opts[:ratio])
|
37
|
+
content = opts[:link] ? image_link_to(image_tag, opts[:link]) : image_tag
|
38
|
+
tag.figure(content + image_caption(image, caption: opts[:caption]),
|
30
39
|
class: class_name)
|
31
40
|
end
|
32
41
|
|
@@ -57,6 +66,11 @@ module PagesCore
|
|
57
66
|
{ alt: record.alternative }
|
58
67
|
end
|
59
68
|
|
69
|
+
def fit_ratio(size, ratio)
|
70
|
+
v = Vector2d(size)
|
71
|
+
Vector2d.new(v.y * ratio, v.y).fit(v)
|
72
|
+
end
|
73
|
+
|
60
74
|
def image_class_name(image)
|
61
75
|
if image.size.x == image.size.y
|
62
76
|
"square"
|
@@ -67,6 +81,13 @@ module PagesCore
|
|
67
81
|
end
|
68
82
|
end
|
69
83
|
|
84
|
+
def image_figure_image_tag(image, size: nil, ratio: nil)
|
85
|
+
size ||= default_image_size
|
86
|
+
size = fit_ratio(size, ratio) if ratio
|
87
|
+
|
88
|
+
dynamic_image_tag(image, size: size, crop: ratio && true, upscale: false)
|
89
|
+
end
|
90
|
+
|
70
91
|
def image_link_to(content, href)
|
71
92
|
tag.a(content, href: href)
|
72
93
|
end
|