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.
Files changed (199) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/app/assets/builds/fonts/661557ef.ttf +0 -0
  4. data/app/assets/builds/fonts/a18fc2d2.woff2 +0 -0
  5. data/app/assets/builds/fonts/b2c7b78f.woff2 +0 -0
  6. data/app/assets/builds/fonts/ceddc204.ttf +0 -0
  7. data/app/assets/builds/pages_core/admin-dist.js +60 -14
  8. data/app/assets/builds/pages_core/admin-dist.js.map +7 -0
  9. data/app/assets/builds/pages_core/admin.css +9272 -0
  10. data/app/assets/images/pages/admin/angle-down-solid.svg +1 -0
  11. data/app/assets/images/pages/admin/icon.svg +1 -0
  12. data/app/assets/stylesheets/pages_core/admin/components/archive.css +6 -0
  13. data/app/assets/stylesheets/{pages/admin/components/attachments.scss → pages_core/admin/components/attachments.css} +35 -28
  14. data/app/assets/stylesheets/{pages/admin.scss → pages_core/admin/components/base.css} +125 -123
  15. data/app/assets/stylesheets/pages_core/admin/components/forms.css +223 -0
  16. data/app/assets/stylesheets/{pages/admin/components/header.scss → pages_core/admin/components/header.css} +76 -46
  17. data/app/assets/stylesheets/{pages/admin/components/image_editor.scss → pages_core/admin/components/image_editor.css} +42 -31
  18. data/app/assets/stylesheets/{pages/admin/components/image_grid.scss → pages_core/admin/components/image_grid.css} +76 -64
  19. data/app/assets/stylesheets/{pages/admin/components/image_uploader.scss → pages_core/admin/components/image_uploader.css} +12 -12
  20. data/app/assets/stylesheets/{pages/admin/components/layout.scss → pages_core/admin/components/layout.css} +13 -9
  21. data/app/assets/stylesheets/pages_core/admin/components/links.css +40 -0
  22. data/app/assets/stylesheets/pages_core/admin/components/list_table.css +66 -0
  23. data/app/assets/stylesheets/{pages/admin/components/login.scss → pages_core/admin/components/login.css} +6 -5
  24. data/app/assets/stylesheets/{pages/admin/components/modal.scss → pages_core/admin/components/modal.css} +10 -12
  25. data/app/assets/stylesheets/{pages/admin/components/page_tree.scss → pages_core/admin/components/page_tree.css} +54 -55
  26. data/app/assets/stylesheets/{pages/admin/components/pagination.scss → pages_core/admin/components/pagination.css} +17 -17
  27. data/app/assets/stylesheets/pages_core/admin/components/search.css +27 -0
  28. data/app/assets/stylesheets/{pages/admin/components/sidebar.scss → pages_core/admin/components/sidebar.css} +8 -7
  29. data/app/assets/stylesheets/{pages/admin/components/tag_editor.scss → pages_core/admin/components/tag_editor.css} +10 -15
  30. data/app/assets/stylesheets/{pages/admin/components/textarea.scss → pages_core/admin/components/textarea.css} +1 -1
  31. data/app/assets/stylesheets/{pages/admin/components/toast.scss → pages_core/admin/components/toast.css} +5 -3
  32. data/app/assets/stylesheets/{pages/admin/components/toolbar.scss → pages_core/admin/components/toolbar.css} +56 -29
  33. data/app/assets/stylesheets/{pages/admin/controllers/pages.scss → pages_core/admin/controllers/pages.css} +69 -52
  34. data/app/assets/stylesheets/pages_core/admin/controllers/users.css +3 -0
  35. data/app/assets/stylesheets/pages_core/admin/vars.css +34 -0
  36. data/app/assets/stylesheets/pages_core/admin.postcss.css +9 -0
  37. data/app/controllers/admin/pages_controller.rb +12 -11
  38. data/app/controllers/concerns/pages_core/rss_controller.rb +17 -1
  39. data/app/controllers/pages_core/admin_controller.rb +6 -0
  40. data/app/controllers/pages_core/frontend/pages_controller.rb +9 -5
  41. data/app/controllers/pages_core/sitemaps_controller.rb +3 -5
  42. data/app/formatters/pages_core/image_embedder.rb +5 -27
  43. data/app/helpers/admin/calendars_helper.rb +8 -0
  44. data/app/helpers/admin/news_helper.rb +13 -0
  45. data/app/helpers/admin/pages_helper.rb +32 -0
  46. data/app/helpers/pages_core/admin/admin_helper.rb +11 -54
  47. data/app/helpers/pages_core/admin/deprecated_admin_helper.rb +40 -0
  48. data/app/helpers/pages_core/images_helper.rb +37 -0
  49. data/app/javascript/admin-dist.ts +2 -0
  50. data/app/javascript/components/Attachments/{Attachment.jsx → Attachment.tsx} +44 -35
  51. data/app/javascript/components/Attachments/{AttachmentEditor.jsx → AttachmentEditor.tsx} +23 -23
  52. data/app/javascript/components/{EditableImage.jsx → EditableImage.tsx} +28 -25
  53. data/app/javascript/components/{FileUploadButton.jsx → FileUploadButton.tsx} +15 -16
  54. data/app/javascript/components/ImageCropper/FocalPoint.tsx +94 -0
  55. data/app/javascript/components/ImageCropper/{Image.jsx → Image.tsx} +13 -14
  56. data/app/javascript/components/ImageCropper/{Toolbar.jsx → Toolbar.tsx} +19 -15
  57. data/app/javascript/components/ImageCropper/{useCrop.js → useCrop.ts} +80 -37
  58. data/app/javascript/components/{ImageCropper.jsx → ImageCropper.tsx} +17 -15
  59. data/app/javascript/components/ImageEditor/{Form.jsx → Form.tsx} +24 -23
  60. data/app/javascript/components/{ImageEditor.jsx → ImageEditor.tsx} +17 -15
  61. data/app/javascript/components/ImageGrid/{DragElement.jsx → DragElement.tsx} +12 -10
  62. data/app/javascript/components/ImageGrid/{GridImage.jsx → GridImage.tsx} +40 -30
  63. data/app/javascript/components/ImageGrid/{Placeholder.jsx → Placeholder.tsx} +5 -6
  64. data/app/javascript/components/ImageGrid.jsx +3 -4
  65. data/app/javascript/components/{ImageUploader.jsx → ImageUploader.tsx} +46 -41
  66. data/app/javascript/components/Modal.tsx +48 -0
  67. data/app/javascript/components/PageImages.tsx +28 -0
  68. data/app/javascript/components/{PageTreeDraggable.jsx → PageTree/Draggable.tsx} +79 -57
  69. data/app/javascript/components/{PageTreeNode.jsx → PageTree/Node.tsx} +86 -77
  70. data/app/javascript/components/PageTree/types.ts +15 -0
  71. data/app/javascript/components/PageTree.tsx +206 -0
  72. data/app/javascript/components/RichTextToolbarButton.tsx +17 -0
  73. data/app/javascript/components/TagEditor/{AddTagForm.jsx → AddTagForm.tsx} +9 -10
  74. data/app/javascript/components/TagEditor/{Tag.jsx → Tag.tsx} +8 -9
  75. data/app/javascript/components/{TagEditor.jsx → TagEditor.tsx} +12 -13
  76. data/app/javascript/components/Toast.tsx +61 -0
  77. data/app/javascript/components/drag/{draggedOrder.js → draggedOrder.ts} +22 -12
  78. data/app/javascript/components/drag/types.ts +28 -0
  79. data/app/javascript/components/drag/{useDragCollection.js → useDragCollection.ts} +40 -22
  80. data/app/javascript/components/drag/{useDragUploader.js → useDragUploader.ts} +34 -25
  81. data/app/javascript/components/drag/useDraggable.ts +21 -0
  82. data/app/javascript/components/{drag.js → drag.ts} +1 -0
  83. data/app/javascript/controllers/{EditPageController.js → EditPageController.ts} +3 -1
  84. data/app/javascript/controllers/{LoginController.js → LoginController.ts} +7 -3
  85. data/app/javascript/controllers/{MainController.js → MainController.ts} +19 -14
  86. data/app/javascript/{index.js → index.ts} +8 -7
  87. data/app/javascript/lib/{Tree.js → Tree.ts} +106 -85
  88. data/app/javascript/lib/{copyToClipboard.js → copyToClipboard.ts} +1 -1
  89. data/app/javascript/lib/{readyHandler.js → readyHandler.ts} +4 -2
  90. data/app/javascript/lib/{request.js → request.ts} +11 -5
  91. data/app/javascript/stores/useModalStore.ts +15 -0
  92. data/app/javascript/stores/useToastStore.ts +26 -0
  93. data/app/javascript/stores.ts +2 -0
  94. data/app/javascript/types.ts +30 -0
  95. data/app/mailers/admin_mailer.rb +1 -0
  96. data/app/models/invite.rb +8 -0
  97. data/app/policies/page_policy.rb +4 -0
  98. data/app/views/admin/calendars/_sidebar.html.erb +50 -0
  99. data/app/views/admin/calendars/show.html.erb +15 -53
  100. data/app/views/admin/invites/new.html.erb +2 -8
  101. data/app/views/admin/invites/show.html.erb +2 -4
  102. data/app/views/admin/news/_sidebar.html.erb +51 -0
  103. data/app/views/admin/news/index.html.erb +21 -56
  104. data/app/views/admin/pages/_list_item.html.erb +4 -22
  105. data/app/views/admin/pages/_search_bar.html.erb +12 -0
  106. data/app/views/admin/pages/deleted.html.erb +10 -8
  107. data/app/views/admin/pages/edit.html.erb +20 -11
  108. data/app/views/admin/pages/index.html.erb +10 -8
  109. data/app/views/admin/pages/new.html.erb +10 -14
  110. data/app/views/admin/pages/search.html.erb +54 -0
  111. data/app/views/admin/password_resets/show.html.erb +3 -5
  112. data/app/views/admin/users/deactivated.html.erb +6 -7
  113. data/app/views/admin/users/edit.html.erb +7 -9
  114. data/app/views/admin/users/index.html.erb +3 -6
  115. data/app/views/admin/users/login.html.erb +4 -5
  116. data/app/views/admin/users/new.html.erb +2 -4
  117. data/app/views/admin/users/new_password.html.erb +4 -5
  118. data/app/views/admin/users/show.html.erb +11 -9
  119. data/app/views/errors/401.html.erb +2 -1
  120. data/app/views/errors/403.html.erb +2 -1
  121. data/app/views/errors/404.html.erb +1 -3
  122. data/app/views/errors/405.html.erb +2 -1
  123. data/app/views/errors/422.html.erb +2 -1
  124. data/app/views/errors/500.html.erb +2 -3
  125. data/app/views/feeds/pages.rss.builder +3 -9
  126. data/app/views/layouts/admin/_header.html.erb +1 -2
  127. data/app/views/layouts/admin/_page_header.html.erb +4 -4
  128. data/app/views/layouts/admin.html.erb +3 -3
  129. data/app/views/layouts/errors.html.erb +127 -4
  130. data/config/routes.rb +1 -0
  131. data/lib/pages_core/configuration/pages.rb +0 -1
  132. data/lib/pages_core/engine.rb +4 -3
  133. data/lib/pages_core.rb +0 -1
  134. data/lib/rails/generators/pages_core/frontend/frontend_generator.rb +33 -17
  135. data/lib/rails/generators/pages_core/frontend/templates/application.html.erb +0 -1
  136. data/lib/rails/generators/pages_core/frontend/templates/javascript/lib/gridOverlay.ts +40 -0
  137. data/lib/rails/generators/pages_core/frontend/templates/javascript/lib/responsiveEmbeds.ts +68 -0
  138. data/lib/rails/generators/pages_core/frontend/templates/postcss.config.js +17 -0
  139. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/application.postcss.css +4 -0
  140. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/components/base.css +24 -0
  141. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/components/layout.css +21 -0
  142. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/config.css +5 -0
  143. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/animation.css +5 -0
  144. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/colors.css +18 -0
  145. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/fonts.css +6 -0
  146. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/grid.css +65 -0
  147. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/typography.css +131 -0
  148. data/lib/rails/generators/pages_core/install/templates/pages_initializer.rb +0 -3
  149. metadata +104 -255
  150. data/app/assets/images/pages/admin/icon.png +0 -0
  151. data/app/assets/images/pages/admin/image-editor-bg.png +0 -0
  152. data/app/assets/images/pages/admin/list-table-pin-blue.gif +0 -0
  153. data/app/assets/images/pages/admin/list-table-pin-disabled.gif +0 -0
  154. data/app/assets/images/pages/admin/list-table-pin-green.gif +0 -0
  155. data/app/assets/images/pages/admin/list-table-pin-red.gif +0 -0
  156. data/app/assets/images/pages/admin/list-table-pin-yellow.gif +0 -0
  157. data/app/assets/images/pages/admin/loading-modal.gif +0 -0
  158. data/app/assets/images/pages/feed-icon-14x14.png +0 -0
  159. data/app/assets/stylesheets/pages/admin/components/archive.scss +0 -6
  160. data/app/assets/stylesheets/pages/admin/components/buttons.scss +0 -23
  161. data/app/assets/stylesheets/pages/admin/components/forms.scss +0 -169
  162. data/app/assets/stylesheets/pages/admin/components/links.scss +0 -43
  163. data/app/assets/stylesheets/pages/admin/components/list_table.scss +0 -61
  164. data/app/assets/stylesheets/pages/admin/controllers/users.scss +0 -3
  165. data/app/assets/stylesheets/pages/admin/mixins/breakpoints.scss +0 -21
  166. data/app/assets/stylesheets/pages/admin/mixins/clearfix.scss +0 -7
  167. data/app/assets/stylesheets/pages/admin/mixins/gradients.scss +0 -7
  168. data/app/assets/stylesheets/pages/admin/vars.scss +0 -30
  169. data/app/assets/stylesheets/pages/errors.css +0 -128
  170. data/app/javascript/admin-dist.js +0 -2
  171. data/app/javascript/components/ImageCropper/FocalPoint.jsx +0 -93
  172. data/app/javascript/components/Modal.jsx +0 -59
  173. data/app/javascript/components/PageImages.jsx +0 -25
  174. data/app/javascript/components/PageTree.jsx +0 -196
  175. data/app/javascript/components/RichTextToolbarButton.jsx +0 -20
  176. data/app/javascript/components/Toast.jsx +0 -72
  177. data/app/javascript/components/drag/useDraggable.js +0 -17
  178. data/app/javascript/stores/ModalStore.jsx +0 -12
  179. data/app/javascript/stores/ToastStore.jsx +0 -14
  180. data/app/javascript/stores.js +0 -2
  181. data/lib/rails/generators/pages_core/frontend/templates/javascript/lib/GridOverlay.js +0 -66
  182. data/lib/rails/generators/pages_core/frontend/templates/javascript/lib/ResponsiveEmbeds.js +0 -72
  183. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/application.sass.scss +0 -15
  184. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/components/base.scss +0 -12
  185. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/config.scss +0 -26
  186. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/framework/breakpoints.scss +0 -42
  187. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/framework/clearfix.scss +0 -7
  188. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/framework/fonts.scss +0 -32
  189. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/framework/grid.scss +0 -168
  190. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/framework/grid_overlay.scss +0 -44
  191. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/colors.scss +0 -8
  192. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/typography.scss +0 -90
  193. data/lib/rails/generators/pages_core/frontend/templates/stylesheets/vendor/normalize.css +0 -349
  194. data/vendor/assets/stylesheets/ReactCrop.css +0 -167
  195. /data/app/assets/stylesheets/{pages/admin/components/tabs.scss → pages_core/admin/components/tabs.css} +0 -0
  196. /data/app/javascript/components/Attachments/{Placeholder.jsx → Placeholder.tsx} +0 -0
  197. /data/app/javascript/components/ImageGrid/{FilePlaceholder.jsx → FilePlaceholder.tsx} +0 -0
  198. /data/app/javascript/{components.js → components.ts} +0 -0
  199. /data/app/javascript/{hooks.js → hooks.ts} +0 -0
