alchemy_cms 5.0.1 → 5.1.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 (118) hide show
  1. checksums.yaml +4 -4
  2. data/.github/PULL_REQUEST_TEMPLATE.md +1 -1
  3. data/.github/workflows/ci.yml +126 -0
  4. data/.github/workflows/stale.yml +1 -1
  5. data/.gitignore +1 -0
  6. data/CHANGELOG.md +66 -2
  7. data/CONTRIBUTING.md +2 -2
  8. data/Gemfile +2 -2
  9. data/README.md +2 -2
  10. data/alchemy_cms.gemspec +3 -3
  11. data/app/assets/images/alchemy/missing-image.svg +1 -0
  12. data/app/assets/javascripts/alchemy/admin.js +0 -1
  13. data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +1 -4
  14. data/app/assets/javascripts/alchemy/alchemy.preview.js.coffee +0 -3
  15. data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +29 -4
  16. data/app/assets/stylesheets/alchemy/_variables.scss +8 -0
  17. data/app/assets/stylesheets/alchemy/admin.scss +0 -1
  18. data/app/assets/stylesheets/alchemy/archive.scss +23 -17
  19. data/app/assets/stylesheets/alchemy/buttons.scss +26 -15
  20. data/app/assets/stylesheets/alchemy/elements.scss +58 -19
  21. data/app/assets/stylesheets/alchemy/errors.scss +1 -1
  22. data/app/assets/stylesheets/alchemy/frame.scss +0 -1
  23. data/app/assets/stylesheets/alchemy/hints.scss +2 -1
  24. data/app/assets/stylesheets/alchemy/navigation.scss +7 -10
  25. data/app/assets/stylesheets/alchemy/pagination.scss +1 -1
  26. data/app/assets/stylesheets/alchemy/search.scss +13 -3
  27. data/app/assets/stylesheets/alchemy/selects.scss +26 -20
  28. data/app/assets/stylesheets/alchemy/tables.scss +38 -9
  29. data/app/assets/stylesheets/alchemy/tags.scss +19 -31
  30. data/app/controllers/alchemy/admin/pages_controller.rb +58 -8
  31. data/app/controllers/alchemy/admin/pictures_controller.rb +13 -6
  32. data/app/controllers/alchemy/admin/resources_controller.rb +3 -3
  33. data/app/controllers/alchemy/pages_controller.rb +49 -14
  34. data/app/decorators/alchemy/element_editor.rb +1 -0
  35. data/app/helpers/alchemy/admin/base_helper.rb +0 -44
  36. data/app/helpers/alchemy/admin/navigation_helper.rb +2 -1
  37. data/app/models/alchemy/attachment.rb +20 -3
  38. data/app/models/alchemy/attachment/url.rb +40 -0
  39. data/app/models/alchemy/essence_picture.rb +3 -3
  40. data/app/models/alchemy/essence_picture_view.rb +5 -3
  41. data/app/models/alchemy/legacy_page_url.rb +1 -1
  42. data/app/models/alchemy/page.rb +24 -1
  43. data/app/models/alchemy/page/page_natures.rb +2 -0
  44. data/app/models/alchemy/page/url_path.rb +8 -6
  45. data/app/models/alchemy/picture.rb +58 -2
  46. data/app/models/alchemy/picture/calculations.rb +55 -0
  47. data/app/models/alchemy/picture/transformations.rb +5 -49
  48. data/app/models/alchemy/picture/url.rb +28 -77
  49. data/app/models/alchemy/picture_thumb.rb +57 -0
  50. data/app/models/alchemy/picture_thumb/create.rb +39 -0
  51. data/app/models/alchemy/picture_thumb/signature.rb +23 -0
  52. data/app/models/alchemy/picture_thumb/uid.rb +22 -0
  53. data/app/models/alchemy/picture_variant.rb +114 -0
  54. data/app/models/alchemy/site/layout.rb +30 -2
  55. data/app/serializers/alchemy/page_tree_serializer.rb +4 -4
  56. data/app/views/alchemy/admin/attachments/show.html.erb +8 -8
  57. data/app/views/alchemy/admin/dashboard/index.html.erb +13 -16
  58. data/app/views/alchemy/admin/elements/_element_footer.html.erb +1 -1
  59. data/app/views/alchemy/admin/elements/publish.js.erb +1 -0
  60. data/app/views/alchemy/admin/essence_pictures/crop.html.erb +1 -1
  61. data/app/views/alchemy/admin/essence_pictures/edit.html.erb +2 -2
  62. data/app/views/alchemy/admin/layoutpages/edit.html.erb +4 -6
  63. data/app/views/alchemy/admin/pages/_create_language_form.html.erb +19 -29
  64. data/app/views/alchemy/admin/pages/_form.html.erb +4 -6
  65. data/app/views/alchemy/admin/pages/_new_page_form.html.erb +12 -2
  66. data/app/views/alchemy/admin/pages/_page_layout_filter.html.erb +29 -0
  67. data/app/views/alchemy/admin/pages/_table.html.erb +27 -0
  68. data/app/views/alchemy/admin/pages/_table_row.html.erb +107 -0
  69. data/app/views/alchemy/admin/pages/_toolbar.html.erb +77 -0
  70. data/app/views/alchemy/admin/pages/edit.html.erb +9 -1
  71. data/app/views/alchemy/admin/pages/index.html.erb +41 -74
  72. data/app/views/alchemy/admin/pages/list/_table.html.erb +31 -0
  73. data/app/views/alchemy/admin/pages/unlock.js.erb +2 -2
  74. data/app/views/alchemy/admin/pages/update.js.erb +19 -10
  75. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +14 -13
  76. data/app/views/alchemy/admin/partials/_search_form.html.erb +8 -8
  77. data/app/views/alchemy/admin/pictures/_archive.html.erb +1 -1
  78. data/app/views/alchemy/admin/pictures/_form.html.erb +1 -1
  79. data/app/views/alchemy/admin/pictures/_picture.html.erb +3 -3
  80. data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -1
  81. data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +1 -1
  82. data/app/views/alchemy/admin/pictures/index.html.erb +1 -1
  83. data/app/views/alchemy/admin/pictures/show.html.erb +3 -3
  84. data/app/views/alchemy/admin/resources/_filter_bar.html.erb +13 -11
  85. data/app/views/alchemy/admin/resources/_per_page_select.html.erb +3 -3
  86. data/app/views/alchemy/admin/resources/index.html.erb +4 -1
  87. data/app/views/alchemy/admin/tags/index.html.erb +14 -15
  88. data/app/views/alchemy/base/500.html.erb +11 -13
  89. data/app/views/alchemy/essences/_essence_file_view.html.erb +3 -3
  90. data/config/alchemy/config.yml +15 -11
  91. data/config/alchemy/modules.yml +12 -12
  92. data/config/locales/alchemy.en.yml +6 -4
  93. data/config/routes.rb +1 -1
  94. data/db/migrate/20200617110713_create_alchemy_picture_thumbs.rb +22 -0
  95. data/db/migrate/20200907111332_remove_tri_state_booleans.rb +33 -0
  96. data/lib/alchemy.rb +66 -0
  97. data/lib/alchemy/admin/preview_url.rb +2 -0
  98. data/lib/alchemy/auth_accessors.rb +12 -5
  99. data/lib/alchemy/config.rb +1 -3
  100. data/lib/alchemy/engine.rb +7 -6
  101. data/lib/alchemy/modules.rb +11 -1
  102. data/lib/alchemy/permissions.rb +1 -0
  103. data/lib/alchemy/test_support/factories/picture_factory.rb +0 -1
  104. data/lib/alchemy/test_support/factories/picture_thumb_factory.rb +12 -0
  105. data/lib/alchemy/test_support/integration_helpers.rb +0 -7
  106. data/lib/alchemy/version.rb +1 -1
  107. data/lib/alchemy_cms.rb +2 -4
  108. data/lib/generators/alchemy/install/files/alchemy.en.yml +2 -2
  109. data/lib/generators/alchemy/install/templates/dragonfly.rb.tt +5 -5
  110. data/lib/tasks/alchemy/thumbnails.rake +37 -0
  111. data/vendor/assets/javascripts/jquery_plugins/select2.js +3729 -0
  112. data/vendor/assets/stylesheets/alchemy_admin/select2.scss +740 -0
  113. metadata +46 -37
  114. data/.github/workflows/greetings.yml +0 -13
  115. data/.travis.yml +0 -48
  116. data/app/controllers/concerns/alchemy/locale_redirects.rb +0 -40
  117. data/app/controllers/concerns/alchemy/page_redirects.rb +0 -68
  118. data/lib/alchemy/userstamp.rb +0 -12
