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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b1abbb288949d4eb6fda0866f18341f1df8e28726c96b60369e03f31219ad2a
4
- data.tar.gz: 77cf3b279697a8221b4187505d6ea038ca90d6acb0a3246805bf687466f8d29d
3
+ metadata.gz: 15e0bc59f5196bf61a4e4277e009e9cc63847eaaea8aa4582c7ee252a8a97a4d
4
+ data.tar.gz: e48db9204c108cbf9066ab126ccb2af24e3f45e17203fed8dceefe15659aadd5
5
5
  SHA512:
6
- metadata.gz: ddcfb7fefe2fb763a3a04c54a8fae32f53db9c95827dafcfef7eabecd2db7957980cf20ba8d67eec15f61e82908bc4fde45d637adee9567388b71c30cda60691
7
- data.tar.gz: e51fdf70415ca9277d6952acf52225ff40889abd6ed905f5143be3faaa0234cfec405ad6629fec97f9fc5b3acdf26cd18a53f188f0b86ee2b27e5a181d3f5286
6
+ metadata.gz: b16830779629bda9bfc50b9ec076ccc90c8a174485afcd355c5394a2c2f591d106271ea0f6d5465a92a9f7fc5f4874e769d4c0186239a9f2b9383c2a32c28a14
7
+ data.tar.gz: 5a0153ed1b88b195ba2cfe41fa2156e708a89e478b4757baf2f964de16170a424b58bffe2d9092a909ce314eb81c7717516ccea16917b6590f713e4a112c60bc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hot-glue (0.6.5)
4
+ hot-glue (0.6.6)
5
5
  ffaker (~> 2.16)
6
6
  kaminari (~> 1.2)
7
7
  rails (> 5.1)
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
- zone = DateTime.now.in_time_zone(use_timezone).zone
84
- parse_date = "#{params[k].gsub("T", " ")} #{zone}"
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
  }
@@ -50,7 +50,7 @@ class LayoutStrategy::Bootstrap < LayoutStrategy::Base
50
50
  end
51
51
 
52
52
  def row_classes
53
- "row"
53
+ "row hg-row"
54
54
  end
55
55
 
56
56
  def page_end
@@ -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
- if eval("#{singular_class}.reflect_on_attachment(:#{attachment_entry}).variants.include?(:thumb)")
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 && !eval("#{singular_class}.reflect_on_attachment(:#{key}).variants.include?(:#{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,
@@ -1,5 +1,5 @@
1
1
  module HotGlue
2
2
  class Version
3
- CURRENT = '0.6.6'
3
+ CURRENT = '0.6.6.1'
4
4
  end
5
5
  end
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-10-23 00:00:00.000000000 Z
11
+ date: 2024-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails