pages_core 3.13.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.
Files changed (257) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/app/assets/builds/pages_core/admin-dist.js +19 -8
  4. data/app/assets/builds/pages_core/admin-dist.js.map +4 -4
  5. data/app/assets/builds/pages_core/admin.css +704 -388
  6. data/app/assets/fonts/Inter-Black.woff2 +0 -0
  7. data/app/assets/fonts/Inter-BlackItalic.woff2 +0 -0
  8. data/app/assets/fonts/Inter-Bold.woff2 +0 -0
  9. data/app/assets/fonts/Inter-BoldItalic.woff2 +0 -0
  10. data/app/assets/fonts/Inter-ExtraBold.woff2 +0 -0
  11. data/app/assets/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
  12. data/app/assets/fonts/Inter-ExtraLight.woff2 +0 -0
  13. data/app/assets/fonts/Inter-ExtraLightItalic.woff2 +0 -0
  14. data/app/assets/fonts/Inter-Italic.woff2 +0 -0
  15. data/app/assets/fonts/Inter-Light.woff2 +0 -0
  16. data/app/assets/fonts/Inter-LightItalic.woff2 +0 -0
  17. data/app/assets/fonts/Inter-Medium.woff2 +0 -0
  18. data/app/assets/fonts/Inter-MediumItalic.woff2 +0 -0
  19. data/app/assets/fonts/Inter-Regular.woff2 +0 -0
  20. data/app/assets/fonts/Inter-SemiBold.woff2 +0 -0
  21. data/app/assets/fonts/Inter-SemiBoldItalic.woff2 +0 -0
  22. data/app/assets/fonts/Inter-Thin.woff2 +0 -0
  23. data/app/assets/fonts/Inter-ThinItalic.woff2 +0 -0
  24. data/app/assets/fonts/InterDisplay-Black.woff2 +0 -0
  25. data/app/assets/fonts/InterDisplay-BlackItalic.woff2 +0 -0
  26. data/app/assets/fonts/InterDisplay-Bold.woff2 +0 -0
  27. data/app/assets/fonts/InterDisplay-BoldItalic.woff2 +0 -0
  28. data/app/assets/fonts/InterDisplay-ExtraBold.woff2 +0 -0
  29. data/app/assets/fonts/InterDisplay-ExtraBoldItalic.woff2 +0 -0
  30. data/app/assets/fonts/InterDisplay-ExtraLight.woff2 +0 -0
  31. data/app/assets/fonts/InterDisplay-ExtraLightItalic.woff2 +0 -0
  32. data/app/assets/fonts/InterDisplay-Italic.woff2 +0 -0
  33. data/app/assets/fonts/InterDisplay-Light.woff2 +0 -0
  34. data/app/assets/fonts/InterDisplay-LightItalic.woff2 +0 -0
  35. data/app/assets/fonts/InterDisplay-Medium.woff2 +0 -0
  36. data/app/assets/fonts/InterDisplay-MediumItalic.woff2 +0 -0
  37. data/app/assets/fonts/InterDisplay-Regular.woff2 +0 -0
  38. data/app/assets/fonts/InterDisplay-SemiBold.woff2 +0 -0
  39. data/app/assets/fonts/InterDisplay-SemiBoldItalic.woff2 +0 -0
  40. data/app/assets/fonts/InterDisplay-Thin.woff2 +0 -0
  41. data/app/assets/fonts/InterDisplay-ThinItalic.woff2 +0 -0
  42. data/app/assets/fonts/InterVariable-Italic.woff2 +0 -0
  43. data/app/assets/fonts/InterVariable.woff2 +0 -0
  44. data/app/assets/stylesheets/pages_core/admin/components/archive.css +1 -1
  45. data/app/assets/stylesheets/pages_core/admin/components/attachments.css +22 -34
  46. data/app/assets/stylesheets/pages_core/admin/components/base.css +1 -68
  47. data/app/assets/stylesheets/pages_core/admin/components/forms.css +107 -48
  48. data/app/assets/stylesheets/pages_core/admin/components/header.css +56 -58
  49. data/app/assets/stylesheets/pages_core/admin/components/image_editor.css +35 -24
  50. data/app/assets/stylesheets/pages_core/admin/components/image_grid.css +28 -27
  51. data/app/assets/stylesheets/pages_core/admin/components/image_uploader.css +5 -5
  52. data/app/assets/stylesheets/pages_core/admin/components/layout.css +7 -1
  53. data/app/assets/stylesheets/pages_core/admin/components/list_table.css +24 -15
  54. data/app/assets/stylesheets/pages_core/admin/components/page_tree.css +63 -104
  55. data/app/assets/stylesheets/pages_core/admin/components/pagination.css +12 -13
  56. data/app/assets/stylesheets/pages_core/admin/components/search.css +1 -16
  57. data/app/assets/stylesheets/pages_core/admin/components/sidebar.css +5 -11
  58. data/app/assets/stylesheets/pages_core/admin/components/tag_editor.css +22 -36
  59. data/app/assets/stylesheets/pages_core/admin/components/toast.css +1 -2
  60. data/app/assets/stylesheets/pages_core/admin/components/toolbar.css +10 -10
  61. data/app/assets/stylesheets/pages_core/admin/components/totp.css +26 -0
  62. data/app/assets/stylesheets/pages_core/admin/controllers/pages.css +37 -51
  63. data/app/assets/stylesheets/pages_core/admin/global/fonts.css +271 -0
  64. data/app/assets/stylesheets/pages_core/admin/global/typography.css +109 -0
  65. data/app/assets/stylesheets/pages_core/admin/vars.css +1 -3
  66. data/app/assets/stylesheets/pages_core/admin.postcss.css +1 -0
  67. data/app/controllers/admin/account_recoveries_controller.rb +87 -0
  68. data/app/controllers/admin/invites_controller.rb +3 -2
  69. data/app/controllers/admin/otp_secrets_controller.rb +45 -0
  70. data/app/controllers/admin/pages_controller.rb +22 -42
  71. data/app/controllers/admin/recovery_codes_controller.rb +32 -0
  72. data/app/controllers/admin/sessions_controller.rb +65 -0
  73. data/app/controllers/admin/users_controller.rb +2 -8
  74. data/app/controllers/concerns/pages_core/authentication.rb +12 -10
  75. data/app/controllers/concerns/pages_core/error_reporting.rb +1 -1
  76. data/app/controllers/concerns/pages_core/page_parameters.rb +29 -0
  77. data/app/controllers/concerns/pages_core/policies_helper.rb +1 -1
  78. data/app/controllers/concerns/pages_core/preview_pages_controller.rb +20 -20
  79. data/app/controllers/pages_core/admin_controller.rb +1 -3
  80. data/app/controllers/pages_core/frontend/pages_controller.rb +2 -6
  81. data/app/formatters/pages_core/html_formatter.rb +2 -4
  82. data/app/helpers/admin/menu_helper.rb +5 -4
  83. data/app/helpers/admin/pages_helper.rb +1 -21
  84. data/app/helpers/pages_core/admin/admin_helper.rb +13 -3
  85. data/app/helpers/pages_core/admin/content_tabs_helper.rb +1 -2
  86. data/app/helpers/pages_core/admin/labelled_field_helper.rb +1 -1
  87. data/app/helpers/pages_core/frontend_helper.rb +1 -1
  88. data/app/helpers/pages_core/images_helper.rb +10 -8
  89. data/app/helpers/pages_core/labelled_form_builder.rb +2 -7
  90. data/app/helpers/pages_core/page_path_helper.rb +1 -1
  91. data/app/javascript/components/Attachments/Attachment.tsx +20 -18
  92. data/app/javascript/components/Attachments/AttachmentEditor.tsx +11 -9
  93. data/app/javascript/components/{Attachments.jsx → Attachments/List.tsx} +58 -63
  94. data/app/javascript/components/Attachments/useAttachments.ts +15 -0
  95. data/app/javascript/components/Attachments.tsx +14 -0
  96. data/app/javascript/components/DateRangeSelect.tsx +105 -0
  97. data/app/javascript/components/DateTimeSelect.tsx +136 -0
  98. data/app/javascript/components/EditableImage.tsx +11 -9
  99. data/app/javascript/components/FileUploadButton.tsx +7 -7
  100. data/app/javascript/components/ImageCropper/FocalPoint.tsx +9 -12
  101. data/app/javascript/components/ImageCropper/Image.tsx +10 -8
  102. data/app/javascript/components/ImageCropper/Toolbar.tsx +11 -12
  103. data/app/javascript/components/ImageCropper/useCrop.ts +24 -53
  104. data/app/javascript/components/ImageCropper.tsx +10 -15
  105. data/app/javascript/components/ImageEditor/Form.tsx +12 -8
  106. data/app/javascript/components/ImageEditor.tsx +12 -7
  107. data/app/javascript/components/ImageGrid/DragElement.tsx +9 -12
  108. data/app/javascript/components/{ImageGrid.jsx → ImageGrid/Grid.tsx} +62 -71
  109. data/app/javascript/components/ImageGrid/GridImage.tsx +22 -23
  110. data/app/javascript/components/ImageGrid/Placeholder.tsx +2 -2
  111. data/app/javascript/components/ImageGrid/useImageGrid.ts +26 -0
  112. data/app/javascript/components/ImageGrid.tsx +15 -0
  113. data/app/javascript/components/ImageUploader.tsx +35 -22
  114. data/app/javascript/components/LabelledField.tsx +34 -0
  115. data/app/javascript/components/Modal.tsx +2 -2
  116. data/app/javascript/components/PageForm/Block.tsx +81 -0
  117. data/app/javascript/components/PageForm/Content.tsx +54 -0
  118. data/app/javascript/components/PageForm/Dates.tsx +66 -0
  119. data/app/javascript/components/PageForm/Files.tsx +28 -0
  120. data/app/javascript/components/PageForm/Form.tsx +41 -0
  121. data/app/javascript/components/PageForm/Images.tsx +28 -0
  122. data/app/javascript/components/PageForm/LocaleLinks.tsx +36 -0
  123. data/app/javascript/components/PageForm/Metadata.tsx +67 -0
  124. data/app/javascript/components/PageForm/Options.tsx +180 -0
  125. data/app/javascript/components/PageForm/PageDescription.tsx +48 -0
  126. data/app/javascript/components/PageForm/PathSegment.tsx +65 -0
  127. data/app/javascript/components/PageForm/TabPanel.tsx +21 -0
  128. data/app/javascript/components/PageForm/Tabs.tsx +33 -0
  129. data/app/javascript/components/PageForm/UnconfiguredContent.tsx +42 -0
  130. data/app/javascript/components/PageForm/pageParams.ts +95 -0
  131. data/app/javascript/components/PageForm/preview.ts +23 -0
  132. data/app/javascript/components/PageForm/usePage.ts +169 -0
  133. data/app/javascript/components/PageForm/useTabs.ts +46 -0
  134. data/app/javascript/components/PageForm.tsx +163 -0
  135. data/app/javascript/components/PageImages.tsx +7 -9
  136. data/app/javascript/components/PageTree/Draggable.tsx +40 -39
  137. data/app/javascript/components/PageTree/Node.tsx +62 -56
  138. data/app/javascript/components/PageTree/PageName.tsx +28 -0
  139. data/app/javascript/components/PageTree.tsx +65 -53
  140. data/app/javascript/components/{RichTextArea.jsx → RichTextArea.tsx} +98 -79
  141. data/app/javascript/components/RichTextToolbarButton.tsx +4 -6
  142. data/app/javascript/components/TagEditor/AddTagForm.tsx +19 -12
  143. data/app/javascript/components/TagEditor/Editor.tsx +32 -0
  144. data/app/javascript/components/TagEditor/Tag.tsx +6 -4
  145. data/app/javascript/components/TagEditor/useTags.ts +58 -0
  146. data/app/javascript/components/TagEditor.tsx +8 -58
  147. data/app/javascript/components/Toast.tsx +3 -3
  148. data/app/javascript/components/drag/draggedOrder.ts +22 -14
  149. data/app/javascript/components/drag/useDragCollection.ts +35 -30
  150. data/app/javascript/components/drag/useDragUploader.ts +32 -21
  151. data/app/javascript/components/drag/useDraggable.ts +7 -6
  152. data/app/javascript/components/drag.ts +0 -1
  153. data/app/javascript/components.ts +1 -3
  154. data/app/javascript/features/RichText.tsx +2 -3
  155. data/app/javascript/features/contentTabs.ts +79 -0
  156. data/app/javascript/index.ts +5 -14
  157. data/app/javascript/lib/Tree.ts +31 -45
  158. data/app/javascript/lib/request.ts +11 -11
  159. data/app/javascript/stores/useToastStore.ts +1 -1
  160. data/app/javascript/types/Attachments.ts +29 -0
  161. data/app/javascript/types/Crop.ts +36 -0
  162. data/app/javascript/types/Drag.ts +34 -0
  163. data/app/javascript/types/Images.ts +47 -0
  164. data/app/javascript/types/PageEditor.ts +26 -0
  165. data/app/javascript/types/Pages.ts +75 -0
  166. data/app/javascript/types/Tags.ts +9 -0
  167. data/app/javascript/types/Template.ts +24 -0
  168. data/app/javascript/types/Trees.ts +19 -0
  169. data/app/javascript/types.ts +2 -25
  170. data/app/mailers/admin_mailer.rb +2 -2
  171. data/app/models/attachment.rb +1 -1
  172. data/app/models/concerns/pages_core/authenticable_user.rb +63 -0
  173. data/app/models/concerns/pages_core/emailable.rb +16 -0
  174. data/app/models/concerns/pages_core/page_model/templateable.rb +2 -16
  175. data/app/models/invite.rb +2 -6
  176. data/app/models/otp_secret.rb +101 -0
  177. data/app/models/page.rb +0 -3
  178. data/app/models/user.rb +2 -68
  179. data/app/policies/page_policy.rb +6 -2
  180. data/app/policies/user_policy.rb +4 -0
  181. data/app/resources/admin/page_resource.rb +95 -0
  182. data/app/resources/admin/page_tree_resource.rb +27 -0
  183. data/app/resources/admin/template_configuration_resource.rb +50 -0
  184. data/app/views/admin/account_recoveries/new.html.erb +22 -0
  185. data/app/views/admin/account_recoveries/show.html.erb +37 -0
  186. data/app/views/admin/invites/show.html.erb +1 -1
  187. data/app/views/admin/news/_sidebar.html.erb +2 -4
  188. data/app/views/admin/news/index.html.erb +0 -1
  189. data/app/views/admin/otp_secrets/create.html.erb +7 -0
  190. data/app/views/admin/otp_secrets/new.html.erb +60 -0
  191. data/app/views/admin/pages/_form.html.erb +10 -30
  192. data/app/views/admin/pages/_search_bar.html.erb +1 -1
  193. data/app/views/admin/pages/edit.html.erb +1 -57
  194. data/app/views/admin/pages/index.html.erb +1 -1
  195. data/app/views/admin/pages/new.html.erb +1 -44
  196. data/app/views/admin/recovery_codes/_codes.html.erb +14 -0
  197. data/app/views/admin/recovery_codes/create.html.erb +7 -0
  198. data/app/views/admin/recovery_codes/new.html.erb +11 -0
  199. data/app/views/admin/sessions/_otp_form.html.erb +13 -0
  200. data/app/views/admin/sessions/new.html.erb +31 -0
  201. data/app/views/admin/sessions/verify_otp.html.erb +19 -0
  202. data/app/views/admin/users/_access_control.html.erb +5 -1
  203. data/app/views/admin/users/_list.html.erb +12 -7
  204. data/app/views/admin/users/edit.html.erb +31 -1
  205. data/app/views/admin/users/new.html.erb +1 -1
  206. data/app/views/admin_mailer/account_recovery.text.erb +10 -0
  207. data/app/views/layouts/admin/_header.html.erb +3 -5
  208. data/app/views/layouts/admin/_page_header.html.erb +1 -2
  209. data/app/views/layouts/admin/_toast.html.erb +12 -0
  210. data/app/views/layouts/admin.html.erb +2 -2
  211. data/config/locales/en.yml +11 -7
  212. data/config/routes.rb +13 -12
  213. data/db/migrate/20240126160700_add_2fa_fields.rb +26 -0
  214. data/db/migrate/20240129201300_remove_password_reset_tokens.rb +13 -0
  215. data/db/migrate/20240131140700_change_email_to_citext.rb +18 -0
  216. data/db/migrate/20240201160700_remove_persistent_data.rb +7 -0
  217. data/db/migrate/20240508145300_remove_categories.rb +21 -0
  218. data/lib/pages_core/configuration/base.rb +2 -2
  219. data/lib/pages_core/templates/configuration.rb +1 -1
  220. data/lib/pages_core/templates/configuration_proxy.rb +2 -2
  221. data/lib/pages_core/templates/template_configuration.rb +11 -1
  222. data/lib/pages_core/templates.rb +6 -4
  223. data/lib/pages_core/version.rb +1 -1
  224. data/lib/pages_core.rb +6 -0
  225. data/lib/rails/generators/pages_core/frontend/templates/javascript/lib/gridOverlay.ts +6 -7
  226. data/lib/rails/generators/pages_core/frontend/templates/javascript/lib/responsiveEmbeds.ts +17 -12
  227. data/lib/rails/generators/pages_core/rspec/rspec_generator.rb +0 -2
  228. data/lib/rails/generators/pages_core/rspec/templates/rails_helper.rb +3 -4
  229. metadata +143 -35
  230. data/app/assets/stylesheets/pages_core/admin/components/login.css +0 -33
  231. data/app/controllers/admin/categories_controller.rb +0 -56
  232. data/app/controllers/admin/password_resets_controller.rb +0 -85
  233. data/app/controllers/concerns/pages_core/admin/persistent_params.rb +0 -75
  234. data/app/controllers/sessions_controller.rb +0 -27
  235. data/app/helpers/pages_core/admin/page_blocks_helper.rb +0 -66
  236. data/app/helpers/pages_core/admin/page_json_helper.rb +0 -23
  237. data/app/javascript/components/DateRangeSelect.jsx +0 -225
  238. data/app/javascript/components/PageDates.jsx +0 -73
  239. data/app/javascript/components/PageFiles.jsx +0 -25
  240. data/app/javascript/components/PageTree/types.ts +0 -15
  241. data/app/javascript/components/drag/types.ts +0 -28
  242. data/app/javascript/controllers/EditPageController.ts +0 -22
  243. data/app/javascript/controllers/LoginController.ts +0 -32
  244. data/app/javascript/controllers/MainController.ts +0 -74
  245. data/app/javascript/controllers/PageOptionsController.js +0 -67
  246. data/app/models/category.rb +0 -22
  247. data/app/models/page_category.rb +0 -6
  248. data/app/models/password_reset_token.rb +0 -34
  249. data/app/views/admin/pages/_edit_content.html.erb +0 -19
  250. data/app/views/admin/pages/_edit_files.html.erb +0 -4
  251. data/app/views/admin/pages/_edit_images.html.erb +0 -4
  252. data/app/views/admin/pages/_edit_metadata.html.erb +0 -35
  253. data/app/views/admin/pages/_edit_options.html.erb +0 -91
  254. data/app/views/admin/password_resets/show.html.erb +0 -21
  255. data/app/views/admin/users/login.html.erb +0 -65
  256. data/app/views/admin_mailer/password_reset.text.erb +0 -11
  257. data/lib/rails/generators/pages_core/rspec/templates/mailer_macros.rb +0 -11
