glib-web 8.0.0 → 8.2.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 (171) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/glib/json/libs.rb +16 -0
  3. data/app/helpers/glib/app_feature_support_helper.rb +33 -8
  4. data/app/helpers/glib/json_ui/view_builder/fields.rb +74 -9
  5. data/app/helpers/glib/json_ui/view_builder/panels.rb +1 -0
  6. data/app/helpers/glib/json_ui/view_builder.rb +15 -0
  7. data/app/jobs/glib/scheduled_job.rb +581 -0
  8. data/app/jobs/glib/scheduled_job_tick.rb +21 -0
  9. data/app/models/concerns/glib/enum_symbolization.rb +41 -4
  10. data/app/models/glib/scheduled_job_run.rb +16 -0
  11. data/app/views/json_ui/garage/forms/action_text.json.jbuilder +34 -0
  12. data/app/views/json_ui/garage/forms/action_text_attachment.json.jbuilder +7 -0
  13. data/app/views/json_ui/garage/forms/action_text_library.json.jbuilder +26 -0
  14. data/app/views/json_ui/garage/forms/action_text_preview.json.jbuilder +9 -0
  15. data/app/views/json_ui/garage/forms/index.json.jbuilder +6 -0
  16. data/app/views/json_ui/garage/forms/pickers.json.jbuilder +7 -0
  17. data/app/views/json_ui/garage/panels/carousel.json.jbuilder +7 -0
  18. data/app/views/json_ui/garage/test_page/_header.json.jbuilder +6 -0
  19. data/app/views/json_ui/garage/test_page/fields_actionText.json.jbuilder +87 -0
  20. data/app/views/json_ui/garage/test_page/fields_sign.json.jbuilder +34 -3
  21. data/app/views/json_ui/garage/test_page/form_dirty_hooks.json.jbuilder +22 -0
  22. data/app/views/json_ui/garage/test_page/form_hidden_panels.json.jbuilder +124 -0
  23. data/app/views/json_ui/garage/test_page/logics_set.json.jbuilder +35 -0
  24. data/app/views/json_ui/garage/test_page/panels_association.json.jbuilder +42 -0
  25. data/app/views/layouts/json_ui/renderer.html.erb +11 -1
  26. data/engines/blog/README.md +172 -0
  27. data/engines/blog/app/assets/stylesheets/glib/blog/admin.css +855 -0
  28. data/engines/blog/app/assets/stylesheets/glib/blog/themes/clean.css +816 -0
  29. data/engines/blog/app/assets/stylesheets/glib/blog/themes/editorial.css +631 -0
  30. data/engines/blog/app/controllers/concerns/glib/blog/admin/media_listing.rb +27 -0
  31. data/engines/blog/app/controllers/concerns/glib/blog/pagination.rb +14 -0
  32. data/engines/blog/app/controllers/glib/blog/admin/application_controller.rb +28 -0
  33. data/engines/blog/app/controllers/glib/blog/admin/authors_controller.rb +55 -0
  34. data/engines/blog/app/controllers/glib/blog/admin/categories_controller.rb +53 -0
  35. data/engines/blog/app/controllers/glib/blog/admin/comment_replies_controller.rb +34 -0
  36. data/engines/blog/app/controllers/glib/blog/admin/comments_controller.rb +50 -0
  37. data/engines/blog/app/controllers/glib/blog/admin/dashboards_controller.rb +34 -0
  38. data/engines/blog/app/controllers/glib/blog/admin/direct_uploads_controller.rb +30 -0
  39. data/engines/blog/app/controllers/glib/blog/admin/editor_attachments_controller.rb +16 -0
  40. data/engines/blog/app/controllers/glib/blog/admin/media_item_trashes_controller.rb +43 -0
  41. data/engines/blog/app/controllers/glib/blog/admin/media_items_controller.rb +61 -0
  42. data/engines/blog/app/controllers/glib/blog/admin/media_picks_controller.rb +19 -0
  43. data/engines/blog/app/controllers/glib/blog/admin/post_bulk_actions_controller.rb +33 -0
  44. data/engines/blog/app/controllers/glib/blog/admin/posts_controller.rb +79 -0
  45. data/engines/blog/app/controllers/glib/blog/admin/settings_controller.rb +27 -0
  46. data/engines/blog/app/controllers/glib/blog/admin/tags_controller.rb +46 -0
  47. data/engines/blog/app/controllers/glib/blog/application_controller.rb +90 -0
  48. data/engines/blog/app/controllers/glib/blog/authors_controller.rb +15 -0
  49. data/engines/blog/app/controllers/glib/blog/categories_controller.rb +15 -0
  50. data/engines/blog/app/controllers/glib/blog/comments_controller.rb +41 -0
  51. data/engines/blog/app/controllers/glib/blog/posts_controller.rb +47 -0
  52. data/engines/blog/app/controllers/glib/blog/tags_controller.rb +15 -0
  53. data/engines/blog/app/helpers/glib/blog/admin_helper.rb +57 -0
  54. data/engines/blog/app/helpers/glib/blog/comments_helper.rb +16 -0
  55. data/engines/blog/app/helpers/glib/blog/post_list_helper.rb +26 -0
  56. data/engines/blog/app/helpers/glib/blog/theme_helper.rb +85 -0
  57. data/engines/blog/app/jobs/glib/blog/purge_trash_job.rb +13 -0
  58. data/engines/blog/app/models/concerns/glib/blog/sluggable.rb +72 -0
  59. data/engines/blog/app/models/concerns/glib/blog/uses_media.rb +35 -0
  60. data/engines/blog/app/models/glib/blog/application_record.rb +7 -0
  61. data/engines/blog/app/models/glib/blog/author.rb +47 -0
  62. data/engines/blog/app/models/glib/blog/category.rb +53 -0
  63. data/engines/blog/app/models/glib/blog/comment.rb +66 -0
  64. data/engines/blog/app/models/glib/blog/comment_token.rb +30 -0
  65. data/engines/blog/app/models/glib/blog/media_item.rb +121 -0
  66. data/engines/blog/app/models/glib/blog/media_upload.rb +97 -0
  67. data/engines/blog/app/models/glib/blog/media_usage.rb +10 -0
  68. data/engines/blog/app/models/glib/blog/post.rb +110 -0
  69. data/engines/blog/app/models/glib/blog/post_view.rb +24 -0
  70. data/engines/blog/app/models/glib/blog/setting.rb +55 -0
  71. data/engines/blog/app/models/glib/blog/slug_redirect.rb +7 -0
  72. data/engines/blog/app/models/glib/blog/tag.rb +15 -0
  73. data/engines/blog/app/models/glib/blog/tagging.rb +10 -0
  74. data/engines/blog/app/policies/glib/blog/admin/author_policy.rb +11 -0
  75. data/engines/blog/app/policies/glib/blog/admin/category_policy.rb +11 -0
  76. data/engines/blog/app/policies/glib/blog/admin/comment_policy.rb +16 -0
  77. data/engines/blog/app/policies/glib/blog/admin/comment_reply_policy.rb +12 -0
  78. data/engines/blog/app/policies/glib/blog/admin/dashboard_policy.rb +11 -0
  79. data/engines/blog/app/policies/glib/blog/admin/direct_upload_policy.rb +11 -0
  80. data/engines/blog/app/policies/glib/blog/admin/editor_attachment_policy.rb +11 -0
  81. data/engines/blog/app/policies/glib/blog/admin/media_item_policy.rb +20 -0
  82. data/engines/blog/app/policies/glib/blog/admin/media_item_trash_policy.rb +11 -0
  83. data/engines/blog/app/policies/glib/blog/admin/media_pick_policy.rb +11 -0
  84. data/engines/blog/app/policies/glib/blog/admin/post_bulk_action_policy.rb +12 -0
  85. data/engines/blog/app/policies/glib/blog/admin/post_policy.rb +16 -0
  86. data/engines/blog/app/policies/glib/blog/admin/setting_policy.rb +11 -0
  87. data/engines/blog/app/policies/glib/blog/admin/tag_policy.rb +11 -0
  88. data/engines/blog/app/policies/glib/blog/application_policy.rb +16 -0
  89. data/engines/blog/app/policies/glib/blog/author_policy.rb +9 -0
  90. data/engines/blog/app/policies/glib/blog/category_policy.rb +9 -0
  91. data/engines/blog/app/policies/glib/blog/comment_policy.rb +11 -0
  92. data/engines/blog/app/policies/glib/blog/post_policy.rb +9 -0
  93. data/engines/blog/app/policies/glib/blog/tag_policy.rb +9 -0
  94. data/engines/blog/app/views/glib/blog/admin/_delete_button.json.jbuilder +24 -0
  95. data/engines/blog/app/views/glib/blog/admin/_nav.json.jbuilder +45 -0
  96. data/engines/blog/app/views/glib/blog/admin/_status_chip.json.jbuilder +2 -0
  97. data/engines/blog/app/views/glib/blog/admin/authors/_form.json.jbuilder +17 -0
  98. data/engines/blog/app/views/glib/blog/admin/authors/edit.json.jbuilder +7 -0
  99. data/engines/blog/app/views/glib/blog/admin/authors/index.json.jbuilder +50 -0
  100. data/engines/blog/app/views/glib/blog/admin/authors/new.json.jbuilder +11 -0
  101. data/engines/blog/app/views/glib/blog/admin/categories/_form.json.jbuilder +13 -0
  102. data/engines/blog/app/views/glib/blog/admin/categories/edit.json.jbuilder +7 -0
  103. data/engines/blog/app/views/glib/blog/admin/categories/index.json.jbuilder +68 -0
  104. data/engines/blog/app/views/glib/blog/admin/categories/new.json.jbuilder +7 -0
  105. data/engines/blog/app/views/glib/blog/admin/comments/_moderation_buttons.json.jbuilder +35 -0
  106. data/engines/blog/app/views/glib/blog/admin/comments/index.json.jbuilder +59 -0
  107. data/engines/blog/app/views/glib/blog/admin/dashboards/show.json.jbuilder +109 -0
  108. data/engines/blog/app/views/glib/blog/admin/media_item_trashes/index.json.jbuilder +32 -0
  109. data/engines/blog/app/views/glib/blog/admin/media_items/_rows.json.jbuilder +32 -0
  110. data/engines/blog/app/views/glib/blog/admin/media_items/edit.json.jbuilder +68 -0
  111. data/engines/blog/app/views/glib/blog/admin/media_items/index.json.jbuilder +68 -0
  112. data/engines/blog/app/views/glib/blog/admin/media_items/new.json.jbuilder +18 -0
  113. data/engines/blog/app/views/glib/blog/admin/media_picks/index.json.jbuilder +29 -0
  114. data/engines/blog/app/views/glib/blog/admin/posts/_form.json.jbuilder +104 -0
  115. data/engines/blog/app/views/glib/blog/admin/posts/edit.json.jbuilder +1 -0
  116. data/engines/blog/app/views/glib/blog/admin/posts/index.json.jbuilder +109 -0
  117. data/engines/blog/app/views/glib/blog/admin/posts/new.json.jbuilder +1 -0
  118. data/engines/blog/app/views/glib/blog/admin/settings/edit.json.jbuilder +55 -0
  119. data/engines/blog/app/views/glib/blog/admin/tags/_form.json.jbuilder +6 -0
  120. data/engines/blog/app/views/glib/blog/admin/tags/edit.json.jbuilder +7 -0
  121. data/engines/blog/app/views/glib/blog/admin/tags/index.json.jbuilder +30 -0
  122. data/engines/blog/app/views/glib/blog/admin/tags/new.json.jbuilder +7 -0
  123. data/engines/blog/app/views/glib/blog/authors/show.json.jbuilder +4 -0
  124. data/engines/blog/app/views/glib/blog/categories/show.json.jbuilder +4 -0
  125. data/engines/blog/app/views/glib/blog/comments/pending.json.jbuilder +7 -0
  126. data/engines/blog/app/views/glib/blog/media_items/_media_item.html.erb +14 -0
  127. data/engines/blog/app/views/glib/blog/posts/_comment.json.jbuilder +23 -0
  128. data/engines/blog/app/views/glib/blog/posts/_comment_form.json.jbuilder +14 -0
  129. data/engines/blog/app/views/glib/blog/posts/_comments.json.jbuilder +21 -0
  130. data/engines/blog/app/views/glib/blog/posts/index.json.jbuilder +4 -0
  131. data/engines/blog/app/views/glib/blog/posts/show.json.jbuilder +5 -0
  132. data/engines/blog/app/views/glib/blog/shared/errors.json.jbuilder +5 -0
  133. data/engines/blog/app/views/glib/blog/tags/show.json.jbuilder +3 -0
  134. data/engines/blog/app/views/glib/blog/themes/_nav_links.json.jbuilder +12 -0
  135. data/engines/blog/app/views/glib/blog/themes/clean/_brand.json.jbuilder +11 -0
  136. data/engines/blog/app/views/glib/blog/themes/clean/_card.json.jbuilder +15 -0
  137. data/engines/blog/app/views/glib/blog/themes/clean/_featured.json.jbuilder +23 -0
  138. data/engines/blog/app/views/glib/blog/themes/clean/_footer.json.jbuilder +15 -0
  139. data/engines/blog/app/views/glib/blog/themes/clean/_header.json.jbuilder +9 -0
  140. data/engines/blog/app/views/glib/blog/themes/clean/_post.json.jbuilder +98 -0
  141. data/engines/blog/app/views/glib/blog/themes/clean/_post_list.json.jbuilder +40 -0
  142. data/engines/blog/app/views/glib/blog/themes/clean/_post_rows.json.jbuilder +10 -0
  143. data/engines/blog/app/views/glib/blog/themes/editorial/_footer.json.jbuilder +15 -0
  144. data/engines/blog/app/views/glib/blog/themes/editorial/_header.json.jbuilder +11 -0
  145. data/engines/blog/app/views/glib/blog/themes/editorial/_post.json.jbuilder +62 -0
  146. data/engines/blog/app/views/glib/blog/themes/editorial/_post_list.json.jbuilder +25 -0
  147. data/engines/blog/app/views/glib/blog/themes/editorial/_post_rows.json.jbuilder +18 -0
  148. data/engines/blog/config/locales/en.yml +500 -0
  149. data/engines/blog/config/routes.rb +33 -0
  150. data/engines/blog/db/migrate/20261103090000_create_glib_blog_tables.rb +70 -0
  151. data/engines/blog/db/migrate/20261104090000_create_glib_blog_media_tables.rb +44 -0
  152. data/engines/blog/db/migrate/20261104120000_create_glib_blog_comments.rb +23 -0
  153. data/engines/blog/db/migrate/20261105090000_add_glib_blog_comment_moderation.rb +16 -0
  154. data/engines/blog/db/migrate/20261105100000_add_deleted_at_to_glib_blog_posts.rb +6 -0
  155. data/engines/blog/db/migrate/20261105110000_add_parent_and_default_to_glib_blog_categories.rb +10 -0
  156. data/engines/blog/db/migrate/20261105120000_create_glib_blog_post_views.rb +13 -0
  157. data/engines/blog/db/migrate/20261105130000_create_glib_blog_settings.rb +26 -0
  158. data/engines/blog/db/migrate/20261106090000_add_theme_to_glib_blog_settings.rb +7 -0
  159. data/engines/blog/lib/tasks/glib_blog_tasks.rake +32 -0
  160. data/lib/generators/glib/blog/install_generator.rb +44 -0
  161. data/lib/generators/glib/blog/templates/initializer.rb +22 -0
  162. data/lib/generators/glib/scheduled_jobs_generator.rb +30 -0
  163. data/lib/generators/templates/scheduled_jobs/create_glib_scheduled_job_runs.rb +22 -0
  164. data/lib/glib/blog/engine.rb +20 -0
  165. data/lib/glib/blog/theme.rb +35 -0
  166. data/lib/glib/blog.rb +50 -0
  167. data/lib/glib/engine.rb +17 -0
  168. data/lib/glib/scheduled_jobs/config.rb +36 -0
  169. data/lib/glib/scheduled_jobs/loader.rb +98 -0
  170. data/lib/glib-web.rb +2 -0
  171. metadata +175 -3
