hot-glue 0.6.6 → 0.6.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +25 -2
- data/app/helpers/hot_glue/controller_helper.rb +2 -3
- data/lib/generators/hot_glue/layout_strategy/bootstrap.rb +1 -1
- data/lib/generators/hot_glue/markup_templates/erb.rb +2 -2
- data/lib/generators/hot_glue/scaffold_generator.rb +16 -2
- 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: 15e0bc59f5196bf61a4e4277e009e9cc63847eaaea8aa4582c7ee252a8a97a4d
|
4
|
+
data.tar.gz: e48db9204c108cbf9066ab126ccb2af24e3f45e17203fed8dceefe15659aadd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b16830779629bda9bfc50b9ec076ccc90c8a174485afcd355c5394a2c2f591d106271ea0f6d5465a92a9f7fc5f4874e769d4c0186239a9f2b9383c2a32c28a14
|
7
|
+
data.tar.gz: 5a0153ed1b88b195ba2cfe41fa2156e708a89e478b4757baf2f964de16170a424b58bffe2d9092a909ce314eb81c7717516ccea16917b6590f713e4a112c60bc
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -28,7 +28,7 @@ Hot Glue generates quick and dirty functionality. It lets you be crafty. However
|
|
28
28
|
* Throw the scaffolding away when your app is ready to graduate to its next phase.
|
29
29
|
|
30
30
|
How is it different than Rails scaffolding?
|
31
|
-
|
31
|
+
77
|
32
32
|
Although inspired by the Rails scaffold generators (built-in to Rails), Hot Glue does something similiar but has made opinionated decisions that deviate from the normal Rails scaffold:
|
33
33
|
|
34
34
|
1. The Hot Glue scaffolds are complete packages and are pre-optimized for 'edit-in-place' so that new and edit operations happen in-page smoothly.
|
@@ -1610,10 +1610,33 @@ The `within` partials should do operations within the form (like hidden fields),
|
|
1610
1610
|
These automatic pickups for partials are detected at buildtime. This means that if you add these partials later, you must rebuild your scaffold.
|
1611
1611
|
|
1612
1612
|
|
1613
|
+
# VERSION HISTORY
|
1613
1614
|
|
1615
|
+
#### 2024-11-18 - v0.6.6.1
|
1616
|
+
|
1617
|
+
- Adds hg- classes to the form fields for easier styling
|
1618
|
+
(add this css to your app)
|
1619
|
+
```
|
1620
|
+
|
1621
|
+
div.hg-heading-row {
|
1622
|
+
background-color: #aab7d1;
|
1623
|
+
font-weight: bold;
|
1624
|
+
}
|
1625
|
+
|
1626
|
+
div.hg-row {
|
1627
|
+
border: solid 1px grey;
|
1628
|
+
}
|
1629
|
+
|
1630
|
+
|
1631
|
+
.hg-col {
|
1632
|
+
border: solid 1px grey;
|
1633
|
+
overflow: hidden;
|
1634
|
+
}
|
1635
|
+
```
|
1636
|
+
- Fixes in `modify_date_inputs_on_params`
|
1637
|
+
- Fixes in named_variants for Rails 7.1 (applies to attachments)
|
1614
1638
|
|
1615
1639
|
|
1616
|
-
# VERSION HISTORY
|
1617
1640
|
|
1618
1641
|
#### 2024-10-23 - v0.6.6
|
1619
1642
|
|
@@ -80,9 +80,8 @@ module HotGlue
|
|
80
80
|
end
|
81
81
|
if include_me && params[k].present?
|
82
82
|
if use_timezone
|
83
|
-
|
84
|
-
|
85
|
-
params[k] = Time.strptime(parse_date, "%Y-%m-%d %H:%M %Z")
|
83
|
+
parse_date = "#{params[k].gsub("T", " ")} #{use_timezone.formatted_offset}"
|
84
|
+
params[k] = Time.strptime(parse_date, "%Y-%m-%d %H:%M:%S %Z")
|
86
85
|
end
|
87
86
|
end
|
88
87
|
}
|
@@ -77,7 +77,7 @@ module HotGlue
|
|
77
77
|
|
78
78
|
columns = layout_object[:columns][:container]
|
79
79
|
result = columns.map{ |column|
|
80
|
-
"<div class='#{col_identifier} heading--#{singular}--#{column.join("-")}' " + col_style + ">" +
|
80
|
+
"<div class='#{col_identifier} hg-heading-row heading--#{singular}--#{column.join("-")}' " + col_style + ">" +
|
81
81
|
column.map(&:to_s).map{|col_name| "#{col_name.humanize}"}.join("<br />") + "</div>"
|
82
82
|
}.join("\n")
|
83
83
|
return result
|
@@ -198,7 +198,7 @@ module HotGlue
|
|
198
198
|
|
199
199
|
result = columns.map{ |column|
|
200
200
|
|
201
|
-
"<div class='#{col_identifier} #{singular}--#{column.join("-")}'#{style_with_flex_basis}> " +
|
201
|
+
"<div class='hg-col #{col_identifier} #{singular}--#{column.join("-")}'#{style_with_flex_basis}> " +
|
202
202
|
column.map { |col|
|
203
203
|
if eval("#{singular_class}.columns_hash['#{col}']").nil? && !attachments.keys.include?(col) && !related_sets.include?(col)
|
204
204
|
raise "Can't find column '#{col}' on #{singular_class}, are you sure that is the column name?"
|
@@ -683,7 +683,14 @@ class HotGlue::ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
|
|
683
683
|
if !(eval("#{singular_class}.reflect_on_attachment(:#{attachment_entry})"))
|
684
684
|
raise HotGlue::Error, "Could not find #{attachment_entry} attachment on #{singular_class}"
|
685
685
|
end
|
686
|
-
|
686
|
+
|
687
|
+
if Rails.version.to_f >= 7.1
|
688
|
+
thumb = eval("#{singular_class}.reflect_on_attachment(:#{attachment_entry}).named_variants.include?(:thumb)")
|
689
|
+
else
|
690
|
+
thumb = eval("#{singular_class}.reflect_on_attachment(:#{attachment_entry}).variants.include?(:thumb)")
|
691
|
+
end
|
692
|
+
|
693
|
+
if thumb
|
687
694
|
thumbnail = "thumb"
|
688
695
|
else
|
689
696
|
thumbnail = nil
|
@@ -694,12 +701,19 @@ class HotGlue::ScaffoldGenerator < Erb::Generators::ScaffoldGenerator
|
|
694
701
|
dropzone = nil
|
695
702
|
end
|
696
703
|
|
697
|
-
if thumbnail
|
704
|
+
if thumbnail
|
705
|
+
if Rails.version.to_f >= 7.1
|
706
|
+
check_for_missing_variant = !eval("#{singular_class}.reflect_on_attachment(:#{key}).named_variants.include?(:#{thumbnail})")
|
707
|
+
else
|
708
|
+
check_for_missing_variant = !eval("#{singular_class}.reflect_on_attachment(:#{key}).variants.include?(:#{thumbnail})")
|
709
|
+
end
|
710
|
+
if check_for_missing_variant
|
698
711
|
raise HotGlue::Error, "you specified to use #{thumbnail} as the thumbnail but could not find any such variant on the #{key} attachment; add to your #{singular}.rb file:
|
699
712
|
has_one_attached :#{key} do |attachable|
|
700
713
|
attachable.variant :#{thumbnail}, resize_to_limit: [100, 100]
|
701
714
|
end
|
702
715
|
"
|
716
|
+
end
|
703
717
|
end
|
704
718
|
|
705
719
|
@attachments[key.to_sym] = { thumbnail: thumbnail,
|
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.6.6
|
4
|
+
version: 0.6.6.1
|
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: 2024-
|
11
|
+
date: 2024-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|