@@ -24,42 +24,42 @@ td.drag-handle {
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
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
56
 
57
- & a.page-name:hover {
57
+ a.page-name:hover {
58
58
  text-decoration: underline;
59
59
  }
60
60
 
61
61
  &.hidden {
62
- & a.page-name {
62
+ a.page-name {
63
63
  color: #666;
64
64
  }
65
65
  }
@@ -68,30 +68,30 @@ td.drag-handle {
68
68
  background: #ffd;
69
69
  border: 1px solid #dda;
70
70
 
71
- & .status {
71
+ .status {
72
72
  display: none;
73
73
  }
74
74
  }
75
75
  }
76
76
 
77
- & .page-without-locale {
77
+ .page-without-locale {
78
78
  color: #888;
79
79
  }
80
80
 
81
- & li {
82
- font-weight: bold;
81
+ li {
82
+ font-weight: var(--bold-weight);
83
83
  margin: 0;
84
84
  padding: 0;
85
85
  clear: both;
86
86
  }
87
87
 
88
- & li li {
88
+ li li {
89
89
  font-weight: normal;
90
90
  font-size: 12px;
91
91
  padding: 0;
92
92
  }
93
93
 
94
- & ul {
94
+ ul {
95
95
  clear: both;
96
96
  list-style-type: none;
97
97
  border-left: 1px dashed #ccc;
@@ -99,11 +99,11 @@ td.drag-handle {
99
99
  padding: 0 0 0 12px;
100
100
  }
101
101
 
102
- & .hover {
102
+ .hover {
103
103
  background: #cef;
104
104
  }
105
105
 
106
- & .drag-handle {
106
+ .drag-handle {
107
107
  display: none;
108
108
  }
109
109
 
@@ -114,28 +114,28 @@ td.drag-handle {
114
114
 
115
115
  .news-item-list,
116
116
  .calendar-item-list {
117
- & .name {
117
+ .name {
118
118
  line-height: 1.5;
119
119
 
120
- & small {
120
+ small {
121
121
  font-weight: normal;
122
122
  }
123
123
  }
124
124
 
125
- & .autopublish-notice {
125
+ .autopublish-notice {
126
126
  font-size: 0.75rem;
127
127
  font-weight: normal;
128
128
  color: var(--text-light-color);
129
129
  }
130
130
 
131
- & .draft,
132
- & .hidden,
133
- & .autopublish,
134
- & .reviewed {
131
+ .draft,
132
+ .hidden,
133
+ .autopublish,
134
+ .reviewed {
135
135
  background: var(--background-disabled-color);
136
136
  }
137
137
 
138
- & .pinned .name {
138
+ .pinned .name {
139
139
  background: transparent
140
140
  radial-gradient(ellipse at center, #92b6c4 50%, transparent 50%) no-repeat
141
141
  left 12px top 50%;
@@ -146,32 +146,18 @@ td.drag-handle {
146
146
  .edit-page {
147
147
  width: auto;
148
148
 
149
- & main div.content {
150
- padding-top: 16px;
149
+ .advanced-options {
150
+ margin-top: 1.5rem;
151
151
  }
152
152
 
153
- & .hidden-options {
154
- display: none;
155
- }
156
-
157
- & .autopublish-notice,
158
- & .published-date,
159
- & .advanced-options {
160
- display: none;
161
-
162
- &.show {
163
- display: block;
164
- }
165
- }
166
-
167
- & main input[type="text"],
168
- & main textarea {
153
+ main input[type="text"],
154
+ main textarea {
169
155
  width: 100%;
170
156
  max-width: 100%;
171
157
  }
172
158
 
173
- & main input.page_title {
174
- font-weight: bold;
159
+ main input.page_title {
160
+ font-weight: var(--bold-weight);
175
161
  font-size: 1.4em;
176
162
  color: var(--text-color);
177
163
  }
@@ -183,13 +169,13 @@ td.drag-handle {
183
169
  margin-right: 0;
184
170
  padding: 0;
185
171
 
186
- & .embed-code {
172
+ .embed-code {
187
173
  display: inline-block;
188
174
  width: 60px;
189
175
  margin-right: 10px;
190
176
  }
191
177
 
192
- & li {
178
+ li {
193
179
  line-height: 30px;
194
180
  border-top: 1px solid var(--border-color);
195
181
 
@@ -197,20 +183,20 @@ td.drag-handle {
197
183
  border-top: 0px;
198
184
  }
199
185
 
200
- & .actions {
186
+ .actions {
201
187
  float: right;
202
188
  }
203
189
 
204
- & .drag-handle {
190
+ .drag-handle {
205
191
  margin-right: 10px;
206
192
  }
207
193
  }
208
194
 
209
- & .placeholder {
195
+ .placeholder {
210
196
  height: 30px;
211
197
  }
212
198
 
213
- & .ui-sortable-helper {
199
+ .ui-sortable-helper {
214
200
  border: 1px solid var(--border-color) !important;
215
201
  background: rgba(250, 250, 250, 0.8);
216
202
  }
@@ -0,0 +1,271 @@
1
+ /* Inter */
2
+
3
+ @font-face {
4
+ font-family: "InterVariable";
5
+ font-style: normal;
6
+ font-weight: 100 900;
7
+ font-display: swap;
8
+ src: url("InterVariable.woff2") format("woff2");
9
+ }
10
+
11
+ @font-face {
12
+ font-family: "InterVariable";
13
+ font-style: italic;
14
+ font-weight: 100 900;
15
+ font-display: swap;
16
+ src: url("InterVariable-Italic.woff2") format("woff2");
17
+ }
18
+
19
+ @font-face {
20
+ font-family: "Inter";
21
+ font-style: normal;
22
+ font-weight: 100;
23
+ src: url("Inter-Thin.woff2") format("woff2");
24
+ }
25
+
26
+ @font-face {
27
+ font-family: "Inter";
28
+ font-style: italic;
29
+ font-weight: 100;
30
+ src: url("Inter-ThinItalic.woff2") format("woff2");
31
+ }
32
+
33
+ @font-face {
34
+ font-family: "Inter";
35
+ font-style: normal;
36
+ font-weight: 200;
37
+ src: url("Inter-ExtraLight.woff2") format("woff2");
38
+ }
39
+
40
+ @font-face {
41
+ font-family: "Inter";
42
+ font-style: italic;
43
+ font-weight: 200;
44
+ src: url("Inter-ExtraLightItalic.woff2") format("woff2");
45
+ }
46
+
47
+ @font-face {
48
+ font-family: "Inter";
49
+ font-style: normal;
50
+ font-weight: 300;
51
+ src: url("Inter-Light.woff2") format("woff2");
52
+ }
53
+
54
+ @font-face {
55
+ font-family: "Inter";
56
+ font-style: italic;
57
+ font-weight: 300;
58
+ src: url("Inter-LightItalic.woff2") format("woff2");
59
+ }
60
+
61
+ @font-face {
62
+ font-family: "Inter";
63
+ font-style: normal;
64
+ font-weight: 400;
65
+ src: url("Inter-Regular.woff2") format("woff2");
66
+ }
67
+
68
+ @font-face {
69
+ font-family: "Inter";
70
+ font-style: italic;
71
+ font-weight: 400;
72
+ src: url("Inter-Italic.woff2") format("woff2");
73
+ }
74
+
75
+ @font-face {
76
+ font-family: "Inter";
77
+ font-style: normal;
78
+ font-weight: 500;
79
+ src: url("Inter-Medium.woff2") format("woff2");
80
+ }
81
+
82
+ @font-face {
83
+ font-family: "Inter";
84
+ font-style: italic;
85
+ font-weight: 500;
86
+ src: url("Inter-MediumItalic.woff2") format("woff2");
87
+ }
88
+
89
+ @font-face {
90
+ font-family: "Inter";
91
+ font-style: normal;
92
+ font-weight: 600;
93
+ src: url("Inter-SemiBold.woff2") format("woff2");
94
+ }
95
+
96
+ @font-face {
97
+ font-family: "Inter";
98
+ font-style: italic;
99
+ font-weight: 600;
100
+ src: url("Inter-SemiBoldItalic.woff2") format("woff2");
101
+ }
102
+
103
+ @font-face {
104
+ font-family: "Inter";
105
+ font-style: normal;
106
+ font-weight: 700;
107
+ src: url("Inter-Bold.woff2") format("woff2");
108
+ }
109
+
110
+ @font-face {
111
+ font-family: "Inter";
112
+ font-style: italic;
113
+ font-weight: 700;
114
+ src: url("Inter-BoldItalic.woff2") format("woff2");
115
+ }
116
+
117
+ @font-face {
118
+ font-family: "Inter";
119
+ font-style: normal;
120
+ font-weight: 800;
121
+ src: url("Inter-ExtraBold.woff2") format("woff2");
122
+ }
123
+
124
+ @font-face {
125
+ font-family: "Inter";
126
+ font-style: italic;
127
+ font-weight: 800;
128
+ src: url("Inter-ExtraBoldItalic.woff2") format("woff2");
129
+ }
130
+
131
+ @font-face {
132
+ font-family: "Inter";
133
+ font-style: normal;
134
+ font-weight: 900;
135
+ src: url("Inter-Black.woff2") format("woff2");
136
+ }
137
+
138
+ @font-face {
139
+ font-family: "Inter";
140
+ font-style: italic;
141
+ font-weight: 900;
142
+ src: url("Inter-BlackItalic.woff2") format("woff2");
143
+ }
144
+
145
+ /* InterDisplay */
146
+
147
+ @font-face {
148
+ font-family: "InterDisplay";
149
+ font-style: normal;
150
+ font-weight: 100;
151
+ src: url("InterDisplay-Thin.woff2") format("woff2");
152
+ }
153
+
154
+ @font-face {
155
+ font-family: "InterDisplay";
156
+ font-style: italic;
157
+ font-weight: 100;
158
+ src: url("InterDisplay-ThinItalic.woff2") format("woff2");
159
+ }
160
+
161
+ @font-face {
162
+ font-family: "InterDisplay";
163
+ font-style: normal;
164
+ font-weight: 200;
165
+ src: url("InterDisplay-ExtraLight.woff2") format("woff2");
166
+ }
167
+
168
+ @font-face {
169
+ font-family: "InterDisplay";
170
+ font-style: italic;
171
+ font-weight: 200;
172
+ src: url("InterDisplay-ExtraLightItalic.woff2") format("woff2");
173
+ }
174
+
175
+ @font-face {
176
+ font-family: "InterDisplay";
177
+ font-style: normal;
178
+ font-weight: 300;
179
+ src: url("InterDisplay-Light.woff2") format("woff2");
180
+ }
181
+
182
+ @font-face {
183
+ font-family: "InterDisplay";
184
+ font-style: italic;
185
+ font-weight: 300;
186
+ src: url("InterDisplay-LightItalic.woff2") format("woff2");
187
+ }
188
+
189
+ @font-face {
190
+ font-family: "InterDisplay";
191
+ font-style: normal;
192
+ font-weight: 400;
193
+ src: url("InterDisplay-Regular.woff2") format("woff2");
194
+ }
195
+
196
+ @font-face {
197
+ font-family: "InterDisplay";
198
+ font-style: italic;
199
+ font-weight: 400;
200
+ src: url("InterDisplay-Italic.woff2") format("woff2");
201
+ }
202
+
203
+ @font-face {
204
+ font-family: "InterDisplay";
205
+ font-style: normal;
206
+ font-weight: 500;
207
+ src: url("InterDisplay-Medium.woff2") format("woff2");
208
+ }
209
+
210
+ @font-face {
211
+ font-family: "InterDisplay";
212
+ font-style: italic;
213
+ font-weight: 500;
214
+ src: url("InterDisplay-MediumItalic.woff2") format("woff2");
215
+ }
216
+
217
+ @font-face {
218
+ font-family: "InterDisplay";
219
+ font-style: normal;
220
+ font-weight: 600;
221
+ src: url("InterDisplay-SemiBold.woff2") format("woff2");
222
+ }
223
+
224
+ @font-face {
225
+ font-family: "InterDisplay";
226
+ font-style: italic;
227
+ font-weight: 600;
228
+ src: url("InterDisplay-SemiBoldItalic.woff2") format("woff2");
229
+ }
230
+
231
+ @font-face {
232
+ font-family: "InterDisplay";
233
+ font-style: normal;
234
+ font-weight: 700;
235
+ src: url("InterDisplay-Bold.woff2") format("woff2");
236
+ }
237
+
238
+ @font-face {
239
+ font-family: "InterDisplay";
240
+ font-style: italic;
241
+ font-weight: 700;
242
+ src: url("InterDisplay-BoldItalic.woff2") format("woff2");
243
+ }
244
+
245
+ @font-face {
246
+ font-family: "InterDisplay";
247
+ font-style: normal;
248
+ font-weight: 800;
249
+ src: url("InterDisplay-ExtraBold.woff2") format("woff2");
250
+ }
251
+
252
+ @font-face {
253
+ font-family: "InterDisplay";
254
+ font-style: italic;
255
+ font-weight: 800;
256
+ src: url("InterDisplay-ExtraBoldItalic.woff2") format("woff2");
257
+ }
258
+
259
+ @font-face {
260
+ font-family: "InterDisplay";
261
+ font-style: normal;
262
+ font-weight: 900;
263
+ src: url("InterDisplay-Black.woff2") format("woff2");
264
+ }
265
+
266
+ @font-face {
267
+ font-family: "InterDisplay";
268
+ font-style: italic;
269
+ font-weight: 900;
270
+ src: url("InterDisplay-BlackItalic.woff2") format("woff2");
271
+ }
@@ -0,0 +1,109 @@
1
+ @define-mixin child-margins {
2
+ &:first-child {
3
+ margin-top: 0px;
4
+ }
5
+ &:last-child {
6
+ margin-bottom: 0px;
7
+ }
8
+ }
9
+
10
+ :root {
11
+ --bold-weight: 600;
12
+
13
+ --font-os-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
14
+ Roboto, Ubuntu, "Helvetica Neue", Oxygen, Cantarell, sans-serif;
15
+ --font-sans: "Inter", var(--font-os-sans);
16
+
17
+ --font-heading-2: 600 1.4rem/1.2 var(--font-sans);
18
+ --font-heading-3: 600 1.2rem/1.4 var(--font-sans);
19
+
20
+ --font-large: 400 1.2rem/1.4 var(--font-sans);
21
+ --font-normal: 400 1rem/1.5 var(--font-sans);
22
+ --font-small: 400 0.875rem/1.33 var(--font-sans);
23
+ }
24
+
25
+ html {
26
+ font-size: 1rem;
27
+ }
28
+
29
+ body {
30
+ font: var(--font-normal);
31
+ }
32
+
33
+ b,
34
+ strong {
35
+ font-weight: var(--bold-weight);
36
+ }
37
+
38
+ h1,
39
+ h2,
40
+ h3,
41
+ h4,
42
+ h5,
43
+ h6,
44
+ p {
45
+ margin: 1.25rem 0;
46
+ @mixin child-margins;
47
+ }
48
+
49
+ h2 {
50
+ font: var(--font-heading-2);
51
+ margin-top: 3rem;
52
+ letter-spacing: -0.04rem;
53
+ @mixin child-margins;
54
+ form &:first-of-type {
55
+ margin-top: 0px;
56
+ }
57
+ }
58
+
59
+ h3,
60
+ .sidebar h2 {
61
+ font: var(--font-heading-3);
62
+ margin-top: 2rem;
63
+ letter-spacing: -0.02rem;
64
+ @mixin child-margins;
65
+ }
66
+
67
+ table,
68
+ small,
69
+ .page-description,
70
+ header,
71
+ .sidebar,
72
+ .pagination {
73
+ font: var(--font-small);
74
+ }
75
+
76
+ .page-tree {
77
+ .date,
78
+ .status-label,
79
+ .collapsed-label,
80
+ button {
81
+ font: var(--font-small);
82
+ }
83
+ }
84
+
85
+ .login-form,
86
+ form .field {
87
+ label {
88
+ font-weight: var(--bold-weight);
89
+ }
90
+ label,
91
+ .description {
92
+ font: var(--font-small);
93
+ }
94
+ }
95
+
96
+ input,
97
+ textarea {
98
+ font: var(--font-normal);
99
+ }
100
+
101
+ button,
102
+ select {
103
+ font: var(--font-small);
104
+ }
105
+
106
+ input[type="text"].large,
107
+ input[type="password"].large {
108
+ font: var(--font-large);
109
+ }
@@ -2,9 +2,6 @@
2
2
  @custom-media --narrow screen and (max-width: 1150px);
3
3
 
4
4
  :root {
5
- --font-os-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
6
- Roboto, Ubuntu, "Helvetica Neue", Oxygen, Cantarell, sans-serif;
7
-
8
5
  --red: #c00007;
9
6
  --red-transparent: #c0000740;
10
7
  --red-hover: #8d0005;
@@ -21,6 +18,7 @@
21
18
  --background-invert-color: #000;
22
19
  --background-disabled-color: #f8f8f8;
23
20
  --background-warning-color: #ffdfa0;
21
+ --background-highlight-color: #e7f3f9;
24
22
  --text-color: #111;
25
23
  --text-light-color: #666;
26
24
  --text-lighter-color: #999;
@@ -5,5 +5,6 @@
5
5
  @import "@fortawesome/fontawesome-free/css/regular";
6
6
 
7
7
  @import "admin/vars";
8
+ @import-glob "admin/global/*.css";
8
9
  @import-glob "admin/components/*.css";
9
10
  @import-glob "admin/controllers/*.css";
@@ -0,0 +1,87 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Admin
4
+ class AccountRecoveriesController < Admin::AdminController
5
+ before_action :require_authentication, except: %i[new create show update]
6
+ before_action :find_by_token, only: %i[show update]
7
+ around_action :validate_otp, only: %i[update]
8
+
9
+ def show; end
10
+
11
+ def new; end
12
+
13
+ def create
14
+ @user = User.find_by(email: params[:email])
15
+ if @user
16
+ deliver_account_recovery(@user)
17
+ flash[:notice] = t("pages_core.account_recovery.sent")
18
+ else
19
+ flash[:notice] = t("pages_core.account_recovery.not_found")
20
+ end
21
+ redirect_to admin_login_url
22
+ end
23
+
24
+ def update
25
+ if user_params[:password].present? && @user.update(user_params)
26
+ authenticate!(@user)
27
+ flash[:notice] = t("pages_core.account_recovery.changed")
28
+ redirect_to admin_login_url
29
+ else
30
+ render action: :show
31
+ end
32
+ end
33
+
34
+ private
35
+
36
+ def deliver_account_recovery(user)
37
+ AdminMailer.account_recovery(
38
+ user,
39
+ admin_account_recovery_with_token_url(recovery_token(user))
40
+ ).deliver_later
41
+ end
42
+
43
+ def fail_recovery(message)
44
+ flash[:notice] = message
45
+ redirect_to new_admin_account_recovery_url
46
+ end
47
+
48
+ def find_by_token
49
+ @token = params[:token]
50
+ @user = User.find(message_verifier.verify(@token).symbolize_keys[:id])
51
+ return if @user
52
+
53
+ fail_recovery(t("pages_core.account_recovery.invalid_request"))
54
+ rescue ActiveSupport::MessageVerifier::InvalidSignature
55
+ fail_recovery(t("pages_core.account_recovery.invalid_request"))
56
+ end
57
+
58
+ def message_verifier
59
+ Rails.application.message_verifier(:account_recovery)
60
+ end
61
+
62
+ def recovery_token(user)
63
+ message_verifier.generate({ id: user.id }, expires_in: 24.hours)
64
+ end
65
+
66
+ def user_params
67
+ params.require(:user).permit(:password, :password_confirmation)
68
+ end
69
+
70
+ def validate_otp
71
+ User.transaction do
72
+ if valid_otp(@user, params[:otp])
73
+ yield
74
+ else
75
+ flash.now[:notice] = t("pages_core.otp.invalid_code")
76
+ render action: :show
77
+ end
78
+ end
79
+ end
80
+
81
+ def valid_otp(user, otp)
82
+ return true unless user.otp_enabled?
83
+
84
+ OtpSecret.new(user).validate_otp_or_recovery_code!(otp)
85
+ end
86
+ end
87
+ end