fae-rails 2.2.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/app/assets/config/fae/manifest.js +2 -0
  4. data/app/assets/javascripts/fae/_contrast.js +50 -0
  5. data/app/assets/javascripts/fae/_deploy.js +1 -1
  6. data/app/assets/javascripts/fae/application.js +5 -1
  7. data/app/assets/javascripts/fae/form/_ajax.js +14 -4
  8. data/app/assets/javascripts/fae/form/_form.js +4 -2
  9. data/app/assets/javascripts/fae/form/_validator.js +224 -55
  10. data/app/assets/javascripts/fae/form/drag_drop.js +109 -0
  11. data/app/assets/javascripts/fae/form/inputs/_select.js +7 -4
  12. data/app/assets/javascripts/fae/form/inputs/_text.js +23 -9
  13. data/app/assets/javascripts/fae/vendor/simplemde/codemirror-4.inline-attachment.js +95 -0
  14. data/app/assets/javascripts/fae/vendor/simplemde/inline-attachment.js +405 -0
  15. data/app/assets/stylesheets/fae/application.css +1 -0
  16. data/app/assets/stylesheets/fae/base.scss +2 -1
  17. data/app/assets/stylesheets/fae/globals/_tags.scss +1 -1
  18. data/app/assets/stylesheets/fae/globals/layout/_base.scss +2 -2
  19. data/app/assets/stylesheets/fae/globals/layout/_content-header.scss +6 -2
  20. data/app/assets/stylesheets/fae/globals/legacy/_pre-1.3.scss +1 -1
  21. data/app/assets/stylesheets/fae/globals/navigation/_footer.scss +1 -1
  22. data/app/assets/stylesheets/fae/globals/navigation/_header.scss +2 -2
  23. data/app/assets/stylesheets/fae/globals/navigation/_sidenav.scss +2 -2
  24. data/app/assets/stylesheets/fae/globals/navigation/_utility.scss +1 -1
  25. data/app/assets/stylesheets/fae/modules/_errors-bar.scss +19 -0
  26. data/app/assets/stylesheets/fae/modules/_toggles.scss +1 -1
  27. data/app/assets/stylesheets/fae/modules/forms/_base.scss +13 -0
  28. data/app/assets/stylesheets/fae/modules/forms/_date.scss +4 -4
  29. data/app/assets/stylesheets/fae/modules/forms/_hints.scss +1 -1
  30. data/app/assets/stylesheets/fae/modules/forms/_label.scss +1 -1
  31. data/app/assets/stylesheets/fae/modules/forms/_select.scss +2 -2
  32. data/app/assets/stylesheets/fae/modules/forms/_simple-mde.scss +71 -0
  33. data/app/assets/stylesheets/fae/modules/tables/_base.scss +1 -1
  34. data/app/assets/stylesheets/fae/modules/tables/_pagination.scss +2 -2
  35. data/app/assets/stylesheets/fae/pages/_error.scss +1 -1
  36. data/app/assets/stylesheets/fae/pages/_login.scss +1 -1
  37. data/app/assets/stylesheets/fae/simplemde_override.scss +32 -0
  38. data/app/controllers/fae/application_controller.rb +2 -2
  39. data/app/controllers/fae/base_controller.rb +1 -1
  40. data/app/controllers/fae/deploy_hooks_controller.rb +4 -4
  41. data/app/controllers/fae/setup_controller.rb +2 -2
  42. data/app/helpers/fae/application_helper.rb +10 -1
  43. data/app/helpers/fae/view_helper.rb +4 -0
  44. data/app/models/concerns/fae/base_model_concern.rb +8 -0
  45. data/app/models/concerns/fae/seo_set_concern.rb +1 -0
  46. data/app/models/fae/change.rb +1 -0
  47. data/app/models/fae/option.rb +1 -0
  48. data/app/models/fae/seo_set.rb +14 -0
  49. data/app/services/fae/netlify_api.rb +22 -6
  50. data/app/uploaders/fae/file_uploader.rb +1 -1
  51. data/app/uploaders/fae/image_uploader.rb +2 -2
  52. data/app/views/fae/application/_header.slim +2 -2
  53. data/app/views/fae/application/_seo_set_form.html.slim +12 -0
  54. data/app/views/fae/options/_form.html.slim +2 -1
  55. data/app/views/fae/pages/home.html.slim +1 -1
  56. data/app/views/fae/shared/_errors.slim +0 -3
  57. data/app/views/fae/shared/_form_header.html.slim +4 -0
  58. data/app/views/fae/shared/_nested_table.html.slim +2 -1
  59. data/app/views/fae/shared/_shared_nested_table.html.slim +5 -2
  60. data/app/views/layouts/fae/application.html.slim +1 -1
  61. data/config/initializers/carrierwave.rb +41 -2
  62. data/config/initializers/fae_judge.rb +4 -2
  63. data/config/locales/fae.en.yml +10 -1
  64. data/config/puma.rb +82 -0
  65. data/db/migrate/20221118161833_create_fae_seo_sets.rb +13 -0
  66. data/lib/fae/concerns/models/base.rb +2 -0
  67. data/lib/fae/engine.rb +3 -3
  68. data/lib/fae/options.rb +17 -19
  69. data/lib/fae/version.rb +1 -1
  70. data/lib/generators/fae/base_generator.rb +17 -4
  71. data/lib/generators/fae/controller_generator.rb +0 -1
  72. data/lib/generators/fae/install_generator.rb +1 -1
  73. data/lib/generators/fae/model_generator.rb +1 -2
  74. data/lib/generators/fae/nested_index_scaffold_generator.rb +1 -2
  75. data/lib/generators/fae/nested_scaffold_generator.rb +13 -5
  76. data/lib/generators/fae/page_generator.rb +1 -2
  77. data/lib/generators/fae/scaffold_generator.rb +1 -1
  78. data/lib/generators/fae/templates/controllers/nested_scaffold_controller.rb +1 -3
  79. data/lib/generators/fae/templates/controllers/scaffold_controller.rb +7 -0
  80. data/lib/generators/fae/templates/views/_form.html.slim +2 -0
  81. data/lib/generators/fae/templates/views/_form_nested.html.slim +3 -0
  82. metadata +29 -20
  83. data/config/deploy/dev.rb +0 -19
  84. data/config/deploy/prod.rb +0 -19
  85. data/config/deploy/stage.rb +0 -19
  86. /data/app/assets/javascripts/fae/vendor/{simplemde.min.js → simplemde/simplemde.min.js} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 627ef0b4fdd41a840e63ef13d5816702d67109e3