@@ -2,64 +2,59 @@
2
2
  margin-top: 10px;
3
3
  margin-bottom: 1.5em;
4
4
 
5
- .tags {
5
+ & .tags {
6
6
  line-height: 1.5;
7
7
  }
8
8
 
9
- .tag {
9
+ & .tag {
10
10
  font-size: 13px;
11
11
  cursor: pointer;
12
12
  display: block;
13
13
  float: left;
14
14
  margin: 0 5px 5px 0;
15
15
  padding: 0px;
16
- background: $c-background-disabled;
16
+ background: var(--background-disabled-color);
17
17
  border-radius: 5px;
18
18
  line-height: 26px;
19
19
  line-height: 36px;
20
20
  min-width: 40px;
21
21
  transition: all 200ms ease-out;
22
- -webkit-user-select: none;
23
- -khtml-user-select: none;
24
- -moz-user-select: none;
25
- -ms-user-select: none;
26
22
  user-select: none;
27
23
 
28
- label {
24
+ & label {
29
25
  margin: 0px;
30
26
  padding: 0px 10px;
31
27
  color: inherit;
32
28
  }
33
29
 
34
- input {
30
+ & input {
35
31
  margin: 2px 3px 0 0;
36
32
  }
37
33
 
38
- .name {
34
+ & .name {
39
35
  padding: 1px 5px;
40
36
  margin: 0;
41
37
  }
42
38
 
43
39
  &.enabled {
44
40
  color: #fff;
45
- background: $c-link;
46
- background: $c-blue-dark;
41
+ background: var(--blue-dark);
47
42
  }
48
43
  }
49
44
 
50
- .add-tag-form {
45
+ & .add-tag-form {
51
46
  float: left;
52
47
  width: 178px;
53
48
  white-space: nowrap;
54
49
  }
55
50
 
56
- input.add-tag {
51
+ & input.add-tag {
57
52
  margin-top: 0px;
58
53
  border-radius: 5px;
59
54
  margin: 0 4px 0 0;
60
55
 
61
56
  &.example {
62
- color: $c-text-light;
57
+ color: var(--text-light-color);
63
58
  }
64
59
  }
65
60
  }
@@ -1,6 +1,6 @@
1
1
  textarea.rich {
2
2
  margin-top: -32px;
3
- padding-top: 8px + 32px;
3
+ padding-top: calc(8px + 32px);
4
4
  width: 100%;
5
5
  max-width: none;
6
6
  }
@@ -6,10 +6,10 @@
6
6
  overflow: hidden;
7
7
  z-index: 200;
8
8
 
9
- .toast {
9
+ & .toast {
10
10
  font-size: 14px;
11
11
  display: inline-block;
12
- background: $c-background-invert;
12
+ background: var(--background-invert-color);
13
13
  color: white;
14
14
  margin: 20px auto 0px auto;
15
15
  padding: 15px 30px;
@@ -21,7 +21,7 @@
21
21
  animation-fill-mode: forwards;
22
22
 
23
23
  &.error {
24
- background: $c-red;
24
+ background: var(--red);
25
25
  }
26
26
 
27
27
  &.fadeout {
@@ -36,6 +36,7 @@
36
36
  from {
37
37
  transform: translateZ(0px) translateY(60px);
38
38
  }
39
+
39
40
  to {
40
41
  transform: translateZ(0px) translateY(0px);
41
42
  }
@@ -45,6 +46,7 @@
45
46
  from {
46
47
  transform: translateZ(0px) translateY(0px);
47
48
  }
49
+
48
50
  to {
49
51
  transform: translateZ(0px) translateY(60px);
50
52
  }
@@ -1,36 +1,41 @@
1
1
  .toolbar {
2
- @extend %clearfix;
3
2
  position: relative;
4
3
  display: block;
5
4
  list-style: none;
6
5
  margin: 0px;
7
- border: 1px solid $c-border;
6
+ border: 1px solid var(--border-color);
8
7
  background-color: #fafafa;
9
8
  padding: 0px 10px 0px 0px;
10
9
  line-height: 30px;
11
10
  width: auto;
12
11
 
13
- li {
12
+ &:after {
13
+ content: "";
14
+ display: table;
15
+ clear: both;
16
+ }
17
+
18
+ & li {
14
19
  list-style: none;
15
20
  margin: 0;
16
21
  padding: 0;
17
22
  }
18
23
 
19
- .info {
24
+ & .info {
20
25
  float: right;
21
- color: $c-text-lighter;
26
+ color: var(--text-lighter-color);
22
27
  padding: 0px 10px;
23
28
  }
24
29
 
25
- .label {
30
+ & .label {
26
31
  float: left;
27
32
  padding: 0px 10px;
28
- color: $c-text-light;
29
- border-right: 1px solid $c-border;
33
+ color: var(--text-light-color);
34
+ border-right: 1px solid var(--border-color);
30
35
  }
31
36
 
32
- .button,
33
- button {
37
+ & .button,
38
+ & button {
34
39
  float: left;
35
40
  display: inline;
36
41
  margin: 0px;
@@ -44,58 +49,80 @@
44
49
  min-width: 35px;
45
50
  border: 0px;
46
51
  border-left: 1px solid #fff;
47
- border-right: 1px solid $c-border;
48
- color: $c-text-light;
52
+ border-right: 1px solid var(--border-color);
53
+ color: var(--text-light-color);
49
54
  font-size: 12px;
50
- background-color: $c-button;
55
+ background-color: #f8f8f8;
51
56
  transition: all 200ms ease-out;
52
57
 
53
- i.fa {
58
+ & i.fa {
54
59
  font-size: 14px;
55
60
  }
56
61
 
57
62
  &:focus,
58
63
  &:hover {
59
- color: $c-text;
64
+ color: var(--text-color);
60
65
  background: #fdfdfd;
61
66
  }
62
67
 
63
68
  &[disabled] {
64
69
  opacity: 0.33;
65
70
  cursor: default;
66
- &:focus, &:hover {
67
- color: $c-text-light;
71
+
72
+ &:focus,
73
+ &:hover {
74
+ color: var(--text-light-color);
68
75
  background: inherit;
69
76
  }
70
77
  }
71
78
 
72
79
  &.active {
73
- color: $c-text-invert;
80
+ color: var(--text-invert-color);
74
81
  background: #666;
75
82
  border-left: 1px solid #555;
76
83
  border-right: 1px solid #888;
77
84
  }
78
85
 
79
- // font-awesome doesn't have h1-h6, so we'll apply some tricks
86
+ /* font-awesome doesn't have h1-h6, so we'll apply some tricks */
80
87
  &.header {
81
88
  vertical-align: bottom;
82
- i {
89
+
90
+ & i {
83
91
  margin-left: -6px;
84
92
  }
85
- i:after {
86
- font-family: Helvetica, Georgia, serif;
93
+
94
+ & i:after {
95
+ font-family: var(--font-os-sans);
87
96
  font-weight: bold;
88
97
  font-size: 13px;
89
98
  display: inline-block;
90
99
  position: absolute;
91
- bottom: 3px;
100
+ bottom: 5px;
101
+ }
102
+
103
+ &.h1 i::after {
104
+ content: "1";
105
+ }
106
+
107
+ &.h2 i::after {
108
+ content: "2";
109
+ }
110
+
111
+ &.h3 i::after {
112
+ content: "3";
113
+ }
114
+
115
+ &.h4 i::after {
116
+ content: "4";
117
+ }
118
+
119
+ &.h5 i::after {
120
+ content: "5";
121
+ }
122
+
123
+ &.h6 i::after {
124
+ content: "6";
92
125
  }
93
- &.h1 i::after { content: "1" }
94
- &.h2 i::after { content: "2" }
95
- &.h3 i::after { content: "3" }
96
- &.h4 i::after { content: "4" }
97
- &.h5 i::after { content: "5" }
98
- &.h6 i::after { content: "6" }
99
126
  }
100
127
  }
101
128
 
@@ -6,7 +6,7 @@
6
6
  margin-left: 6px;
7
7
  width: 13px;
8
8
  height: 16px;
9
- background-image: image-url("pages/admin/drag-icon.png");
9
+ background-image: url("pages/admin/drag-icon.png");
10
10
  }
11
11
 
12
12
  td.drag-handle {
@@ -17,48 +17,49 @@ td.drag-handle {
17
17
 
18
18
  .page-list {
19
19
  float: left;
20
- list-style-type: none;
20
+ list-style-type: none;
21
21
  padding: 0;
22
22
  margin: 0;
23
23
  font-size: 1.2em;
24
24
  margin-left: -8px;
25
25
  margin-top: 16px;
26
26
 
27
- .page-listing {
27
+ & .page-listing {
28
28
  border: 1px solid transparent;
29
29
  padding: 3px 8px 2px 8px !important;
30
30
  }
31
31
 
32
- ul {
32
+ & ul {
33
33
  border-left: 1px dotted #ccc !important;
34
34
  margin-left: 12px !important;
35
- padding-left: 8px !important
35
+ padding-left: 8px !important;
36
36
  }
37
37
 
38
- ul li {
38
+ & ul li {
39
39
  overflow: auto;
40
40
  }
41
41
 
42
- .page {
42
+ & .page {
43
43
  padding: 4px 8px;
44
44
  line-height: 17px;
45
45
  float: left;
46
46
 
47
- .status {
47
+ & .status {
48
48
  font-weight: normal;
49
49
  }
50
50
 
51
- a.page-name,
52
- a.page-name:visited {
51
+ & a.page-name,
52
+ & a.page-name:visited {
53
53
  text-decoration: none;
54
54
  color: #222;
55
55
  }
56
- a.page-name:hover {
56
+
57
+ & a.page-name:hover {
57
58
  text-decoration: underline;
58
59
  }
59
60
 
60
61
  &.hidden {
61
- a.page-name {
62
+ & a.page-name {
62
63
  color: #666;
63
64
  }
64
65
  }
@@ -66,42 +67,43 @@ td.drag-handle {
66
67
  &:hover {
67
68
  background: #ffd;
68
69
  border: 1px solid #dda;
69
- .status {
70
+
71
+ & .status {
70
72
  display: none;
71
73
  }
72
74
  }
73
75
  }
74
76
 
75
- .page-without-locale {
77
+ & .page-without-locale {
76
78
  color: #888;
77
79
  }
78
80
 
79
- li {
80
- font-weight: bold;
81
- margin: 0;
81
+ & li {
82
+ font-weight: bold;
83
+ margin: 0;
82
84
  padding: 0;
83
85
  clear: both;
84
86
  }
85
87
 
86
- li li {
88
+ & li li {
87
89
  font-weight: normal;
88
- font-size: 12px;
90
+ font-size: 12px;
89
91
  padding: 0;
90
92
  }
91
93
 
92
- ul {
94
+ & ul {
93
95
  clear: both;
94
- list-style-type: none;
95
- border-left: 1px dashed #ccc;
96
- margin: 0 0 0px 12px;
96
+ list-style-type: none;
97
+ border-left: 1px dashed #ccc;
98
+ margin: 0 0 0px 12px;
97
99
  padding: 0 0 0 12px;
98
100
  }
99
101
 
100
- .hover {
102
+ & .hover {
101
103
  background: #cef;
102
104
  }
103
105
 
104
- .drag-handle {
106
+ & .drag-handle {
105
107
  display: none;
106
108
  }
107
109
 
@@ -112,87 +114,102 @@ td.drag-handle {
112
114
 
113
115
  .news-item-list,
114
116
  .calendar-item-list {
115
- .name {
117
+ & .name {
116
118
  line-height: 1.5;
117
- small {
119
+
120
+ & small {
118
121
  font-weight: normal;
119
122
  }
120
123
  }
121
124
 
122
- .draft,
123
- .hidden,
124
- .autopublish,
125
- .reviewed {
126
- background: $c-background-disabled;
125
+ & .autopublish-notice {
126
+ font-size: 0.75rem;
127
+ font-weight: normal;
128
+ color: var(--text-light-color);
129
+ }
130
+
131
+ & .draft,
132
+ & .hidden,
133
+ & .autopublish,
134
+ & .reviewed {
135
+ background: var(--background-disabled-color);
127
136
  }
128
137
 
129
- .pinned .name {
130
- background: transparent image-url("pages/admin/list-table-pin-blue.gif") no-repeat 13px 50%;
138
+ & .pinned .name {
139
+ background: transparent radial-gradient(ellipse at center, #92b6c4 50%, transparent 50%) no-repeat left 12px top 50%;
140
+ background-size: 10px 10px;
131
141
  }
132
142
  }
133
143
 
134
144
  .edit-page {
135
145
  width: auto;
136
146
 
137
- main div.content {
147
+ & main div.content {
138
148
  padding-top: 16px;
139
149
  }
140
150
 
141
- .hidden-options {
151
+ & .hidden-options {
142
152
  display: none;
143
153
  }
144
154
 
145
- .autopublish-notice,
146
- .published-date,
147
- .advanced-options {
155
+ & .autopublish-notice,
156
+ & .published-date,
157
+ & .advanced-options {
148
158
  display: none;
159
+
149
160
  &.show {
150
161
  display: block;
151
162
  }
152
163
  }
153
164
 
154
- main input[type=text],
155
- main textarea {
165
+ & main input[type=text],
166
+ & main textarea {
156
167
  width: 100%;
157
168
  max-width: 100%;
158
169
  }
159
170
 
160
- main input.page_title {
171
+ & main input.page_title {
161
172
  font-weight: bold;
162
173
  font-size: 1.4em;
163
- color: $c-text;
174
+ color: var(--text-color);
164
175
  }
165
176
  }
166
177
 
167
-
168
178
  .file-list {
169
179
  list-style-type: none;
170
180
  margin-left: 0;
171
181
  margin-right: 0;
172
182
  padding: 0;
173
- .embed-code {
183
+
184
+ & .embed-code {
174
185
  display: inline-block;
175
186
  width: 60px;
176
187
  margin-right: 10px;
177
188
  }
178
- li {
189
+
190
+ & li {
179
191
  line-height: 30px;
180
- border-top: 1px solid $c-border;
192
+ border-top: 1px solid var(--border-color);
193
+
181
194
  &:first-child {
182
195
  border-top: 0px;
183
196
  }
184
- .actions {
197
+
198
+ & .actions {
185
199
  float: right;
186
200
  }
187
- .drag-handle {
201
+
202
+ & .drag-handle {
188
203
  margin-right: 10px;
189
204
  }
190
205
  }
191
- .placeholder {
206
+
207
+ & .placeholder {
192
208
  height: 30px;
193
209
  }
194
- .ui-sortable-helper {
195
- border: 1px solid $c-border !important;
210
+
211
+ & .ui-sortable-helper {
212
+ border: 1px solid var(--border-color) !important;
196
213
  background: rgba(250, 250, 250, 0.8);
197
214
  }
198
215
  }
@@ -0,0 +1,3 @@
1
+ table.users tr.invite td {
2
+ color: var(--text-light-color);
3
+ }
@@ -0,0 +1,34 @@
1
+ @custom-media --mobile screen and (max-width: 900px);
2
+ @custom-media --narrow screen and (max-width: 1150px);
3
+
4
+ :root {
5
+ --font-os-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Oxygen, Cantarell, sans-serif;
6
+
7
+ --red: #c00007;
8
+ --red-transparent: #c0000740;
9
+ --red-hover: #8d0005;
10
+ --red-light: #d6a6a8;
11
+ --red-invert: #fff0f3;
12
+ --blue: #1d7195;
13
+ --blue-hover: #15516a;
14
+ --blue-transparent: #1d719540;
15
+ --blue-dark: #114055;
16
+ --green: #19ac1e;
17
+ --green-hover: #137f16;
18
+ --green-transparent: #19ac1e40;
19
+ --background-color: #fff;
20
+ --background-invert-color: #000;
21
+ --background-disabled-color: #f8f8f8;
22
+ --background-warning-color: #ffdfa0;
23
+ --text-color: #111;
24
+ --text-light-color: #666;
25
+ --text-lighter-color: #999;
26
+ --text-invert-color: #fff;
27
+ --link-color: var(--blue);
28
+ --link-hover-color: var(--blue-hover);
29
+ --border-color: #ddd;
30
+ --border-color-light: #eee;
31
+ --button-border-color: #aaa;
32
+ --button-color: #e8e8e8;
33
+ --button-color-hover: #d8d8d8;
34
+ }
@@ -0,0 +1,9 @@
1
+ @import "normalize.css";
2
+ @import "react-image-crop/dist/ReactCrop";
3
+ @import "@fortawesome/fontawesome-free/css/fontawesome";
4
+ @import "@fortawesome/fontawesome-free/css/solid";
5
+ @import "@fortawesome/fontawesome-free/css/regular";
6
+
7
+ @import "admin/vars";
8
+ @import-glob "admin/components/*.css";
9
+ @import-glob "admin/controllers/*.css";
@@ -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 = if params[: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