hot-glue 0.4.3 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +71 -0
- data/.gitignore +2 -1
- data/Gemfile +4 -1
- data/Gemfile.lock +7 -17
- data/{LICENCE → LICENSE} +10 -6
- data/README.md +79 -41
- data/config/database.yml +8 -83
- data/db/schema.rb +1 -0
- data/lib/generators/hot_glue/install_generator.rb +7 -6
- data/lib/generators/hot_glue/layout/builder.rb +11 -9
- data/lib/generators/hot_glue/markup_templates/erb.rb +33 -22
- data/lib/generators/hot_glue/scaffold_generator.rb +99 -52
- data/lib/generators/hot_glue/templates/controller.rb.erb +39 -33
- data/lib/generators/hot_glue/templates/erb/_form.erb +3 -2
- data/lib/generators/hot_glue/templates/erb/_list.erb +22 -19
- data/lib/generators/hot_glue/templates/erb/_new_form.erb +2 -1
- data/lib/generators/hot_glue/templates/erb/_show.erb +3 -3
- data/lib/generators/hot_glue/templates/erb/new.erb +1 -1
- data/lib/hotglue/version.rb +1 -1
- metadata +6 -29
- data/db/schema.rb +0 -60
@@ -2,30 +2,33 @@
|
|
2
2
|
<div class="<%= @container_name %> scaffold-list">
|
3
3
|
<% unless @no_list || @nested_args.any? %><h4><%= plural.gsub("_", " ").upcase %></h4><% end %>
|
4
4
|
|
5
|
-
<% unless @no_create %><%= '<%= render partial: "' + ((@namespace+"/" if @namespace) || "") +
|
5
|
+
<% unless @no_create %><%= '<%= render partial: "' + ((@namespace+"/" if @namespace) || "") + @controller_build_folder + '/new_button", locals: {' + nested_assignments + '}' + '%\>'.gsub('\\',"") %><br /><% end %>
|
6
6
|
|
7
|
-
<% unless @no_list
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
<% unless @no_list %>
|
8
|
+
<% unless @no_list_labels %>
|
9
|
+
<div class="row scaffold-heading-row">
|
10
|
+
<%= list_column_headings %>
|
11
|
+
<% if @downnest_children.any? %>
|
12
|
+
<% each_downnest_width = @downnest_children.count == 1 ? 40 : (60/@downnest_children.count).floor %>
|
13
|
+
<% downnest_column_style = @layout == "hotglue" ? 'style="flex-basis: ' + each_downnest_width.to_s + '%;' : "" %>
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
15
|
+
<% @downnest_children.each_with_index do |downnest,i| %>
|
16
|
+
<div class=" scaffold-col-heading<%= " col-sm-#{ @layout_object[:portals][downnest][:size] }" if @layout=="bootstrap" %>" <%= downnest_column_style %>>
|
17
|
+
<strong>
|
18
|
+
<%= downnest.titleize %>
|
19
|
+
</strong>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
22
23
|
|
23
|
-
|
24
|
+
<% button_column_style = @layout == "hotglue" ? 'style="flex-basis: 150px' : "" %>
|
24
25
|
|
25
|
-
|
26
|
+
<div class=' scaffold-col-heading scaffold-col-heading-buttons<%= " col-md-#{ @layout_object[:buttons][:size] }" if @layout=="bootstrap" %>' <%= button_column_style %>>
|
27
|
+
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
<% end %>
|
26
31
|
|
27
|
-
</div>
|
28
|
-
</div>
|
29
32
|
<\% if <%= plural %>.empty? %>
|
30
33
|
<div>
|
31
34
|
None
|
@@ -3,6 +3,7 @@
|
|
3
3
|
New <%= singular.titlecase %>
|
4
4
|
</h3>
|
5
5
|
<\%= form_with model: <%= singular %>, url: <%= path_helper_plural %>(<%= nested_objects_arity %>), method: "post" do |f| %>
|
6
|
-
<\%= render partial: "<%= namespace_with_slash +
|
6
|
+
<\%= render partial: "<%= namespace_with_slash + @controller_build_folder %>/form",
|
7
|
+
locals: { <%= singular %>: <%= singular %> <%= nest_assignments_operator(false, true) %>, f: f} %>
|
7
8
|
<\% end %>
|
8
9
|
<\% end %>
|
@@ -19,12 +19,12 @@
|
|
19
19
|
<% end %>
|
20
20
|
|
21
21
|
<% button_style = @layout == "hotglue" ? 'style="flex-basis: ' + (100 - (column_width * @columns.count)).floor.to_s + '%;"' : "" %>
|
22
|
-
<div class="<%= @col_identifier %> scaffold-line-buttons <%=
|
22
|
+
<div class="<%= @col_identifier %> scaffold-line-buttons <%= " col-md-#{ @layout_object[:buttons][:size] }" if @layout == "bootstrap" %>" <%= button_style %>>
|
23
23
|
<%= magic_button_output %>
|
24
24
|
|
25
25
|
<% if destroy_action %>
|
26
|
-
<\%= form_with url: <%= path_helper_singular %>(<%= path_helper_args %>), html: {style: "display: inline-block;"}, method: :delete do |f| %>
|
27
|
-
<\%= f.submit "Delete".html_safe,
|
26
|
+
<\%= form_with url: <%= path_helper_singular %>(<%= path_helper_args %>), html: {data: {'<%= @ujs_syntax ? 'confirm' : 'turbo-confirm' %>': "Are you sure you want to delete #{ <%= @singular + "." + display_class %> }?"}, style: "display: inline-block;"}, method: :delete do |f| %>
|
27
|
+
<\%= f.submit "Delete".html_safe, class: "delete-<%= singular %>-button btn btn-primary btn-sm" %>
|
28
28
|
<\% end %>
|
29
29
|
<% end %>
|
30
30
|
|
@@ -1 +1 @@
|
|
1
|
-
<\%= render partial: "new_form", locals: {<%= singular %>: @<%=singular%>} %>
|
1
|
+
<\%= render partial: "new_form", locals: {<%= singular %>: @<%=singular%><%= nest_assignments_operator(true, true) %>} %>
|
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.
|
4
|
+
version: 0.4.7
|
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: 2022-01-
|
11
|
+
date: 2022-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -17,9 +17,6 @@ dependencies:
|
|
17
17
|
- - ">"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '5.1'
|
20
|
-
- - "<="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '7'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,9 +24,6 @@ dependencies:
|
|
27
24
|
- - ">"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '5.1'
|
30
|
-
- - "<="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '7'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: kaminari
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,20 +38,6 @@ dependencies:
|
|
44
38
|
- - "~>"
|
45
39
|
- !ruby/object:Gem::Version
|
46
40
|
version: '1.2'
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: sass-rails
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - ">="
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
54
|
-
type: :runtime
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '0'
|
61
41
|
- !ruby/object:Gem::Dependency
|
62
42
|
name: ffaker
|
63
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,12 +59,13 @@ executables: []
|
|
79
59
|
extensions: []
|
80
60
|
extra_rdoc_files: []
|
81
61
|
files:
|
62
|
+
- ".circleci/config.yml"
|
82
63
|
- ".github/FUNDING.yml"
|
83
64
|
- ".gitignore"
|
84
65
|
- ".travis.yml"
|
85
66
|
- Gemfile
|
86
67
|
- Gemfile.lock
|
87
|
-
-
|
68
|
+
- LICENSE
|
88
69
|
- README.md
|
89
70
|
- Rakefile
|
90
71
|
- app/assets/config/manifest.js
|
@@ -145,19 +126,15 @@ files:
|
|
145
126
|
- lib/hot-glue.rb
|
146
127
|
- lib/hotglue/engine.rb
|
147
128
|
- lib/hotglue/version.rb
|
148
|
-
homepage: https://
|
129
|
+
homepage: https://jfbcodes.com/p/hot-glue-in-depth-tutorial?utm_source=rubygems.org&utm_campaign=rubygems_link
|
149
130
|
licenses:
|
150
131
|
- Commercial with free option
|
151
132
|
metadata:
|
152
133
|
source_code_uri: https://github.com/jasonfb/hot-glue
|
153
|
-
tutorial: https://jfbcodes.com/hot-glue-tutorial
|
154
|
-
buy_license: https://heliosdev.shop/hot-glue-licens
|
155
|
-
get_merch: https://shop.heliosdev.shop/?utm_source=rubygems&utm_campaign=hot_glue_gem_metadata
|
156
134
|
post_install_message: |
|
157
135
|
---------------------------------------------
|
158
136
|
Welcome to Hot Glue - A Scaffold Building Companion for Hotwire + Turbo-Rails
|
159
|
-
|
160
|
-
To purchase a license, please visit https://heliosdev.shop/hot-glue-license
|
137
|
+
For license options visit https://heliosdev.shop/hot-glue-license
|
161
138
|
---------------------------------------------
|
162
139
|
rdoc_options: []
|
163
140
|
require_paths:
|
data/db/schema.rb
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
# This file is auto-generated from the current state of the database. Instead
|
2
|
-
# of editing this file, please use the migrations feature of Active Record to
|
3
|
-
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
-
#
|
5
|
-
# This file is the source Rails uses to define your schema when running `bin/rails
|
6
|
-
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
7
|
-
# be faster and is potentially less error prone than running all of your
|
8
|
-
# migrations from scratch. Old migrations may fail to apply correctly if those
|
9
|
-
# migrations use external dependencies or application code.
|
10
|
-
#
|
11
|
-
# It's strongly recommended that you check this file into your version control system.
|
12
|
-
|
13
|
-
ActiveRecord::Schema.define(version: 2021_03_06_225506) do
|
14
|
-
|
15
|
-
create_table "abcs", force: :cascade do |t|
|
16
|
-
t.integer "xxx"
|
17
|
-
t.string "yyy"
|
18
|
-
t.integer "dfg_id"
|
19
|
-
t.datetime "created_at", precision: 6, null: false
|
20
|
-
t.datetime "updated_at", precision: 6, null: false
|
21
|
-
end
|
22
|
-
|
23
|
-
create_table "dfg", force: :cascade do |t|
|
24
|
-
t.integer "user_id"
|
25
|
-
t.string "name"
|
26
|
-
t.datetime "created_at", precision: 6, null: false
|
27
|
-
t.datetime "updated_at", precision: 6, null: false
|
28
|
-
end
|
29
|
-
|
30
|
-
create_table "ghis", force: :cascade do |t|
|
31
|
-
t.integer "dfg_id"
|
32
|
-
t.datetime "created_at", precision: 6, null: false
|
33
|
-
t.datetime "updated_at", precision: 6, null: false
|
34
|
-
end
|
35
|
-
|
36
|
-
create_table "jkls", force: :cascade do |t|
|
37
|
-
t.integer "hgi_id"
|
38
|
-
t.datetime "created_at", precision: 6, null: false
|
39
|
-
t.datetime "updated_at", precision: 6, null: false
|
40
|
-
end
|
41
|
-
|
42
|
-
create_table "users", force: :cascade do |t|
|
43
|
-
t.string "email", default: "", null: false
|
44
|
-
t.string "encrypted_password", default: "", null: false
|
45
|
-
t.string "reset_password_token"
|
46
|
-
t.datetime "reset_password_sent_at"
|
47
|
-
t.datetime "remember_created_at"
|
48
|
-
t.datetime "created_at", precision: 6, null: false
|
49
|
-
t.datetime "updated_at", precision: 6, null: false
|
50
|
-
t.index ["email"], name: "index_users_on_email", unique: true
|
51
|
-
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
52
|
-
end
|
53
|
-
|
54
|
-
create_table "xyzs", force: :cascade do |t|
|
55
|
-
t.integer "nothing_id"
|
56
|
-
t.datetime "created_at", precision: 6, null: false
|
57
|
-
t.datetime "updated_at", precision: 6, null: false
|
58
|
-
end
|
59
|
-
|
60
|
-
end
|