bullet_train-super_scaffolding 1.2.13 → 1.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/_index.html.erb +5 -1
- data/config/locales/en/scaffolding/absolutely_abstract/creative_concepts.en.yml +2 -10
- data/lib/bullet_train/super_scaffolding/version.rb +1 -1
- data/lib/scaffolding/transformer.rb +18 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8516859933bed7583b303d44d355dd05bab645c83317cd33f570fb52dc4c36cf
|
4
|
+
data.tar.gz: 0d47aac21ec615fb238d2c48a4a1de151520cee21064f373b2571e8e51c64992
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dfca796cded970b7eb4dd6c65d82c52da7c3e3e37ffa3926881148d65a93a3be6dcbe8d966bcd3c52a041ec9a32056b486b538159ca3832377df3bc901aa5d0
|
7
|
+
data.tar.gz: dfdf01c6e6fe2bc47117263c8b02c7e8683ac7d2e5b6a90b67f429d950e9106fd37e635da90c43b52b14a4c7e797fd8adf2ce733e2abb5a647d03a6320bf9867
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<%= render 'account/shared/box' do |p| %>
|
11
11
|
<% p.content_for :title, t(".contexts.#{context.class.name.underscore}.header") %>
|
12
12
|
<% p.content_for :description do %>
|
13
|
-
<%= t(".contexts.#{context.class.name.underscore}
|
13
|
+
<%= t(".contexts.#{context.class.name.underscore}.description").html_safe %>
|
14
14
|
<%= render "shared/limits/index", model: creative_concepts.model %>
|
15
15
|
<% end %>
|
16
16
|
|
@@ -41,6 +41,10 @@
|
|
41
41
|
<%= link_to t('.buttons.new'), [:new, :account, @team, :scaffolding_absolutely_abstract_creative_concept], class: "#{first_button_primary(:absolutely_abstract_creative_concept)} new" %>
|
42
42
|
<% end %>
|
43
43
|
|
44
|
+
<%# 🚅 super scaffolding will insert new targets one parent action model buttons above this line. %>
|
45
|
+
<%# 🚅 super scaffolding will insert new bulk action model buttons above this line. %>
|
46
|
+
<%= render "shared/bulk_action_select" %>
|
47
|
+
|
44
48
|
<%= link_to t('global.buttons.back'), [:account, context], class: "#{first_button_primary(:absolutely_abstract_creative_concept)} back" unless hide_back %>
|
45
49
|
<% end %>
|
46
50
|
<% end %>
|
@@ -63,18 +63,10 @@ en:
|
|
63
63
|
contexts:
|
64
64
|
team:
|
65
65
|
header: Creative Concepts
|
66
|
-
|
67
|
-
|
68
|
-
description_empty_admin: No Creative Concepts have been added for %{team_name} yet. To get started, use the button below!
|
69
|
-
description_empty: There are no Creative Concepts for you to see on %{team_name} yet. To add your own, use the button below!
|
66
|
+
description:
|
67
|
+
If you're wondering what this is and how to hide it, read the "<a href="/docs/super-scaffolding" target="_blank">Code Generation with Super Scaffolding</a>" section of the Bullet Train documentation.
|
70
68
|
fields: *fields
|
71
69
|
buttons: *buttons
|
72
|
-
commentary:
|
73
|
-
If you're wondering what a "Creative Concept" is, don't worry, there's nothing to understand here!
|
74
|
-
<code>Scaffolding::AbsolutelyAbstract::CreativeConcept</code> is a model that exists by default in Bullet Train to serve as part of Super Scaffolding's template system.
|
75
|
-
It also provides an example of what a scaffolded model looks like by default.
|
76
|
-
Yes, the class has a very weird name, but the weird name serves an important purpose when we're generating code.
|
77
|
-
For more details and instructions on how to hide this, see "<a href="https://bullettrain.co/docs/super-scaffolding">Code Generation with Super Scaffolding</a>".
|
78
70
|
show:
|
79
71
|
section: "%{creative_concept_name}"
|
80
72
|
header: Creative Concept Details
|
@@ -185,6 +185,21 @@ class Scaffolding::Transformer
|
|
185
185
|
end.compact.first || raise("Couldn't find the Super Scaffolding template for `#{file}` in any of the following locations:\n\n#{BulletTrain::SuperScaffolding.template_paths.join("\n")}")
|
186
186
|
end
|
187
187
|
|
188
|
+
def resolve_target_path(file)
|
189
|
+
# Only do something here if they are trying to specify a target directory.
|
190
|
+
return file unless ENV["TARGET"]
|
191
|
+
|
192
|
+
# If the file exists in the application repository, we want to target it there.
|
193
|
+
return file if File.exist?(file)
|
194
|
+
|
195
|
+
ENV["OTHER_TARGETS"].split(",").each do |possible_target|
|
196
|
+
candidate_path = "#{possible_target}/#{file}".gsub("//", "/")
|
197
|
+
return candidate_path if File.exist?(candidate_path)
|
198
|
+
end
|
199
|
+
|
200
|
+
"#{ENV["TARGET"]}/#{file}".gsub("//", "/")
|
201
|
+
end
|
202
|
+
|
188
203
|
def get_transformed_file_content(file)
|
189
204
|
transformed_file_content = []
|
190
205
|
|
@@ -265,7 +280,7 @@ class Scaffolding::Transformer
|
|
265
280
|
|
266
281
|
def scaffold_file(file, overrides: false)
|
267
282
|
transformed_file_content = get_transformed_file_content(file)
|
268
|
-
transformed_file_name = transform_string(file)
|
283
|
+
transformed_file_name = resolve_target_path(transform_string(file))
|
269
284
|
|
270
285
|
# Remove `_overrides` from the file name if we're sourcing from a local override folder.
|
271
286
|
transformed_file_name.gsub!("_overrides", "") if overrides
|
@@ -400,14 +415,14 @@ class Scaffolding::Transformer
|
|
400
415
|
end
|
401
416
|
|
402
417
|
def scaffold_add_line_to_file(file, content, hook, options = {})
|
403
|
-
file = transform_string(file)
|
418
|
+
file = resolve_target_path(transform_string(file))
|
404
419
|
content = transform_string(content)
|
405
420
|
hook = transform_string(hook)
|
406
421
|
add_line_to_file(file, content, hook, options)
|
407
422
|
end
|
408
423
|
|
409
424
|
def scaffold_replace_line_in_file(file, content, in_place_of)
|
410
|
-
file = transform_string(file)
|
425
|
+
file = resolve_target_path(transform_string(file))
|
411
426
|
# we specifically don't transform the content, we assume a builder function created this content.
|
412
427
|
in_place_of = transform_string(in_place_of)
|
413
428
|
Scaffolding::FileManipulator.replace_line_in_file(file, content, in_place_of, suppress_could_not_find: suppress_could_not_find)
|