4
- data.tar.gz: 2ee2bdb673debee82c40eb3064d44fdaf0143515
3
+ metadata.gz: '09c68df667f8b7ace15a19a487daa942920cbf0b'
4
+ data.tar.gz: dac2b54b4e27960568834510f11858e2173eddaa
5
5
  SHA512:
6
- metadata.gz: 3b31bb1dce450aecd010f337e851fb895ef86c4ccbcc8983d77e7d594e72a28e457a9966d79f238963d8e45fcb32a539167cd2e29666d2c6fb8a7b908cf8e41b
7
- data.tar.gz: 0d9775d7d639bc6fbe66ffbfb40ca5aaf1dccf99344c6160fbbdc6e2f7116e57f42bcc0da4b81345d7f504c2fa89fb206bc9235393f9913f14f3955fe6745e16
6
+ metadata.gz: 99e3412b45fd0809a4af841af0c810971e0106dbe71f43104e9063abc691af0bf46d15b6d6b4890d68eca748ad8c633903c3446209675acb5f8c55dff9b9627e
7
+ data.tar.gz: aa26791d19a9c46c6cc9c4b8feb133832961d4035751bb2eeb534f402cc3eb9597d952dd517c62f1919bd4a3fcd53b0cbb4de82a14588ca2ba5995e6149cbca4
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  Like many Rails CMS engines, Fae delivers all the basics to get you up and running quickly: authentication, authorization, a sleek UI, form helpers, image processing and workflows. But unlike other engines, Fae's generated models, controllers, and views are built to customize and scale.
9
9
 