@@ -1,6 +1,5 @@
1
1
  /* Alchemy CMS Sprockets Manifest
2
2
  * -------------------------------
3
- *= require select2
4
3
  *= require_self
5
4
  */
6
5
 
@@ -1,5 +1,5 @@
1
1
  .resources-header {
2
- padding: 2*$default-padding;
2
+ padding: 2 * $default-padding;
3
3
  }
4
4
 
5
5
  .resources-table-wrapper {
@@ -16,12 +16,11 @@ div#image_assign_filter_and_image_sizing {
16
16
  }
17
17
 
18
18
  #picture_archive {
19
-
20
19
  .selected_item_tools {
21
- margin: -2*$default-padding;
20
+ margin: -2 * $default-padding;
22
21
  border-bottom: 1px solid $default-border-color;
23
- margin-bottom: 4*$default-padding;
24
- padding: 4*$default-padding;
22
+ margin-bottom: 4 * $default-padding;
23
+ padding: 4 * $default-padding;
25
24
  display: none;
26
25
  }
27
26
  }
@@ -37,7 +36,7 @@ div#image_assign_filter_and_image_sizing {
37
36
  }
38
37
 
39
38
  .picture_thumbnail {
40
- margin: 2*$default-margin;
39
+ margin: 2 * $default-margin;
41
40
  background-color: #fff;
42
41
  position: relative;
43
42
  box-shadow: 0 0 0 1px $default-border-color;
@@ -80,8 +79,8 @@ div#image_assign_filter_and_image_sizing {
80
79
  }
