hot-glue 0.7.2 → 0.7.3
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/LICENSE +0 -4
- data/README.md +21 -3
- data/lib/generators/hot_glue/scaffold_generator.rb +11 -3
- data/lib/generators/hot_glue/templates/erb/edit.erb +6 -1
- data/lib/hotglue/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 00062223cad2c1adb79987dc16eec8e5a1cb612f18106c6b01878346630737d7
|
|
4
|
+
data.tar.gz: fd0fcf30cccc20b02e552d44628cf4856e08582338e296eea08699ff1318b85d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1ec04a5a3a6783caac2efc0035b409d9ac768a0d8094729b2f9551cdb363629f6433e24364a8caaaee675877ad996cbc51a219d666b9bfa05055143d372f3f77
|
|
7
|
+
data.tar.gz: '028e4f5fc7cb0a490ee715df7201976f79d026ff8916b5b0c9568901e215b61f61d54d4987a2748f40d48b7f91620acf719f59f6d52ed586853de6756eaefd61'
|
data/Gemfile.lock
CHANGED
data/LICENSE
CHANGED
|
@@ -9,9 +9,5 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
9
9
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
TO PURCHASE A COMMERCIAL USAGE LICENSE PLEASE VISIT
|
|
14
|
-
https://heliosdev.shop/hot-glue-license
|
|
15
|
-
|
|
16
12
|
OR PURCHASE THE TUTORIALS AT
|
|
17
13
|
https://school.jasonfleetwoodboldt.com/8188/?utm_source=github.com
|
data/README.md
CHANGED
|
@@ -2463,8 +2463,23 @@ These automatic pickups for partials are detected at build time. This means that
|
|
|
2463
2463
|
|
|
2464
2464
|
# VERSION HISTORY
|
|
2465
2465
|
|
|
2466
|
+
#### 2025-12-24 - v0.7.3
|
|
2466
2467
|
|
|
2467
|
-
|
|
2468
|
+
`--list-back-link-to-parent` (default: false)
|
|
2469
|
+
|
|
2470
|
+
If the parent is itself a big edit, and we got to the nested edit (also a big edit) through a tab showing subview list (loaded lazily via Turbo's built-in mechanism),
|
|
2471
|
+
then we don't typically want the "back to" link at the top of the edit page to take us back to the list of the current object.
|
|
2472
|
+
|
|
2473
|
+
That's because although the list of the current object exists as its own page, it isn't in the normal flow of what the user sees (it is via a lazy-loaded subview).
|
|
2474
|
+
|
|
2475
|
+
The user came to _this_ edit page from the parent's edit page, so we should go back to the parent's edit page.
|
|
2476
|
+
|
|
2477
|
+
Use `--list-back-link-to-parent` to tell this build to use a "Back to ____" link at the top of the edit page (where ____ is the name of the parent)
|
|
2478
|
+
|
|
2479
|
+
Otherwise, the link at the top of the edit page will read "Back to list" and take the user back to the list view of the current build.
|
|
2480
|
+
|
|
2481
|
+
|
|
2482
|
+
#### 2025-12-12 - v0.7.2
|
|
2468
2483
|
- Using the object (of the scaffold being built) inside of the hawk now adds `@` to a variable named as the singular name of the scaffold;
|
|
2469
2484
|
see "Using the object inside of the hawk"
|
|
2470
2485
|
- error catching for missing parent relationships
|
|
@@ -2485,7 +2500,7 @@ These automatic pickups for partials are detected at build time. This means that
|
|
|
2485
2500
|
|
|
2486
2501
|
Hot Glue already has a robust set of tools to provide field-by-field access control, hiding or turning visible-only fields by multiple methods, described under Access Control & Field Visibility Features.
|
|
2487
2502
|
|
|
2488
|
-
Remember that Hot Glue's opinionated design has two ways a field is displayed: show (which appears on the list view and is always just viewable), and form (which is
|
|
2503
|
+
Remember that Hot Glue's opinionated design has two ways a field is displayed: show (which appears on the list view and is always just viewable), and form (which is used by both the new and edit actions to display a form). Within the `form` output, the form might be used for either new or edit, and further refinements can be applied to new or edit.
|
|
2489
2504
|
|
|
2490
2505
|
Here's a quick review those methods now:
|
|
2491
2506
|
|
|
@@ -2515,10 +2530,13 @@ Here's a quick review those methods now:
|
|
|
2515
2530
|
Today, with v0.7 of this gem, I'm introducing three more features that are all available from within the `--include` setting.
|
|
2516
2531
|
|
|
2517
2532
|
• Omitted fields: using `-` is omit on list & show; use `=` to omit the field on the form (new & edit)
|
|
2533
|
+
|
|
2518
2534
|
• Dynamic blocks (which can also be omitted using
|
|
2535
|
+
|
|
2519
2536
|
• Set column widths when using specified grouping made (--include contains `:`)
|
|
2520
2537
|
|
|
2521
|
-
For details, see "Layout & Manipulation Features"
|
|
2538
|
+
For details, see "Omitted fields", "Dynamic Blocks", and "Omitted Dynamic Blocks" in the "Layout & Manipulation Features"
|
|
2539
|
+
(those three features were introduced in v0.7)
|
|
2522
2540
|
|
|
2523
2541
|
|
|
2524
2542
|
|
|
@@ -31,7 +31,7 @@ class HotGlue::ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
|
|
|
31
31
|
:search_clear_button, :search_autosearch, :include_object_names,
|
|
32
32
|
:stimmify, :stimmify_camel, :hidden_create, :hidden_update,
|
|
33
33
|
:invisible_create, :invisible_update, :phantom_create_params,
|
|
34
|
-
:phantom_update_params, :lazy
|
|
34
|
+
:phantom_update_params, :lazy, :list_back_link_to_parent
|
|
35
35
|
# important: using an attr_accessor called :namespace indirectly causes a conflict with Rails class_name method
|
|
36
36
|
# so we use namespace_value instead
|
|
37
37
|
|
|
@@ -130,6 +130,8 @@ class HotGlue::ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
|
|
|
130
130
|
class_option :search_position, default: 'vertical' # choices are vertical or horizontal
|
|
131
131
|
class_option :search_clear_button, default: false
|
|
132
132
|
class_option :search_autosearch, default: false
|
|
133
|
+
class_option :list_back_link_to_parent, default: nil
|
|
134
|
+
|
|
133
135
|
|
|
134
136
|
# FOR THE PREDICATE SEARCH
|
|
135
137
|
# TDB
|
|
@@ -492,6 +494,7 @@ class HotGlue::ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
|
|
|
492
494
|
@include_object_names = options['include_object_names'] || get_default_from_config(key: :include_object_names)
|
|
493
495
|
|
|
494
496
|
|
|
497
|
+
@list_back_link_to_parent = options['list_back_link_to_parent'] || false
|
|
495
498
|
|
|
496
499
|
if @god
|
|
497
500
|
# @auth = nil
|
|
@@ -1056,6 +1059,7 @@ class HotGlue::ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
|
|
|
1056
1059
|
|
|
1057
1060
|
if @object_owner_sym && !@self_auth
|
|
1058
1061
|
auth_assoc_field = auth_assoc + "_id" unless @god
|
|
1062
|
+
|
|
1059
1063
|
assoc = eval("#{singular_class}.reflect_on_association(:#{@object_owner_sym})")
|
|
1060
1064
|
|
|
1061
1065
|
if assoc
|
|
@@ -1362,17 +1366,21 @@ class HotGlue::ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
|
|
|
1362
1366
|
top_level: top_level)
|
|
1363
1367
|
end
|
|
1364
1368
|
|
|
1365
|
-
def edit_parent_path_helper
|
|
1369
|
+
def edit_parent_path_helper(top_level = false)
|
|
1366
1370
|
# the path to the edit route of the PARENT
|
|
1367
1371
|
if @nested_set.any? && @nested
|
|
1368
1372
|
"edit_#{@namespace + "_" if @namespace}#{(@nested_set.collect { |x| x[:singular] }.join("_") + "_" if @nested_set.any?)}path(" +
|
|
1369
|
-
"#{@nested_set.collect { |x| x[:singular] }.join(", ")}" + ")"
|
|
1373
|
+
"#{@nested_set.collect { |x| (top_level ? "@": "" ) + x[:singular] }.join(", ")}" + ")"
|
|
1370
1374
|
|
|
1371
1375
|
else
|
|
1372
1376
|
"edit_#{@namespace + "_" if @namespace}path"
|
|
1373
1377
|
end
|
|
1374
1378
|
end
|
|
1375
1379
|
|
|
1380
|
+
def parent_object_name
|
|
1381
|
+
@nested_set.last[:singular]
|
|
1382
|
+
end
|
|
1383
|
+
|
|
1376
1384
|
def datetime_fields_list
|
|
1377
1385
|
@columns.each_with_object({}) do |col, hash|
|
|
1378
1386
|
column = @the_object.columns_hash[col.to_s]
|
|
@@ -5,7 +5,12 @@
|
|
|
5
5
|
<div class="container">
|
|
6
6
|
<div class="row">
|
|
7
7
|
<div class="col-md-12">
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
<% if @list_back_link_to_parent %>
|
|
10
|
+
<\%= link_to "⬅️ Back to <%= parent_object_name %>".html_safe, <%= edit_parent_path_helper(true) %> %>
|
|
11
|
+
<% else %>
|
|
12
|
+
<\%= link_to "⬅️ Back to list".html_safe, <%= path_helper_plural(true) %> %>
|
|
13
|
+
<% end %>
|
|
9
14
|
<% end %>
|
|
10
15
|
<\%= render partial: "edit", locals: {<%= singular %>: @<%= singular %><%= @nested_set.any? ? ", " + (@nested_set.collect{|x| "#{x[:singular]}: @#{x[:singular]}"}.join(", ") ) : "" %>} %>
|
|
11
16
|
<% if @big_edit %>
|
data/lib/hotglue/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hot-glue
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jason Fleetwood-Boldt
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-12-
|
|
11
|
+
date: 2025-12-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -139,7 +139,7 @@ files:
|
|
|
139
139
|
- script/test
|
|
140
140
|
homepage: https://heliosdev.shop/p/hot-glue?utm_source=rubygems.org&utm_campaign=rubygems_link
|
|
141
141
|
licenses:
|
|
142
|
-
-
|
|
142
|
+
- MIT
|
|
143
143
|
metadata:
|
|
144
144
|
source_code_uri: https://github.com/hot-glue-for-rails/hot-glue
|
|
145
145
|
homepage: https://heliosdev.shop/hot-glue
|