hot-glue 0.3.9 → 0.4.0
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/lib/generators/hot_glue/install_generator.rb +3 -0
- data/lib/generators/hot_glue/markup_templates/erb.rb +1 -1
- data/lib/generators/hot_glue/scaffold_generator.rb +11 -6
- data/lib/generators/hot_glue/templates/erb/_list.erb +4 -3
- data/lib/hotglue/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3f0bea54517d12d4518615c1807c783ec6cdbf1ea5c40eb8860771262929d82
|
4
|
+
data.tar.gz: 3e7aa8a54329f8d7601b7597477ec5010f2e7af8dd034173ab8ac7adff5e8aa1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb01610edb92fae69b0db9eab7e25eb4595abc6952789c1f816b6b9e8910f86a37bf713e394a73676e691f9c7fdfb5b3488ba05bdae21bb8cbe01e5008086a87
|
7
|
+
data.tar.gz: 2d932ad6bda29b971ab7252b6fecbf120f05089a65b5bbcdca588aa24fd459b2b727d310a81735008c26a17beedd449d7d58258701f43a3be305edd26373f577
|
data/Gemfile.lock
CHANGED
@@ -21,7 +21,7 @@ module HotGlue
|
|
21
21
|
magic_buttons.collect{ |button_name|
|
22
22
|
"<%= form_with model: #{singular}, url: #{path_helper_singular}(#{path_helper_args}) do |f| %>
|
23
23
|
<%= f.hidden_field :#{button_name}, value: \"#{button_name}\" %>
|
24
|
-
<%= f.submit '#{button_name.titleize}'.html_safe, disabled: (
|
24
|
+
<%= f.submit '#{button_name.titleize}'.html_safe, disabled: (#{singular}.respond_to?(:#{button_name}able?) && ! #{singular}.#{button_name}able? ), data: {confirm: 'Are you sure you want to #{button_name} this #{singular}?'}, class: '#{singular}-button btn btn-primary ' %>
|
25
25
|
<% end %>"
|
26
26
|
}.join("\n")
|
27
27
|
end
|
@@ -52,6 +52,7 @@ module HotGlue
|
|
52
52
|
class_option :no_delete, type: :boolean, default: false
|
53
53
|
class_option :no_create, type: :boolean, default: false
|
54
54
|
class_option :no_edit, type: :boolean, default: false
|
55
|
+
class_option :no_list, type: :boolean, default: false
|
55
56
|
class_option :no_paginate, type: :boolean, default: false
|
56
57
|
class_option :big_edit, type: :boolean, default: false
|
57
58
|
class_option :show_only, type: :string, default: ""
|
@@ -164,6 +165,8 @@ module HotGlue
|
|
164
165
|
@big_edit = options['big_edit']
|
165
166
|
|
166
167
|
@no_edit = options['no_edit'] || false
|
168
|
+
@no_list = options['no_list'] || false
|
169
|
+
|
167
170
|
@display_list_after_update = options['display_list_after_update'] || false
|
168
171
|
|
169
172
|
|
@@ -796,16 +799,18 @@ module HotGlue
|
|
796
799
|
|
797
800
|
def controller_magic_button_update_actions
|
798
801
|
@magic_buttons.collect{ |magic_button|
|
799
|
-
"
|
800
|
-
|
802
|
+
" if #{singular}_params[:#{magic_button}]
|
803
|
+
begin
|
801
804
|
res = @#{singular}.#{magic_button}!
|
802
805
|
res = \"#{magic_button.titleize}ed.\" if res === true
|
803
806
|
flash[:notice] = (flash[:notice] || \"\") << (res ? res + \" \" : \"\")
|
807
|
+
rescue ActiveRecord::RecordInvalid => e
|
808
|
+
@#{singular}.errors.add(:base, e.message)
|
809
|
+
flash[:alert] = (flash[:alert] || \"\") << 'There was ane error #{magic_button}ing your #{@singular}: '
|
804
810
|
end
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
end" }.join("\n") + "\n"
|
811
|
+
end"
|
812
|
+
|
813
|
+
}.join("\n") + "\n"
|
809
814
|
end
|
810
815
|
|
811
816
|
def controller_update_params_tap_away_magic_buttons
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<\%= turbo_frame_tag "<%= plural %>-list" <%= nested_for_turbo_id_list_constructor %> do %>
|
2
2
|
<div class="<%= @container_name %> scaffold-list">
|
3
|
-
<% unless @nested_args.any? %><h4><%= plural.gsub("_", " ").upcase %></h4><% end %>
|
3
|
+
<% unless @no_list || @nested_args.any? %><h4><%= plural.gsub("_", " ").upcase %></h4><% end %>
|
4
4
|
|
5
5
|
<% unless @no_create %><%= '<%= render partial: "' + ((@namespace+"/" if @namespace) || "") + plural + '/new_button", locals: {' + nested_assignments + '}' + '%\>'.gsub('\\',"") %><% end %>
|
6
6
|
|
7
|
-
|
7
|
+
<% unless @no_list %>
|
8
8
|
<div class="row scaffold-row">
|
9
9
|
<%= list_column_headings %>
|
10
10
|
<% if @downnest_children.any? %>
|
@@ -35,8 +35,9 @@
|
|
35
35
|
<\% <%= plural %>.each do |<%= singular %>| %>
|
36
36
|
<\%= render partial: '<%= line_path_partial %>', locals: {<%= singular %>: <%= singular %><%= nested_assignments_with_leading_comma if @nestable %><%= ", nested_for: nested_for" if @nestable %> } %>
|
37
37
|
<\% end %>
|
38
|
-
|
39
38
|
<%= @no_paginate ? "" : paginate %>
|
39
|
+
|
40
40
|
</div>
|
41
|
+
<% end %>
|
41
42
|
</div>
|
42
43
|
<\% end %>
|
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.
|
4
|
+
version: 0.4.0
|
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: 2021-12-
|
11
|
+
date: 2021-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|