@@ -0,0 +1,631 @@
1
+ /* The public blog's editorial theme: warm paper tones, Cormorant Garamond display type and a
2
+ single column of dated entries. Every rule is scoped to `.blog-theme-editorial`, the page
3
+ class set by the theme, so nothing leaks into the host app. Rules sit outside any @layer so
4
+ they win over glib's layered defaults. */
5
+ @import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500&family=Roboto:wght@500&family=Source+Sans+3:wght@300;400;500;600&display=swap');
6
+
7
+ .blog-theme-editorial,
8
+ .blog-theme-editorial .v-theme--light {
9
+ --v-theme-primary: 113, 92, 85;
10
+ --v-theme-on-primary: 255, 255, 255;
11
+ --v-theme-background: 247, 245, 241;
12
+ --v-theme-surface: 255, 255, 255;
13
+ --v-theme-on-surface: 64, 64, 64;
14
+ }
15
+
16
+ .blog-theme-editorial {
17
+ background: #F7F5F1;
18
+ color: #404040;
19
+ font-family: 'Source Sans 3', 'Open Sans', system-ui, sans-serif;
20
+ }
21
+
22
+ .blog-theme-editorial :is(h1, h2, h3, p) {
23
+ margin: 0;
24
+ font-family: inherit;
25
+ letter-spacing: normal;
26
+ }
27
+
28
+ .blog-theme-editorial :is(.v-btn, .v-field, .v-label, input, textarea) {
29
+ font-family: inherit;
30
+ }
31
+
32
+ .blog-theme-editorial .v-btn {
33
+ border-radius: 3px;
34
+ font-weight: 400;
35
+ letter-spacing: 0.06em;
36
+ text-transform: none;
37
+ }
38
+
39
+ .blog-theme-editorial a {
40
+ color: inherit;
41
+ text-decoration: none;
42
+ }
43
+
44
+ .blog-theme-editorial .blog-container {
45
+ width: 100%;
46
+ max-width: 1200px;
47
+ margin: 0 auto;
48
+ padding-right: 24px;
49
+ padding-left: 24px;
50
+ box-sizing: border-box;
51
+ }
52
+
53
+ /* glib's vertical panels keep their children at their own width; these sections fill theirs. */
54
+ .blog-theme-editorial :is(.blog-entry__text, .blog-comments) {
55
+ align-items: stretch;
56
+ }
57
+
58
+ /* Header and footer */
59
+
60
+ .blog-theme-editorial .blog-header {
61
+ border-bottom: 1px solid #ECE7E0;
62
+ background: #FFFFFF;
63
+ }
64
+
65
+ /* On the blog's home the header sits on the hero. */
66
+ .blog-theme-editorial:has(.blog-hero:not(.blog-hero--compact)) .blog-header {
67
+ border-bottom: 0;
68
+ background: #D9CFC2;
69
+ }
70
+
71
+ .blog-theme-editorial .blog-header__inner {
72
+ flex-direction: row;
73
+ flex-wrap: wrap;
74
+ align-items: center;
75
+ justify-content: space-between;
76
+ gap: 16px;
77
+ padding-top: 16px;
78
+ padding-bottom: 16px;
79
+ }
80
+
81
+ .blog-theme-editorial .blog-brand {
82
+ display: inline-flex;
83
+ align-items: center;
84
+ min-height: 44px;
85
+ color: #4A3B36;
86
+ font-family: 'Cormorant Garamond', Georgia, serif;
87
+ font-size: 28px;
88
+ font-weight: 500;
89
+ letter-spacing: 0.02em;
90
+ }
91
+
92
+ .blog-theme-editorial .blog-nav,
93
+ .blog-theme-editorial .blog-footer__nav {
94
+ flex-direction: row;
95
+ flex-wrap: wrap;
96
+ align-items: center;
97
+ gap: 4px 8px;
98
+ }
99
+
100
+ .blog-theme-editorial .blog-nav__link {
101
+ display: inline-flex;
102
+ align-items: center;
103
+ min-height: 44px;
104
+ padding: 0 12px;
105
+ color: #404040;
106
+ font-size: 16px;
107
+ letter-spacing: 0.04em;
108
+ }
109
+
110
+ .blog-theme-editorial .blog-nav__link:hover,
111
+ .blog-theme-editorial .blog-nav__link--active {
112
+ color: #4F5A30;
113
+ }
114
+
115
+ .blog-theme-editorial .blog-nav__link--active {
116
+ font-weight: 500;
117
+ }
118
+
119
+ .blog-theme-editorial .blog-footer {
120
+ background: #715C55;
121
+ color: #FFFFFF;
122
+ }
123
+
124
+ .blog-theme-editorial .blog-footer__inner {
125
+ flex-direction: row;
126
+ flex-wrap: wrap;
127
+ justify-content: space-between;
128
+ gap: 32px;
129
+ padding-top: 56px;
130
+ padding-bottom: 40px;
131
+ }
132
+
133
+ .blog-theme-editorial .blog-footer__about {
134
+ flex: 1 1 320px;
135
+ max-width: 440px;
136
+ gap: 12px;
137
+ }
138
+
139
+ .blog-theme-editorial .blog-footer__title {
140
+ font-family: 'Cormorant Garamond', Georgia, serif;
141
+ font-size: 30px;
142
+ font-weight: 500;
143
+ letter-spacing: 0.02em;
144
+ }
145
+
146
+ .blog-theme-editorial .blog-footer__about p {
147
+ color: #F1ECE8;
148
+ font-size: 15px;
149
+ line-height: 1.7;
150
+ }
151
+
152
+ .blog-theme-editorial .blog-footer__link {
153
+ display: inline-flex;
154
+ align-items: center;
155
+ min-height: 44px;
156
+ padding: 0 8px;
157
+ color: #F1ECE8;
158
+ font-size: 15px;
159
+ letter-spacing: 0.04em;
160
+ }
161
+
162
+ .blog-theme-editorial .blog-footer__link:hover {
163
+ color: #FFFFFF;
164
+ text-decoration: underline;
165
+ }
166
+
167
+ .blog-theme-editorial .blog-footer__copyright {
168
+ flex: 1 1 100%;
169
+ padding-top: 20px;
170
+ border-top: 1px solid #8C7A73;
171
+ color: #F1ECE8;
172
+ font-size: 13px;
173
+ letter-spacing: 0.04em;
174
+ }
175
+
176
+ /* Hero */
177
+
178
+ .blog-theme-editorial .blog-hero {
179
+ align-items: center;
180
+ justify-content: center;
181
+ gap: 16px;
182
+ min-height: 460px;
183
+ padding: 40px 24px 96px;
184
+ background: #D9CFC2;
185
+ text-align: center;
186
+ }
187
+
188
+ .blog-theme-editorial .blog-hero h1 {
189
+ color: #4A3B36;
190
+ font-family: 'Cormorant Garamond', Georgia, serif;
191
+ font-size: 88px;
192
+ font-weight: 400;
193
+ line-height: 1;
194
+ letter-spacing: 0.04em;
195
+ }
196
+
197
+ .blog-theme-editorial .blog-hero__rule {
198
+ width: 1px;
199
+ height: 48px;
200
+ background: #715C55;
201
+ }
202
+
203
+ .blog-theme-editorial .blog-hero p {
204
+ max-width: 640px;
205
+ color: #4A3F3A;
206
+ font-size: 17px;
207
+ letter-spacing: 0.12em;
208
+ }
209
+
210
+ .blog-theme-editorial .blog-hero--compact {
211
+ min-height: 0;
212
+ padding: 72px 24px;
213
+ background: #EFEBE4;
214
+ }
215
+
216
+ .blog-theme-editorial .blog-hero--compact h1 {
217
+ font-size: 56px;
218
+ }
219
+
220
+ .blog-theme-editorial .blog-kicker {
221
+ color: #565656;
222
+ font-size: 13px;
223
+ letter-spacing: 0.12em;
224
+ text-transform: uppercase;
225
+ }
226
+
227
+ /* Entries */
228
+
229
+ .blog-theme-editorial .blog-main {
230
+ flex-direction: row;
231
+ flex-wrap: wrap;
232
+ align-items: flex-start;
233
+ gap: 48px;
234
+ padding-top: 96px;
235
+ padding-bottom: 120px;
236
+ }
237
+
238
+ .blog-theme-editorial .blog-margin {
239
+ flex: 1 1 160px;
240
+ max-width: 200px;
241
+ align-items: center;
242
+ }
243
+
244
+ .blog-theme-editorial .blog-seal {
245
+ display: flex;
246
+ align-items: center;
247
+ justify-content: center;
248
+ width: 96px;
249
+ height: 96px;
250
+ border-radius: 999px;
251
+ background: #715C55;
252
+ color: #FFFFFF;
253
+ font-family: 'Cormorant Garamond', Georgia, serif;
254
+ font-size: 22px;
255
+ letter-spacing: 0.04em;
256
+ }
257
+
258
+ .blog-theme-editorial .blog-seal__caption {
259
+ padding-top: 10px;
260
+ color: #4A3B36;
261
+ font-family: 'Cormorant Garamond', Georgia, serif;
262
+ font-size: 22px;
263
+ letter-spacing: 0.04em;
264
+ }
265
+
266
+ .blog-theme-editorial .blog-entries,
267
+ .blog-theme-editorial .blog-entry__body,
268
+ .blog-theme-editorial .blog-main > .blog-empty {
269
+ flex: 999 1 640px;
270
+ min-width: 0;
271
+ }
272
+
273
+ .blog-theme-editorial .blog-entries {
274
+ background: transparent;
275
+ }
276
+
277
+ .blog-theme-editorial .blog-entries div:has(> a.thumbnail) {
278
+ display: flex;
279
+ flex-direction: column;
280
+ gap: 112px;
281
+ }
282
+
283
+ /* Entries carry everything in their header; the row's own title area stays empty.
284
+ `!important` beats the row's inline `display: flex`. */
285
+ .blog-theme-editorial a.thumbnail.blog-entry > div:has(> .item-content) {
286
+ display: none !important;
287
+ }
288
+
289
+ .blog-theme-editorial a.thumbnail.blog-entry .v-row,
290
+ .blog-theme-editorial .blog-entry__body {
291
+ flex-direction: row;
292
+ flex-wrap: wrap;
293
+ gap: 16px 48px;
294
+ }
295
+
296
+ .blog-theme-editorial a.thumbnail.blog-entry .v-row > .full-width:first-child {
297
+ flex: 0 0 120px;
298
+ width: auto;
299
+ }
300
+
301
+ .blog-theme-editorial a.thumbnail.blog-entry .v-row > .full-width:last-child,
302
+ .blog-theme-editorial .blog-entry__body > .blog-entry__text {
303
+ flex: 1 1 480px;
304
+ min-width: 0;
305
+ width: auto;
306
+ }
307
+
308
+ .blog-theme-editorial .blog-entry__body > .blog-date {
309
+ flex: 0 0 120px;
310
+ }
311
+
312
+ .blog-theme-editorial .blog-date {
313
+ padding-top: 4px;
314
+ color: #565656;
315
+ font-family: 'Roboto', system-ui, sans-serif;
316
+ font-size: 18px;
317
+ font-weight: 500;
318
+ }
319
+
320
+ .blog-theme-editorial .blog-entry__text {
321
+ width: 100%;
322
+ gap: 20px;
323
+ }
324
+
325
+ .blog-theme-editorial .blog-cover {
326
+ display: block;
327
+ width: 100% !important;
328
+ height: auto !important;
329
+ aspect-ratio: 5 / 3;
330
+ background: #E4DCD1;
331
+ /* Overrides the image view's inline `contain`, which letterboxes a cropped cover. */
332
+ object-fit: cover !important;
333
+ }
334
+
335
+ .blog-theme-editorial .blog-entry__title {
336
+ margin-top: 4px;
337
+ color: #404040;
338
+ font-size: 28px;
339
+ font-weight: 500;
340
+ line-height: 1.35;
341
+ }
342
+
343
+ .blog-theme-editorial .blog-entry:hover .blog-entry__title {
344
+ color: #715C55;
345
+ }
346
+
347
+ .blog-theme-editorial .blog-entry__excerpt {
348
+ font-size: 16px;
349
+ line-height: 1.75;
350
+ }
351
+
352
+ .blog-theme-editorial .blog-entry__more {
353
+ align-self: flex-end;
354
+ display: inline-flex;
355
+ align-items: center;
356
+ min-height: 44px;
357
+ font-size: 16px;
358
+ letter-spacing: 0.04em;
359
+ }
360
+
361
+ .blog-theme-editorial .blog-empty {
362
+ color: #565656;
363
+ font-size: 16px;
364
+ }
365
+
366
+ /* Article */
367
+
368
+ .blog-theme-editorial .blog-main:has(.blog-article) {
369
+ padding-top: 72px;
370
+ }
371
+
372
+ .blog-theme-editorial .blog-article {
373
+ gap: 24px;
374
+ }
375
+
376
+ .blog-theme-editorial .blog-figure__caption {
377
+ margin-top: -12px;
378
+ color: #565656;
379
+ font-size: 14px;
380
+ letter-spacing: 0.02em;
381
+ }
382
+
383
+ .blog-theme-editorial .blog-article__title {
384
+ margin-top: 8px;
385
+ color: #404040;
386
+ font-size: 34px;
387
+ font-weight: 500;
388
+ line-height: 1.35;
389
+ }
390
+
391
+ .blog-theme-editorial .blog-article__byline {
392
+ color: #565656;
393
+ font-size: 14px;
394
+ letter-spacing: 0.06em;
395
+ }
396
+
397
+ .blog-theme-editorial .blog-article__byline:hover {
398
+ color: #715C55;
399
+ }
400
+
401
+ .blog-theme-editorial .blog-body .trix-content {
402
+ max-width: 640px;
403
+ color: #404040;
404
+ font-size: 17px;
405
+ line-height: 1.8;
406
+ }
407
+
408
+ .blog-theme-editorial .blog-body .trix-content > * + * {
409
+ margin-top: 20px;
410
+ }
411
+
412
+ .blog-theme-editorial .blog-body .trix-content h1 {
413
+ margin-top: 44px;
414
+ font-size: 24px;
415
+ font-weight: 600;
416
+ line-height: 1.4;
417
+ }
418
+
419
+ .blog-theme-editorial .blog-body .trix-content :is(ul, ol) {
420
+ padding-left: 22px;
421
+ }
422
+
423
+ .blog-theme-editorial .blog-body .trix-content a {
424
+ color: #715C55;
425
+ text-decoration: underline;
426
+ }
427
+
428
+ .blog-theme-editorial .blog-body .trix-content blockquote {
429
+ margin: 16px 0 0;
430
+ padding: 8px 0;
431
+ border-top: 1px solid #D5CCC2;
432
+ border-bottom: 1px solid #D5CCC2;
433
+ border-left: 0;
434
+ color: #4A3B36;
435
+ font-family: 'Cormorant Garamond', Georgia, serif;
436
+ font-size: 28px;
437
+ line-height: 1.5;
438
+ text-align: center;
439
+ }
440
+
441
+ .blog-theme-editorial .blog-body .trix-content pre {
442
+ padding: 20px 24px;
443
+ overflow-x: auto;
444
+ background: #EFEBE4;
445
+ color: #404040;
446
+ font-size: 14px;
447
+ line-height: 1.7;
448
+ }
449
+
450
+ .blog-theme-editorial .blog-body .trix-content figure {
451
+ margin: 0;
452
+ }
453
+
454
+ .blog-theme-editorial .blog-body .trix-content figure img {
455
+ max-width: 100%;
456
+ height: auto;
457
+ }
458
+
459
+ .blog-theme-editorial .blog-body .trix-content figcaption {
460
+ margin-top: 10px;
461
+ color: #565656;
462
+ font-size: 14px;
463
+ text-align: left;
464
+ }
465
+
466
+ .blog-theme-editorial .blog-tags {
467
+ flex-direction: row;
468
+ flex-wrap: wrap;
469
+ gap: 8px 20px;
470
+ }
471
+
472
+ .blog-theme-editorial .blog-tag {
473
+ display: inline-flex;
474
+ align-items: center;
475
+ min-height: 44px;
476
+ color: #565656;
477
+ font-size: 14px;
478
+ letter-spacing: 0.12em;
479
+ text-transform: uppercase;
480
+ }
481
+
482
+ .blog-theme-editorial .blog-tag:hover {
483
+ color: #715C55;
484
+ }
485
+
486
+ .blog-theme-editorial .blog-share {
487
+ flex-direction: row;
488
+ flex-wrap: wrap;
489
+ align-items: center;
490
+ gap: 12px;
491
+ margin-top: 8px;
492
+ padding: 24px 0;
493
+ border-top: 1px solid #D5CCC2;
494
+ }
495
+
496
+ .blog-theme-editorial .blog-share__label {
497
+ color: #565656;
498
+ font-size: 14px;
499
+ letter-spacing: 0.04em;
500
+ }
501
+
502
+ .blog-theme-editorial .blog-button.v-btn {
503
+ height: 44px;
504
+ border-color: #B9AEA5;
505
+ color: #404040;
506
+ }
507
+
508
+ /* Comments, drawn by the shared comment views */
509
+
510
+ .blog-theme-editorial .blog-comments {
511
+ max-width: 640px;
512
+ }
513
+
514
+ .blog-theme-editorial .blog-comments h2,
515
+ .blog-theme-editorial .blog-comments h3 {
516
+ color: #4A3B36;
517
+ font-family: 'Cormorant Garamond', Georgia, serif;
518
+ font-weight: 500;
519
+ }
520
+
521
+ .blog-theme-editorial .blog-comments h2 {
522
+ font-size: 32px;
523
+ }
524
+
525
+ .blog-theme-editorial .blog-comments h3 {
526
+ margin-bottom: 12px;
527
+ font-size: 24px;
528
+ }
529
+
530
+ .blog-theme-editorial .blog-comments .bold {
531
+ font-weight: 600;
532
+ }
533
+
534
+ .blog-theme-editorial .blog-comments .caption {
535
+ color: #565656;
536
+ font-size: 14px;
537
+ }
538
+
539
+ .blog-theme-editorial .blog-comments p {
540
+ font-size: 16px;
541
+ line-height: 1.7;
542
+ }
543
+
544
+ .blog-theme-editorial .blog-comments .v-field {
545
+ border-radius: 3px;
546
+ background: #FFFFFF;
547
+ }
548
+
549
+ /* glib's fields carry no margin of their own. */
550
+ .blog-theme-editorial .blog-comments .full-width:has(> .fields-text, > .fields-email, > .fields-textarea) {
551
+ margin-bottom: 12px;
552
+ }
553
+
554
+ .blog-theme-editorial .blog-comments .fields-submit.v-btn {
555
+ height: 48px;
556
+ padding: 0 28px;
557
+ background: #715C55;
558
+ box-shadow: none;
559
+ color: #FFFFFF;
560
+ letter-spacing: 0.08em;
561
+ }
562
+
563
+ .blog-theme-editorial .blog-pager {
564
+ flex-direction: row;
565
+ flex-wrap: wrap;
566
+ align-items: center;
567
+ justify-content: space-between;
568
+ gap: 24px;
569
+ padding-top: 8px;
570
+ }
571
+
572
+ .blog-theme-editorial .blog-pager__previous {
573
+ flex: 1 1 240px;
574
+ gap: 6px;
575
+ padding: 16px 0;
576
+ }
577
+
578
+ .blog-theme-editorial .blog-pager__label {
579
+ color: #565656;
580
+ font-size: 14px;
581
+ letter-spacing: 0.06em;
582
+ }
583
+
584
+ .blog-theme-editorial .blog-pager__title {
585
+ font-size: 18px;
586
+ line-height: 1.45;
587
+ }
588
+
589
+ .blog-theme-editorial .blog-pager__previous:hover .blog-pager__title {
590
+ color: #715C55;
591
+ }
592
+
593
+ .blog-theme-editorial .blog-pager__all {
594
+ display: inline-flex;
595
+ align-items: center;
596
+ min-height: 48px;
597
+ margin-left: auto;
598
+ padding: 0 28px;
599
+ border: 1px solid #715C55;
600
+ border-radius: 3px;
601
+ color: #715C55;
602
+ font-size: 15px;
603
+ letter-spacing: 0.08em;
604
+ }
605
+
606
+ .blog-theme-editorial .blog-pager__all:hover {
607
+ background: #715C55;
608
+ color: #FFFFFF;
609
+ }
610
+
611
+ @media (max-width: 600px) {
612
+ .blog-theme-editorial .blog-hero {
613
+ min-height: 320px;
614
+ }
615
+
616
+ .blog-theme-editorial .blog-hero h1 {
617
+ font-size: 56px;
618
+ }
619
+
620
+ .blog-theme-editorial .blog-main {
621
+ padding-top: 56px;
622
+ }
623
+
624
+ .blog-theme-editorial .blog-margin {
625
+ display: none;
626
+ }
627
+
628
+ .blog-theme-editorial .blog-entries div:has(> a.thumbnail) {
629
+ gap: 64px;
630
+ }
631
+ }
@@ -0,0 +1,27 @@
1
+ module Glib
2
+ module Blog
3
+ module Admin
4
+ # Filters and pages through the media library, shared by the library grid and the pickers.
5
+ module MediaListing
6
+ PER_PAGE = 40
7
+
8
+ private
9
+ def filtered_media(scope)
10
+ scope = scope.search(params[:q]) if params[:q].present?
11
+ scope = scope.where(kind: params[:kind]) if MediaItem.kinds.key?(params[:kind].to_s)
12
+ scope = scope.uploaded_in(Date.strptime(params[:month], '%Y-%m')) if params[:month].to_s.match?(/\A\d{4}-\d{2}\z/)
13
+ scope = scope.unused if params[:unused] == 'true'
14
+ scope.newest_first.with_attached_file
15
+ end
16
+
17
+ def paginate_media(scope)
18
+ paginate(scope, per_page: PER_PAGE)
19
+ end
20
+
21
+ def media_upload_months
22
+ MediaItem.kept.pluck(:created_at).map { |time| time.to_date.beginning_of_month }.uniq.sort.reverse
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,14 @@
1
+ module Glib
2
+ module Blog
3
+ # Offset paging for lists that load the next page as they scroll (`nextPage` autoload).
4
+ module Pagination
5
+ private
6
+ # Returns the page's records and the next page number, or nil on the last page.
7
+ def paginate(scope, per_page:)
8
+ page = params[:page].to_i
9
+ records = scope.offset(page * per_page).limit(per_page + 1).to_a
10
+ [records.first(per_page), records.size > per_page ? page + 1 : nil]
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,28 @@
1
+ module Glib
2
+ module Blog
3
+ module Admin
4
+ class ApplicationController < Glib::Blog::ApplicationController
5
+ FONTS_URL = 'https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500' \
6
+ '&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Serif:ital,wght@0,400;0,600;1,400&display=swap'
7
+ STYLESHEET = Engine.root.join('app/assets/stylesheets/glib/blog/admin.css').read.freeze
8
+
9
+ helper_method :admin_stylesheet_html
10
+
11
+ private
12
+ # Sent in each page's body rather than the HTML head: the head is only rendered on a
13
+ # full page load, so styles placed there would be missing after in-app navigation.
14
+ def admin_stylesheet_html
15
+ %(<link rel="stylesheet" href="#{FONTS_URL}"><style>#{STYLESHEET}</style>)
16
+ end
17
+
18
+ def save_and_redirect(record, url)
19
+ if record.save
20
+ glib_redirect_to url
21
+ else
22
+ render_errors(record.errors.full_messages)
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end