81
80
 
82
81
  &:hover {
83
-
84
- .picture_tool, .picture_tags {
82
+ .picture_tool,
83
+ .picture_tags {
85
84
  visibility: visible;
86
85
  opacity: 1;
87
86
  }
@@ -95,7 +94,6 @@ div#image_assign_filter_and_image_sizing {
95
94
  }
96
95
 
97
96
  #pictures {
98
-
99
97
  .thumbnail_background {
100
98
  @include zoom-in;
101
99
  }
@@ -165,25 +163,34 @@ div.assign_image_list_image {
165
163
  pointer-events: none;
166
164
  }
167
165
 
168
- .picture_tags, .picture_tool {
166
+ .picture_tags,
167
+ .picture_tool {
169
168
  visibility: hidden;
170
169
  opacity: 0;
171
170
  transition: opacity $transition-duration;
172
171
  }
173
172
 
174
173
  div#library_sidebar {
174
+ display: flex;
175
+ flex-direction: column;
175
176
  position: fixed;
176
177
  border-left: 1px solid $default-border-color;
177
178
  top: 0;
178
179
  right: 0;
179
180
  width: 232px;
180
- padding: 86px 4*$default-padding 0 4*$default-padding;
181
+
182
+ padding: $top-menu-height + 2 * $default-padding 4 * $default-padding
183
+ $pagination-height + 2 * $default-padding 4 * $default-padding;
181
184
  height: 100%;
182
185
  z-index: 3;
183
186
  background-color: $light-gray;
184
187
 
185
188
  h2 {
186
- margin-top: 4*$default-margin;
189
+ margin-top: 4 * $default-margin;
190
+ }
191
+
192
+ h3 {
193
+ margin: 2em 0 1em;
187
194
  }
188
195
  }
189
196
 
@@ -192,20 +199,19 @@ div#library_sidebar {
192
199
  }
193
200
 