10
- Fae 2.0 supports Rails 5.0 to 5.2, support for Rails 4.x is deprecated as of Fae 2.0.
10
+ Fae 3.x supports Rails 7. For legacy Rails support you can use Fae 2.x on Rails 5.0 to 5.2.
11
11
 
12
12
  ## Installation
13
13
 
@@ -63,6 +63,7 @@ https://www.faecms.com/documentation
63
63
 
64
64
  ### Tutorials
65
65
 
66
+ * [Setting Up SEO with Fae](docs/tutorials/seo.md)
66
67
  * [Setting Up GraphQL with Fae](docs/tutorials/graphql_support.md)
67
68
  * [Setting Up Images and Files](docs/tutorials/image_and_files.md)
68
69
  * [Adding Dynamic Relationships to Pages](docs/tutorials/dynamic_relationships_to_pages.md)
@@ -0,0 +1,2 @@
1
+ //= link fae/application.css
2
+ //= link fae/application.js
@@ -0,0 +1,50 @@
1
+ /* global Fae, modal, FCH */
2
+
3
+ /**
4
+ * Fae contrast
5
+ * @namespace
6
+ */
7
+
8
+ Fae.contrast = {
9
+ ready: function () {
10
+ this.highlightHex = getComputedStyle(document.body).getPropertyValue('--highlight-color');
11
+
12
+ // exit if highlight color css var not found
13
+ if (!this.highlightHex) {
14
+ return;
15
+ }
16
+
17
+ this.$body = $('body');
18
+ this.whiteHex = '#fff';
19
+ this.blackHex = '#000';
20
+ this.hexRegex = /(^#[0-9a-fA-F]{6}$)/;
21
+
22
+ // exit if highlight color is not a valid hex color
23
+ if (!this.hexRegex.test(this.highlightHex)) {
24
+ return;
25
+ }
26
+
27
+ this.setForegroundColor();
28
+ },
29
+
30
+
31
+ // dynamically set foreground color based on contrast with user set highlight color
32
+ setForegroundColor() {
33
+ const yiq = this.getContrastYIQ();
34
+ if (yiq >= 170) {
35
+ this.$body[0].style.setProperty('--foreground-color', this.blackHex);
36
+ } else {
37
+ this.$body[0].style.setProperty('--foreground-color', this.whiteHex);
38
+ }
39
+ },
40
+
41
+ getContrastYIQ() {
42
+ const hex = this.highlightHex.replace('#', '');
43
+ const r = parseInt(hex.substr(0, 2), 16);
44
+ const g = parseInt(hex.substr(2, 2), 16);
45
+ const b = parseInt(hex.substr(4, 2), 16);
46
+ return ((r * 299) + (g * 587) + (b * 114)) / 1000;
47
+ }
48
+
49
+
50
+ };
@@ -15,7 +15,7 @@ Fae.deploy = {
15
15
  this.buttonsEnabled = true;
16
16
  this.pollTimeout = null;
17
17
  this.pollInterval = 5000;
18
- this.idleStates = ['ready', 'error']
18
+ this.idleStates = ['ready', 'error', 'rejected']
19
19
 
20
20
  this.pollDeployStatus();
21
21
  this.deployButtonListener();
@@ -30,7 +30,9 @@
30
30
  //= require fae/vendor/jquery.tablesorter
31
31
  //= require fae/vendor/js.cookie
32
32
  //= require fae/vendor/touch_punch
33
- //= require fae/vendor/simplemde.min
33
+ //= require fae/vendor/simplemde/simplemde.min
34
+ //= require fae/vendor/simplemde/inline-attachment
35
+ //= require fae/vendor/simplemde/codemirror-4.inline-attachment
34
36
 
35
37
  //= require fae/admin
36
38
 
@@ -49,6 +51,7 @@
49
51
  //= require fae/form/_form_manager
50
52
  //= require fae/form/fae_chosen
51
53
  //= require fae/form/fileinputer
54
+ //= require fae/form/drag_drop
52
55
 
53
56
  //= require fae/navigation/sticky
54
57
  //= require fae/navigation/_navigation
@@ -59,6 +62,7 @@
59
62
  //= require fae/_modals
60
63
  //= require fae/_tables
61
64
  //= require fae/_deploy
65
+ //= require fae/_contrast
62
66
 
63
67
  //= require fae
64
68
 
@@ -10,6 +10,7 @@ Fae.form.ajax = {
10
10
  init: function() {
11
11
  this.$addedit_form = $('.js-addedit-form, .js-index-addedit-form');
12
12
  this.$filter_form = $('.js-filter-form');
13
+ this.$nested_form = $('.nested-form');
13
14
 
14
15
  this.addEditLinks();
15
16
  this.addEditSubmission();
@@ -82,6 +83,8 @@ Fae.form.ajax = {
82
83
  Fae.form.checkbox.setCheckboxAsActive();
83
84
  Fae.form.select.init();
84
85
  Fae.form.formManager.setupAllFields($wrapper.find('form'));
86
+ Fae.form.dragDrop.init();
87
+ Fae.tables.rowSorting();
85
88
 
86
89
  // validate nested form fields on submit
87
90
  Fae.form.validator.formValidate(this.$nested_form);
@@ -118,6 +121,11 @@ Fae.form.ajax = {
118
121
 
119
122
  var $target = $(evt.target);
120
123
 
124
+ // We need to target the form wrapper containing the target form to enable nesting
125
+ // multiple forms.
126
+ // Relying on $this will end up redrawing the top-most parent form with the returned table
127
+ var $theFormWrapper = $target.closest('.js-addedit-form');
128
+
121
129
  // ignore calls not returning html
122
130
  if (data !== ' ' && $(data)[0]) {
123
131
  var $this = $(this);
@@ -133,13 +141,13 @@ Fae.form.ajax = {
133
141
  if ($html) {
134
142
  if($html.hasClass('js-addedit-form') || $html.hasClass( 'js-index-addedit-form' )) {
135
143
  // we're returning the table, replace everything
136
- _this._addEditReplaceAndReinit($this, $html.html(), $target);
144
+ _this._addEditReplaceAndReinit($theFormWrapper, $html.html(), $target);
137
145
  } else if ($html.hasClass('nested-form')) {
138
146
 
139
147
  // we're returning the form due to an error, just replace the form
140
- $this.find('.nested-form' ).replaceWith($html);
141
- $this.find('.select select').fae_chosen();
142
- $this.find('.input.file').fileinputer();
148
+ $theFormWrapper.find('.nested-form' ).replaceWith($html);
149
+ $theFormWrapper.find('.select select').fae_chosen();
150
+ $theFormWrapper.find('.input.file').fileinputer();
143
151
 
144
152
  Fae.form.dates.initDatepicker();
145
153
  Fae.form.dates.initDateRangePicker();
@@ -165,6 +173,7 @@ Fae.form.ajax = {
165
173
 
166
174
  $parent.fadeOut(function(){
167
175
  $parent.next('.asset-inputs').fadeIn();
176
+ $parent.remove();
168
177
  });
169
178
  }
170
179
 
@@ -273,6 +282,7 @@ Fae.form.ajax = {
273
282
 
274
283
  $parent.fadeOut(function(){
275
284
  $parent.next('.asset-inputs').fadeIn();
285
+ $parent.remove();
276
286
  });
277
287
  }
278
288
  });
@@ -21,15 +21,17 @@ Fae.form = {
21
21
  this.filtering.init();
22
22
  this.slugger.init();
23
23
  this.formManager.init();
24
-
24
+
25
25
  // input type=file customization
26
26
  // This doesn't work in IE. It's not worth figuring out why by this point. IE9 gets plain file uploader.
27
27
  if (!FCH.IE9) {
28
28
  $('.input.file').fileinputer();
29
29
  }
30
-
30
+
31
31
  // make all the hint areas
32
32
  $('.hint').hinter();
33
+
34
+ this.dragDrop.init();
33
35
  },
34
36
 
35
37
  makeTwoColumnLabels: function() {