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.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/app/assets/config/fae/manifest.js +2 -0
- data/app/assets/javascripts/fae/_contrast.js +50 -0
- data/app/assets/javascripts/fae/_deploy.js +1 -1
- data/app/assets/javascripts/fae/application.js +5 -1
- data/app/assets/javascripts/fae/form/_ajax.js +14 -4
- data/app/assets/javascripts/fae/form/_form.js +4 -2
- data/app/assets/javascripts/fae/form/_validator.js +224 -55
- data/app/assets/javascripts/fae/form/drag_drop.js +109 -0
- data/app/assets/javascripts/fae/form/inputs/_select.js +7 -4
- data/app/assets/javascripts/fae/form/inputs/_text.js +23 -9
- data/app/assets/javascripts/fae/vendor/simplemde/codemirror-4.inline-attachment.js +95 -0
- data/app/assets/javascripts/fae/vendor/simplemde/inline-attachment.js +405 -0
- data/app/assets/stylesheets/fae/application.css +1 -0
- data/app/assets/stylesheets/fae/base.scss +2 -1
- data/app/assets/stylesheets/fae/globals/_tags.scss +1 -1
- data/app/assets/stylesheets/fae/globals/layout/_base.scss +2 -2
- data/app/assets/stylesheets/fae/globals/layout/_content-header.scss +6 -2
- data/app/assets/stylesheets/fae/globals/legacy/_pre-1.3.scss +1 -1
- data/app/assets/stylesheets/fae/globals/navigation/_footer.scss +1 -1
- data/app/assets/stylesheets/fae/globals/navigation/_header.scss +2 -2
- data/app/assets/stylesheets/fae/globals/navigation/_sidenav.scss +2 -2
- data/app/assets/stylesheets/fae/globals/navigation/_utility.scss +1 -1
- data/app/assets/stylesheets/fae/modules/_errors-bar.scss +19 -0
- data/app/assets/stylesheets/fae/modules/_toggles.scss +1 -1
- data/app/assets/stylesheets/fae/modules/forms/_base.scss +13 -0
- data/app/assets/stylesheets/fae/modules/forms/_date.scss +4 -4
- data/app/assets/stylesheets/fae/modules/forms/_hints.scss +1 -1
- data/app/assets/stylesheets/fae/modules/forms/_label.scss +1 -1
- data/app/assets/stylesheets/fae/modules/forms/_select.scss +2 -2
- data/app/assets/stylesheets/fae/modules/forms/_simple-mde.scss +71 -0
- data/app/assets/stylesheets/fae/modules/tables/_base.scss +1 -1
- data/app/assets/stylesheets/fae/modules/tables/_pagination.scss +2 -2
- data/app/assets/stylesheets/fae/pages/_error.scss +1 -1
- data/app/assets/stylesheets/fae/pages/_login.scss +1 -1
- data/app/assets/stylesheets/fae/simplemde_override.scss +32 -0
- data/app/controllers/fae/application_controller.rb +2 -2
- data/app/controllers/fae/base_controller.rb +1 -1
- data/app/controllers/fae/deploy_hooks_controller.rb +4 -4
- data/app/controllers/fae/setup_controller.rb +2 -2
- data/app/helpers/fae/application_helper.rb +10 -1
- data/app/helpers/fae/view_helper.rb +4 -0
- data/app/models/concerns/fae/base_model_concern.rb +8 -0
- data/app/models/concerns/fae/seo_set_concern.rb +1 -0
- data/app/models/fae/change.rb +1 -0
- data/app/models/fae/option.rb +1 -0
- data/app/models/fae/seo_set.rb +14 -0
- data/app/services/fae/netlify_api.rb +22 -6
- data/app/uploaders/fae/file_uploader.rb +1 -1
- data/app/uploaders/fae/image_uploader.rb +2 -2
- data/app/views/fae/application/_header.slim +2 -2
- data/app/views/fae/application/_seo_set_form.html.slim +12 -0
- data/app/views/fae/options/_form.html.slim +2 -1
- data/app/views/fae/pages/home.html.slim +1 -1
- data/app/views/fae/shared/_errors.slim +0 -3
- data/app/views/fae/shared/_form_header.html.slim +4 -0
- data/app/views/fae/shared/_nested_table.html.slim +2 -1
- data/app/views/fae/shared/_shared_nested_table.html.slim +5 -2
- data/app/views/layouts/fae/application.html.slim +1 -1
- data/config/initializers/carrierwave.rb +41 -2
- data/config/initializers/fae_judge.rb +4 -2
- data/config/locales/fae.en.yml +10 -1
- data/config/puma.rb +82 -0
- data/db/migrate/20221118161833_create_fae_seo_sets.rb +13 -0
- data/lib/fae/concerns/models/base.rb +2 -0
- data/lib/fae/engine.rb +3 -3
- data/lib/fae/options.rb +17 -19
- data/lib/fae/version.rb +1 -1
- data/lib/generators/fae/base_generator.rb +17 -4
- data/lib/generators/fae/controller_generator.rb +0 -1
- data/lib/generators/fae/install_generator.rb +1 -1
- data/lib/generators/fae/model_generator.rb +1 -2
- data/lib/generators/fae/nested_index_scaffold_generator.rb +1 -2
- data/lib/generators/fae/nested_scaffold_generator.rb +13 -5
- data/lib/generators/fae/page_generator.rb +1 -2
- data/lib/generators/fae/scaffold_generator.rb +1 -1
- data/lib/generators/fae/templates/controllers/nested_scaffold_controller.rb +1 -3
- data/lib/generators/fae/templates/controllers/scaffold_controller.rb +7 -0
- data/lib/generators/fae/templates/views/_form.html.slim +2 -0
- data/lib/generators/fae/templates/views/_form_nested.html.slim +3 -0
- metadata +29 -20
- data/config/deploy/dev.rb +0 -19
- data/config/deploy/prod.rb +0 -19
- data/config/deploy/stage.rb +0 -19
- /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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09c68df667f8b7ace15a19a487daa942920cbf0b'
|
4
|
+
data.tar.gz: dac2b54b4e27960568834510f11858e2173eddaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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,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
|
+
};
|
@@ -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($
|
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
|
-
$
|
141
|
-
$
|
142
|
-
$
|
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() {
|