194
201
  div#filter_bar {
195
-
196
202
  .selectboxit {
197
203
  width: 194px;
198
204
  }
199
205
  }
200
206
 
201
207
  .alchemy-dialog-body {
202
-
203
208
  #library_sidebar {
204
- padding: 0 4*$default-padding;
209
+ padding: 0 4 * $default-padding;
205
210
  }
206
211
  }
207
212
 
208
- #assign_image_list, #assign_file_list {
213
+ #assign_image_list,
214
+ #assign_file_list {
209
215
  position: relative;
210
216
  height: 548px;
211
217
  }
@@ -234,7 +240,7 @@ div#filter_bar {
234
240
  display: block;
235
241
  line-height: 25px;
236
242
  text-decoration: none;
237
- padding: $default-padding 2*$default-padding;
243
+ padding: $default-padding 2 * $default-padding;
238
244
  }
239
245
 
240
246
  .icon {
@@ -1,4 +1,7 @@
1
- button, input[type="submit"], a.button, input.button {
1
+ button,
2
+ input[type="submit"],
3
+ a.button,
4
+ input.button {
2
5
  @include button-defaults;
3
6
  position: relative;
4
7
 
@@ -14,7 +17,8 @@ button, input[type="submit"], a.button, input.button {
14
17
  );
15
18
  }
16
19
 
17
- &:active, &:active:focus {
20
+ &:active,
21
+ &:active:focus {
18
22
  border-color: $button-hover-border-color;
19
23
  box-shadow: none;
20
24
  }
@@ -23,7 +27,7 @@ button, input[type="submit"], a.button, input.button {
23
27
  &.small {
24
28
  padding: $small-button-padding;
25
29
  vertical-align: inherit;
26
- line-height: 4*$default-padding;
30
+ line-height: 4 * $default-padding;
27
31
  font-size: inherit;
28
32
  }
29
33
 
@@ -83,13 +87,14 @@ button, input[type="submit"], a.button, input.button {
83
87
  border: $default-border-width $default-border-style $icon-color;
84
88
  color: $icon-color;
85
89
 
86
- .icon { color: inherit }
90
+ .icon {
91
+ color: inherit;
92
+ }
87
93
  }
88
94
  }
89
95
 
90
96
  &.disabled,
91
97
  &[disabled] {
92
-
93
98
  span {
94
99
  opacity: 0.3;
95
100
  cursor: not-allowed;
@@ -118,7 +123,8 @@ button.icon_button {
118
123
  border: 0 none;
119
124
  box-shadow: none;
120
125
 
121
- &:disabled, &.disabled {
126
+ &:disabled,
127
+ &.disabled {
122
128
  background: transparent;
123
129
  }
124
130
  }
@@ -131,10 +137,15 @@ button.icon_button {
131
137
  position: relative;
132
138
  display: inline-block;
133
139
  text-align: center;
134
- margin: 0 2*$default-margin;
135
140
 
136
- &.active, &:active, &:hover {
137
- .icon_button:not([disabled]) {
141
+ .toolbar_buttons & {
142
+ margin: 0 2 * $default-margin;
143
+ }
144
+
145
+ &.active,
146
+ &:active,
147
+ &:hover {
148
+ .icon_button:not([disabled]) {
138
149
  background-color: $default-border-color;
139
150
  cursor: pointer;
140
151
  }
@@ -161,8 +172,8 @@ button.icon_button {
161
172
  }
162
173
  }
163
174
 
164
- .button_with_label, .button_group {
165
-
175
+ .button_with_label,
176
+ .button_group {
166
177
  .icon_button {
167
178
  width: 29px;
168
179
  height: 29px;
@@ -179,16 +190,16 @@ button.icon_button {
179
190
  z-index: 30;
180
191
  background-color: $tooltip-background-color;
181
192
  color: $white;
182
- padding: $default-padding 2*$default-padding 1.5*$default-padding;
193
+ padding: $default-padding 2 * $default-padding 1.5 * $default-padding;
183
194
  line-height: 1;
184
195
  box-shadow: 0 0 4px $default-border-color;
185
196
  white-space: nowrap;
186
197
  pointer-events: none;
187
198
  opacity: 0;
188
- transition: .3s;
199
+ transition: 0.3s;
189
200
 
190
201
  &:before {
191
- content: '';
202
+ content: "";
192
203
  position: absolute;
193
204
  bottom: -10px;
194
205
  left: 8px;
@@ -238,6 +249,6 @@ button.icon_button {
238
249
  visibility: visible;
239
250
  opacity: 1;
240
251
  top: -25px;
241
- transition-delay: .2s;
252
+ transition-delay: 0.2s;
242
253
  }
243
254
  }
@@ -60,6 +60,7 @@
60
60
  max-width: 85%;
61
61
  margin-left: $default-margin;
62
62
  text-overflow: ellipsis;
63
+ transition: color $transition-duration;
63
64
 
64
65
  .has-hint & {
65
66
  max-width: 80%;
@@ -73,7 +74,6 @@
73
74
 
74
75
  .preview_text_element_name {
75
76
  font-size: $small-font-size;
76
- text-shadow: #efefef 1px 1px 1px;
77
77
  font-weight: bold;
78
78
  line-height: 15px;
79
79
  }
@@ -106,6 +106,7 @@
106
106
  height: 16px;
107
107
  right: 8px;
108
108
  top: 10px;
109
+ transition: none;
109
110
 
110
111
  .error_icon {
111
112
  float: left;
@@ -126,6 +127,32 @@
126
127
  margin-bottom: 2*$default-margin;
127
128
  transition: box-shadow $transition-duration;
128
129
 
130
+ &.hidden {
131
+ display: block;
132
+ border-style: dashed;
133
+ opacity: 0.5;
134
+ transition: opacity $transition-duration;
135
+
136
+ > .element-header {
137
+ background-color: transparent;
138
+ background-image: linear-gradient(
139
+ 45deg,
140
+ $light-gray 25%,
141
+ $medium-gray 25%,
142
+ $medium-gray 50%,
143
+ $light-gray 50%,
144
+ $light-gray 75%,
145
+ $medium-gray 75%,
146
+ $medium-gray 100%
147
+ );
148
+ background-size: 28.28px 28.28px;
149
+ }
150
+
151
+ &:hover {
152
+ opacity: 1;
153
+ }
154
+ }
155
+
129
156
  &.is-fixed {
130
157
  border-width: 0;
131
158
  border-radius: 0;
@@ -143,9 +170,17 @@
143
170
  }
144
171
  }
145
172
 
146
- &.selected:not(.is-fixed) {
147
- border-color: #c3c3c3;
148
- box-shadow: 0 2px 8px rgba(#9b9b9b, 0.75);
173
+ &.selected:not(.is-fixed), &:hover {
174
+ &:not(.hidden) {
175
+ box-shadow: 0 2px 8px rgba(#9b9b9b, 0.75);
176
+ }
177
+ }
178
+
179
+ &.selected:not(.is-fixed):not(.folded):not(.dirty):not(.hidden) {
180
+ > .element-header {
181
+ background-color: $element-header-active-bg-color;
182
+ color: $element-header-active-color;
183
+ }
149
184
  }
150
185
 
151
186
  &.folded {
@@ -221,21 +256,10 @@
221
256
  }
222
257
  }
223
258
 
224
- .element_tools {
225
- display: flex;
226
- width: 100%;
227
- justify-content: space-between;
228
- margin-left: 0;
229
- }
230
-
231
259
  .element-content {
232
260
  margin: 4px 8px;
233
261
  }
234
262
 
235
- .button_with_label {
236
- margin: 0 4px;
237
- }
238
-
239
263
  .content_editor,
240
264
  .picture_thumbnail {
241
265
  width: 100%;
@@ -313,7 +337,18 @@
313
337
  background-color: $element-header-bg-color;
314
338
  @extend .disable-user-select;
315
339
  cursor: pointer;
316
- @include border-top-radius($default-border-radius);
340
+ border-radius: $default-border-radius;
341
+ transition: background-color $transition-duration;
342
+
343
+ .expanded & {
344
+ border-bottom-left-radius: 0;
345
+ border-bottom-right-radius: 0;
346
+ }
347
+
348
+ .icon {
349
+ color: inherit;
350
+ transition: color $transition-duration;
351
+ }
317
352
 
318
353
  >.hint-with-icon {
319
354
  position: absolute;
@@ -338,10 +373,14 @@
338
373
  padding: $default-padding 0;
339
374
  height: $element-toolbar-height;
340
375
  border-bottom: 1px solid $medium-gray;
376
+ }
341
377
 
342
- .element_tools {
343
- float: left;
344
- margin-left: -$default-margin;
378
+ .element_tools {
379
+ display: flex;
380
+ width: 100%;
381
+
382
+ .button_with_label {
383
+ margin: 0 2px;
345
384
  }
346
385
  }
347
386
 
@@ -40,7 +40,7 @@ div#errors, div.errors {
40
40
 
41
41
  body.error {
42
42
  .error.message {
43
- max-height: 95%;
43
+ max-height: 100%;
44
44
  overflow-y: scroll;
45
45
  }
46
46
  }
@@ -74,7 +74,6 @@ div#overlay_text_box {
74
74
 
75
75
  .page_name {
76
76
  display: inline-block;
77
- max-width: 100px;
78
77
  margin-right: $default-margin;
79
78
  line-height: $header-height;
80
79
  white-space: nowrap;
@@ -27,7 +27,8 @@
27
27
 
28
28
  > .hint-bubble {
29
29
  visibility: hidden;
30
- background: $light_yellow;
30
+ background-color: $hint-background-color;
31
+ color: $hint-text-color;
31
32
  border-radius: $default-border-radius;
32
33
  box-shadow: 0px 4px 8px rgba(0, 0, 0, .3);
33
34
  position: absolute;
@@ -256,7 +256,7 @@
256
256
  > a {
257
257
  display: flex;
258
258
  cursor: pointer;
259
- padding: 0px 8px;
259
+ padding-left: 2 * $default-padding;
260
260
 
261
261
  &:focus {
262
262
  @include default-focus-style($box-shadow: inset 0 0 0 2px $focus-color);
@@ -273,19 +273,16 @@
273
273
  text-shadow: $text-shadow-light;
274
274
  }
275
275
 
276
- .page_language {
277
- display: inline-block;
278
- color: $muted-text-color;
279
- margin-right: 2px;
280
- font-size: $small-font-size;
281
- text-transform: uppercase;
282
- }
283
-
276
+ .page_language,
284
277
  .page_site {
285
278
  display: inline-block;
286
279
  color: $muted-text-color;
287
- margin-right: $default-margin;
288
280
  font-size: $small-font-size;
281
+ margin-right: $default-margin;
289
282
  line-height: 31px;
290
283
  }
284
+
285
+ .page_language {
286
+ text-transform: uppercase;
287
+ }
291
288
  }
@@ -7,7 +7,7 @@
7
7
  right: 0;
8
8
  width: 100%;
9
9
  left: 0px;
10
- height: 52px;
10
+ height: $pagination-height;
11
11
  padding: 2*$default-padding;
12
12
  padding-left: $main-menu-width + 10px;
13
13
  text-align: left;
@@ -11,9 +11,19 @@
11
11
  top: 9px;
12
12
  }
13
13
 
14
- label {
15
- display: block;
14
+ button {
15
+ position: absolute;
16
+ top: 0;
17
+ left: 0;
18
+ width: 30px;
16
19
  height: inherit;
20
+ appearance: none;
21
+ background-color: transparent;
22
+ border: 0 none;
23
+ border-radius: 0;
24
+ box-shadow: none;
25
+ margin: 0;
26
+ padding: 0;
17
27
  }
18
28
  }
19
29
 
@@ -44,7 +54,7 @@
44
54
 
45
55
  .search_input_field {
46
56
  width: 0;
47
- height: inherit;
57
+ height: 100%;
48
58
  border: none;
49
59
  background-color: transparentize($form-field-background-color, 0.25);
50
60
  transition: