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
@@ -0,0 +1,19 @@
|
|
1
|
+
.errors-bar-wrapper {
|
2
|
+
border-color: $c-error-content;
|
3
|
+
background: $c-error-bg;
|
4
|
+
color: $c-error-content;
|
5
|
+
width: 100%;
|
6
|
+
padding: 20px;
|
7
|
+
display: none;
|
8
|
+
|
9
|
+
.errors-bar {
|
10
|
+
display: flex;
|
11
|
+
margin-top: 20px;
|
12
|
+
flex-direction: column;
|
13
|
+
}
|
14
|
+
|
15
|
+
.error-jump-link {
|
16
|
+
margin-right: 20px;
|
17
|
+
font-size: 14px;
|
18
|
+
}
|
19
|
+
}
|
@@ -39,6 +39,11 @@ input[type=email] {
|
|
39
39
|
margin-top: 10px;
|
40
40
|
margin-bottom: 10px;
|
41
41
|
}
|
42
|
+
|
43
|
+
.addedit-form-thumb {
|
44
|
+
max-width: 150px;
|
45
|
+
max-height: 100px;
|
46
|
+
}
|
42
47
|
}
|
43
48
|
|
44
49
|
.js-addedit-form-wrapper {
|
@@ -98,3 +103,11 @@ input[type=email] {
|
|
98
103
|
margin-bottom: 10px;
|
99
104
|
}
|
100
105
|
}
|
106
|
+
|
107
|
+
.input.field {
|
108
|
+
|
109
|
+
&.highlight {
|
110
|
+
outline: 2px dashed green;
|
111
|
+
outline-offset: 1px;
|
112
|
+
}
|
113
|
+
}
|
@@ -149,11 +149,11 @@
|
|
149
149
|
|
150
150
|
.ui-datepicker-calendar {
|
151
151
|
.ui-state-hover {
|
152
|
-
color:
|
152
|
+
color: var(--highlight-color);
|
153
153
|
}
|
154
154
|
|
155
155
|
.ui-state-active {
|
156
|
-
background:
|
156
|
+
background: var(--highlight-color);
|
157
157
|
color: $c-white;
|
158
158
|
position: relative;
|
159
159
|
}
|
@@ -323,12 +323,12 @@
|
|
323
323
|
|
324
324
|
&.checked,
|
325
325
|
&.toMonth.valid.checked {
|
326
|
-
background:
|
326
|
+
background: var(--highlight-color);
|
327
327
|
color: $c-white;
|
328
328
|
}
|
329
329
|
|
330
330
|
&.real-today.checked {
|
331
|
-
background:
|
331
|
+
background: var(--highlight-color);
|
332
332
|
}
|
333
333
|
}
|
334
334
|
|
@@ -228,7 +228,7 @@
|
|
228
228
|
position: absolute;
|
229
229
|
right: 15px;
|
230
230
|
top: 9px;
|
231
|
-
color:
|
231
|
+
color: var(--highlight-color);
|
232
232
|
}
|
233
233
|
}
|
234
234
|
|
@@ -289,7 +289,7 @@
|
|
289
289
|
content: fae-icon(check);
|
290
290
|
padding-right: 5px;
|
291
291
|
margin-left: -19px;
|
292
|
-
color:
|
292
|
+
color: var(--highlight-color);
|
293
293
|
}
|
294
294
|
}
|
295
295
|
|
@@ -27,3 +27,74 @@
|
|
27
27
|
}
|
28
28
|
}
|
29
29
|
}
|
30
|
+
|
31
|
+
.editor-preview,
|
32
|
+
.editor-preview-side {
|
33
|
+
h1 {
|
34
|
+
font-size: 26px;
|
35
|
+
}
|
36
|
+
|
37
|
+
h2 {
|
38
|
+
font-size: 24px;
|
39
|
+
}
|
40
|
+
|
41
|
+
h3 {
|
42
|
+
font-size: 22px;
|
43
|
+
}
|
44
|
+
|
45
|
+
h4 {
|
46
|
+
font-size: 20px;
|
47
|
+
}
|
48
|
+
|
49
|
+
h5 {
|
50
|
+
font-size: 18px;
|
51
|
+
}
|
52
|
+
|
53
|
+
h6 {
|
54
|
+
font-size: 16px;
|
55
|
+
}
|
56
|
+
|
57
|
+
h1,
|
58
|
+
h2,
|
59
|
+
h3,
|
60
|
+
h4,
|
61
|
+
h5,
|
62
|
+
h6 {
|
63
|
+
font-weight: bold;
|
64
|
+
}
|
65
|
+
|
66
|
+
h1,
|
67
|
+
h2,
|
68
|
+
h3,
|
69
|
+
h4,
|
70
|
+
h5,
|
71
|
+
h6,
|
72
|
+
p,
|
73
|
+
ul,
|
74
|
+
ol {
|
75
|
+
background: none;
|
76
|
+
border: 0;
|
77
|
+
color: black;
|
78
|
+
letter-spacing: 0;
|
79
|
+
margin: inherit;
|
80
|
+
padding: inherit;
|
81
|
+
text-transform: inherit;
|
82
|
+
}
|
83
|
+
|
84
|
+
ul {
|
85
|
+
list-style: disc;
|
86
|
+
}
|
87
|
+
|
88
|
+
ol {
|
89
|
+
list-style: decimal;
|
90
|
+
}
|
91
|
+
|
92
|
+
ul,
|
93
|
+
ol {
|
94
|
+
padding-left: 30px;
|
95
|
+
}
|
96
|
+
|
97
|
+
em {
|
98
|
+
font-style: italic;
|
99
|
+
}
|
100
|
+
}
|
@@ -19,7 +19,7 @@
|
|
19
19
|
|
20
20
|
&:hover {
|
21
21
|
color: $c-white;
|
22
|
-
background:
|
22
|
+
background: var(--highlight-color);
|
23
23
|
}
|
24
24
|
}
|
25
25
|
|
@@ -29,6 +29,6 @@
|
|
29
29
|
|
30
30
|
.current {
|
31
31
|
color: $c-white;
|
32
|
-
background:
|
32
|
+
background: var(--highlight-color);
|
33
33
|
}
|
34
34
|
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
.editor-preview,
|
2
|
+
.editor-preview-side {
|
3
|
+
h1 { font-size: 26px; }
|
4
|
+
h2 { font-size: 24px; }
|
5
|
+
h3 { font-size: 22px; }
|
6
|
+
h4 { font-size: 20px; }
|
7
|
+
h5 { font-size: 18px; }
|
8
|
+
h6 { font-size: 16px; }
|
9
|
+
|
10
|
+
h1, h2, h3, h4, h5, h6 {
|
11
|
+
font-weight: bold;
|
12
|
+
}
|
13
|
+
|
14
|
+
h1, h2, h3, h4, h5, h6, p, ul, ol {
|
15
|
+
background: none;
|
16
|
+
border: 0;
|
17
|
+
color: black;
|
18
|
+
letter-spacing: 0;
|
19
|
+
margin: inherit;
|
20
|
+
padding: inherit;
|
21
|
+
text-transform: inherit;
|
22
|
+
}
|
23
|
+
|
24
|
+
ul { list-style: disc; }
|
25
|
+
ol { list-style: decimal; }
|
26
|
+
|
27
|
+
ul, ol {
|
28
|
+
padding-left: 30px;
|
29
|
+
}
|
30
|
+
|
31
|
+
em { font-style: italic; }
|
32
|
+
}
|
@@ -60,7 +60,7 @@ module Fae
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def show_404
|
63
|
-
render
|
63
|
+
render 'fae/pages/error404', layout: 'fae/error', status: :not_found
|
64
64
|
end
|
65
65
|
|
66
66
|
def set_option
|
@@ -125,7 +125,7 @@ module Fae
|
|
125
125
|
|
126
126
|
def load_and_filter_models
|
127
127
|
# load of all models since Rails caches activerecord queries.
|
128
|
-
|
128
|
+
Zeitwerk::Loader.eager_load_all
|
129
129
|
ActiveRecord::Base.descendants.map.reject { |m| m.name['Fae::'] || !m.instance_methods.include?(:fae_display_field) || Fae.dashboard_exclusions.include?(m.name) || !authorize_model(m) }
|
130
130
|
end
|
131
131
|
|
@@ -16,7 +16,7 @@ module Fae
|
|
16
16
|
end
|
17
17
|
respond_to do |format|
|
18
18
|
format.html
|
19
|
-
format.csv { send_data @items.to_csv, filename: @items.name.parameterize + "." + Time.now.
|
19
|
+
format.csv { send_data @items.to_csv, filename: @items.name.parameterize + "." + Time.now.to_fs(:filename) + '.csv' }
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -22,7 +22,7 @@ module Fae
|
|
22
22
|
if @deploy_hook.save
|
23
23
|
flash[:notice] = t('fae.save_notice')
|
24
24
|
@deploy_hooks = DeployHook.all
|
25
|
-
render
|
25
|
+
render partial: table_template_path
|
26
26
|
else
|
27
27
|
render action: 'new'
|
28
28
|
end
|
@@ -32,7 +32,7 @@ module Fae
|
|
32
32
|
if @deploy_hook.update(deploy_hook_params)
|
33
33
|
flash[:notice] = t('fae.save_notice')
|
34
34
|
@deploy_hooks = DeployHook.all
|
35
|
-
render
|
35
|
+
render partial: table_template_path
|
36
36
|
else
|
37
37
|
render action: 'edit'
|
38
38
|
end
|
@@ -45,7 +45,7 @@ module Fae
|
|
45
45
|
flash[:alert] = t('fae.delete_error')
|
46
46
|
end
|
47
47
|
@deploy_hooks = DeployHook.all
|
48
|
-
render
|
48
|
+
render partial: table_template_path
|
49
49
|
end
|
50
50
|
|
51
51
|
private
|
@@ -64,7 +64,7 @@ module Fae
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def table_template_path
|
67
|
-
"fae/deploy_hooks/
|
67
|
+
"fae/deploy_hooks/table"
|
68
68
|
end
|
69
69
|
|
70
70
|
end
|
@@ -34,11 +34,11 @@ module Fae
|
|
34
34
|
private
|
35
35
|
|
36
36
|
def show_404
|
37
|
-
render
|
37
|
+
render 'fae/pages/error404', layout: 'fae/error', status: :not_found
|
38
38
|
end
|
39
39
|
|
40
40
|
def show_401
|
41
|
-
render
|
41
|
+
render 'fae/pages/error404', layout: 'fae/error', status: :unauthorized
|
42
42
|
end
|
43
43
|
|
44
44
|
def user_params
|
@@ -31,7 +31,7 @@ module Fae
|
|
31
31
|
return if value.blank?
|
32
32
|
# if item is an image
|
33
33
|
if value.class.name == 'Fae::Image'
|
34
|
-
image_tag(value
|
34
|
+
image_tag(nested_table_thumb_url(value), class: 'addedit-form-thumb') if nested_table_thumb_url(value).present?
|
35
35
|
# if item's attribute is an association
|
36
36
|
elsif item.class.reflections.include?(attribute)
|
37
37
|
value.try(:fae_display_field)
|
@@ -135,5 +135,14 @@ module Fae
|
|
135
135
|
'multicol-nav'
|
136
136
|
end
|
137
137
|
end
|
138
|
+
|
139
|
+
def nested_table_thumb_url(image)
|
140
|
+
return unless image.asset.file
|
141
|
+
if image.asset.file.extension.downcase == 'svg'
|
142
|
+
image.asset.url
|
143
|
+
else
|
144
|
+
image.asset.thumb.url
|
145
|
+
end
|
146
|
+
end
|
138
147
|
end
|
139
148
|
end
|
@@ -25,6 +25,10 @@ module Fae
|
|
25
25
|
render 'fae/application/content_form', f: f, attribute: attribute, label: label, hint: hint, helper_text: helper_text, markdown: markdown, markdown_supported: markdown_supported, input_options: input_options, show_form_manager: show_form_manager
|
26
26
|
end
|
27
27
|
|
28
|
+
def fae_seo_set_form(f, seo_set_name)
|
29
|
+
render 'fae/application/seo_set_form', f: f, seo_set_name: seo_set_name
|
30
|
+
end
|
31
|
+
|
28
32
|
def fae_index_image(image, path = nil)
|
29
33
|
return if image.blank? || image.asset.blank? || image.asset.thumb.blank?
|
30
34
|
content_tag :div, class: 'image-mat' do
|
@@ -100,6 +100,14 @@ module Fae
|
|
100
100
|
accepts_nested_attributes_for file_name_symbol, allow_destroy: true
|
101
101
|
end
|
102
102
|
|
103
|
+
def has_fae_seo_set(set_name_symbol)
|
104
|
+
has_one set_name_symbol,
|
105
|
+
as: :seo_setable,
|
106
|
+
class_name: '::Fae::SeoSet',
|
107
|
+
dependent: :destroy
|
108
|
+
accepts_nested_attributes_for set_name_symbol, allow_destroy: true
|
109
|
+
end
|
110
|
+
|
103
111
|
end
|
104
112
|
|
105
113
|
private
|
@@ -0,0 +1 @@
|
|
1
|
+
module Fae::SeoSetConcern; end
|
data/app/models/fae/change.rb
CHANGED
data/app/models/fae/option.rb
CHANGED
@@ -6,6 +6,7 @@ module Fae
|
|
6
6
|
|
7
7
|
validates_inclusion_of :singleton_guard, :in => [0]
|
8
8
|
validates_presence_of :title, :time_zone, :live_url
|
9
|
+
validates :colorway, format: { with: /(^[0-9a-fA-F]{6}$)|(^$)/, message: "Invalid hex code or doesn't meet length requirement of exactly 6 characters" }
|
9
10
|
|
10
11
|
has_one :logo, -> { where(attached_as: 'logo' ) },
|
11
12
|
as: :imageable,
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Fae
|
2
|
+
class SeoSet < ActiveRecord::Base
|
3
|
+
include Fae::BaseModelConcern
|
4
|
+
include Fae::SeoSetConcern
|
5
|
+
|
6
|
+
has_fae_image :social_media_image
|
7
|
+
belongs_to :seo_setable, polymorphic: true, touch: true, optional: true
|
8
|
+
|
9
|
+
def fae_display_field
|
10
|
+
seo_title
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -28,7 +28,7 @@ module Fae
|
|
28
28
|
|
29
29
|
private
|
30
30
|
|
31
|
-
def get(endpoint
|
31
|
+
def get(endpoint)
|
32
32
|
begin
|
33
33
|
uri = URI.parse(endpoint)
|
34
34
|
request = Net::HTTP::Get.new(uri)
|
@@ -36,11 +36,18 @@ module Fae
|
|
36
36
|
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) {|http|
|
37
37
|
http.request(request)
|
38
38
|
}
|
39
|
-
|
39
|
+
if response.is_a?(Net::HTTPSuccess)
|
40
|
+
return JSON.parse(response.body) if response.body.present?
|
41
|
+
else
|
42
|
+
@logger.info "\n"
|
43
|
+
@logger.info "Get returned non-success code: #{response.code}"
|
44
|
+
@logger.info "Endpoint: #{endpoint}"
|
45
|
+
@logger.info "Body: #{response.body}" if response.body.present?
|
46
|
+
end
|
40
47
|
rescue Exception => e
|
41
48
|
@logger.info "\n"
|
42
|
-
@logger.info "
|
43
|
-
@logger.info "
|
49
|
+
@logger.info "Get failed"
|
50
|
+
@logger.info "Endpoint: #{endpoint}"
|
44
51
|
@logger.info "Reason: #{e}"
|
45
52
|
end
|
46
53
|
end
|
@@ -54,10 +61,19 @@ module Fae
|
|
54
61
|
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) {|http|
|
55
62
|
http.request(request)
|
56
63
|
}
|
57
|
-
|
64
|
+
if response.is_a?(Net::HTTPSuccess)
|
65
|
+
return JSON.parse(response.body) if response.body.present?
|
66
|
+
else
|
67
|
+
@logger.info "\n"
|
68
|
+
@logger.info "Post returned non-success code: #{response.code}"
|
69
|
+
@logger.info "Endpoint: #{endpoint}"
|
70
|
+
@logger.info "Params: #{params}"
|
71
|
+
@logger.info "Body: #{response.body}" if response.body.present?
|
72
|
+
end
|
58
73
|
rescue Exception => e
|
59
74
|
@logger.info "\n"
|
60
|
-
@logger.info "
|
75
|
+
@logger.info "Post failed"
|
76
|
+
@logger.info "Endpoint: #{endpoint}"
|
61
77
|
@logger.info "Params: #{params}"
|
62
78
|
@logger.info "Reason: #{e}"
|
63
79
|
end
|
@@ -16,8 +16,8 @@ header.main-header#js-main-header
|
|
16
16
|
- if user_signed_in?
|
17
17
|
ul.utility-nav#js-utility-nav
|
18
18
|
- if current_user.super_admin_or_admin? && netlify_enabled?
|
19
|
-
|
20
|
-
|
19
|
+
li class=deployments_active_class
|
20
|
+
a.deployments-nav-link href=fae.deploy_path = t('fae.navbar.deployments')
|
21
21
|
li.utility-dropdown.js-utility-dropdown
|
22
22
|
a.grabatar-link href="#"
|
23
23
|
img.grabatar src=fae_avatar alt=current_user.full_name
|
@@ -0,0 +1,12 @@
|
|
1
|
+
ruby:
|
2
|
+
require_locals ['f'], local_assigns
|
3
|
+
item ||= f.object
|
4
|
+
seo_set_name ||= :seo_set
|
5
|
+
the_seo_set = item.send(seo_set_name)
|
6
|
+
|
7
|
+
= f.simple_fields_for seo_set_name do |i|
|
8
|
+
= fae_input i, :seo_title, label: 'SEO Title'
|
9
|
+
= fae_input i, :seo_description, label: 'SEO Description'
|
10
|
+
= fae_input i, :social_media_title
|
11
|
+
= fae_input i, :social_media_description
|
12
|
+
= fae_image_form i, :social_media_image, helper_text: '1200 x 630 px., JPG'
|
@@ -3,13 +3,14 @@
|
|
3
3
|
h1 Root Settings
|
4
4
|
.content-header-buttons
|
5
5
|
a.button#js-header-cancel href=fae.root_path(cancelled: true) = t('fae.form.cancel')
|
6
|
-
=
|
6
|
+
input name="commit" type="submit" value=t('fae.form.save')
|
7
7
|
|
8
8
|
== render 'flash_messages'
|
9
9
|
|
10
10
|
main.content
|
11
11
|
= fae_input f, :title, label: t('fae.options.project.name')
|
12
12
|
= fae_input f, :time_zone, wrapper_class: 'select'
|
13
|
+
= fae_input f, :colorway, label: t('fae.options.colorway'), helper_text: t('fae.options.colorway_helper')
|
13
14
|
= fae_input f, :live_url, label: t('fae.options.live_url'), helper_text: t('fae.options.url_helper')
|
14
15
|
= fae_input f, :stage_url, label: t('fae.options.stage_url'), helper_text: t('fae.options.url_helper')
|
15
16
|
= fae_image_form f, :logo, helper_text: t('fae.options.logo_helper')
|
@@ -20,7 +20,7 @@ header.content-header.js-content-header.-dashboard
|
|
20
20
|
- begin
|
21
21
|
- parent = item.respond_to?(:fae_parent) ? item.fae_parent : nil
|
22
22
|
- edit_path = edit_polymorphic_path([main_app, fae_scope.to_sym, parent, item])
|
23
|
-
- index_path = polymorphic_path([main_app, fae_scope.to_sym, parent, item.class.to_s.pluralize.underscore])
|
23
|
+
- index_path = polymorphic_path([main_app, fae_scope.to_sym, parent, item.class.to_s.pluralize.underscore.to_sym])
|
24
24
|
tr
|
25
25
|
td: a href=edit_path = item.fae_display_field
|
26
26
|
td: a href=index_path = item.class.to_s
|
@@ -12,6 +12,7 @@ ruby:
|
|
12
12
|
title ||= assoc_name.titleize # 'Restaurant Bars'
|
13
13
|
add_button_text ||= t('fae.common.add', title: title.singularize)
|
14
14
|
hide_add_button ||= false
|
15
|
+
hide_delete_button ||= false
|
15
16
|
ordered ||= false
|
16
17
|
has_thumb ||= false
|
17
18
|
edit_column ||= false
|
@@ -34,7 +35,7 @@ ruby:
|
|
34
35
|
new_path += "item_id=#{parent_item.id}&=item_class=#{parent_item.class.to_s}"
|
35
36
|
end
|
36
37
|
|
37
|
-
options_for_table = { index: index, assoc: assoc, assoc_name: assoc_name, title: title, add_button_text: add_button_text, hide_add_button: hide_add_button, ordered: ordered, has_thumb: has_thumb, edit_column: edit_column, cols: cols, assoc_name_singular: assoc_name_singular, new_path: new_path, edit_path: edit_path }
|
38
|
+
options_for_table = { index: index, assoc: assoc, assoc_name: assoc_name, title: title, add_button_text: add_button_text, hide_add_button: hide_add_button, hide_delete_button: hide_delete_button, ordered: ordered, has_thumb: has_thumb, edit_column: edit_column, cols: cols, assoc_name_singular: assoc_name_singular, new_path: new_path, edit_path: edit_path }
|
38
39
|
options_for_table[:parent_item] = parent_item unless index
|
39
40
|
|
40
41
|
section.addedit-form.js-addedit-form class="#{'content' if index}"
|
@@ -2,6 +2,7 @@ ruby:
|
|
2
2
|
colspan = cols.length + 1
|
3
3
|
colspan += 1 if ordered
|
4
4
|
colspan += 1 if has_thumb
|
5
|
+
colspan -= 1 if hide_delete_button
|
5
6
|
table_class = ordered ? 'js-sort-row' : nil
|
6
7
|
|
7
8
|
options_for_td = { cols: cols, edit_path: edit_path, edit_column: edit_column }
|
@@ -17,7 +18,8 @@ table class=table_class
|
|
17
18
|
= th_columns(col)
|
18
19
|
- if edit_column
|
19
20
|
th.-action data-sorter="false"
|
20
|
-
|
21
|
+
- unless hide_delete_button
|
22
|
+
th.-action
|
21
23
|
tbody
|
22
24
|
- records = index ? @items : parent_item.send(assoc)
|
23
25
|
- if records.present?
|
@@ -35,7 +37,8 @@ table class=table_class
|
|
35
37
|
td
|
36
38
|
a.js-edit-link.js-tooltip.table-action title=t('fae.common.edit') href=self.send(edit_path, item)
|
37
39
|
i.icon-edit
|
38
|
-
|
40
|
+
- unless hide_delete_button
|
41
|
+
td = fae_delete_button item, "/#{fae_path}/#{assoc_name}/#{item.id.to_s}", class: 'js-tooltip table-action js-delete-link', remote: true
|
39
42
|
|
40
43
|
- elsif !hide_add_button
|
41
44
|
tr
|
@@ -9,7 +9,7 @@ html
|
|
9
9
|
== javascript_include_tag 'fae/application'
|
10
10
|
== csrf_meta_tags
|
11
11
|
|
12
|
-
body class=body_class
|
12
|
+
body class=body_class style=('--highlight-color:' + '#' + @option.colorway if @option.colorway.present?)
|
13
13
|
== render 'mobilenav'
|
14
14
|
== render 'header'
|
15
15
|
.js-form-manager-container
|