five-two-nw-olivander 0.2.0.32 → 0.2.0.33

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: 3aa4679fd3ac4496649900ee060cb20b1826f8e1b43c4757d548a9d5b77b6e4c
4
- data.tar.gz: 61615323b1201dbd021800a5525062036bc80aab414c36028aa4e43c8ab1e2d0
3
+ metadata.gz: a2488764b16b7943eac6350511c32575af3e60d154eac16a3cd2b834f849fdfc
4
+ data.tar.gz: 56f377cfc38c89759ff1047036217b8e6f536b9f97081ff34ea5200bfeacb335
5
5
  SHA512:
6
- metadata.gz: 50bc6dc97b5826eef4ec98b15e20f11560a758f4b9c82b42e04d6962bc492cb697caa9094264ded682f0afdfc3195122953313595809f6a428aef461b9b68ea9
7
- data.tar.gz: 577a779f683e1a5a5719747dc74f585633628186025770629b0e847c99fbfe47a573a045fbe1775cb15e0a75ed54c89b536a6bc7d5b1bfeb9bec9bfb6e090902
6
+ metadata.gz: dcbd6cf9861cfbfa95455a2f38ac26c9273ca5f46459602f87770295fff0b2c427d1343245e6204481765e71115449a5dbf8db3467b7edb256167d4443749b45
7
+ data.tar.gz: 874a8a647b8bc5e860b79793775ee9778a918dda189367efa9885c8e9948370a1f5a41f0aa4b082259a192d11fe2f3404a9192ccfc1da21f4626386d2a14bfe3
@@ -66,8 +66,8 @@ module Olivander
66
66
  reflections.map{ |x| x[1] }
67
67
  .filter{ |x| x.foreign_key == inc || x.name == inc }
68
68
  .each do |r|
69
- type = r.association_class.name.demodulize.underscore.to_sym
70
69
  begin
70
+ type = r.association_class.name.demodulize.underscore.to_sym
71
71
  resource_field(r.name, type, editable: editable && !uneditable_association?(r, type))
72
72
  rescue NotImplementedError
73
73
  resource_field(r.name, :association, editable: editable && !uneditable_association?(r, type))
@@ -48,7 +48,7 @@ module Olivander
48
48
 
49
49
  def confirmation_message
50
50
  return confirm_with if confirm_with.present?
51
- return I18n.t('activerecord.actions.delete-confirmation') if verb == :delete
51
+ return O18n.t('activerecord.actions.delete-confirmation') if verb == :delete
52
52
 
53
53
  nil
54
54
  end
@@ -21,7 +21,7 @@ module Olivander
21
21
 
22
22
  controller_key = controller.class.name.underscore
23
23
  key = "page_titles.#{controller_key}.#{action_name}"
24
- return I18n.t(key) if I18n.exists?(key)
24
+ return O18n.t(key) if I18n.exists?(key)
25
25
 
26
26
  return @page_title if @page_title
27
27
 
@@ -75,31 +75,31 @@ module Olivander
75
75
 
76
76
  def resource_form_action_tooltip(resource, action)
77
77
  key = resource.class.name.underscore
78
- return I18n.t("activerecord.actions.#{key}.#{action}-tooltip") if I18n.exists?("activerecord.actions.#{key}.#{action}-tooltip")
79
- return I18n.t("activerecord.actions.#{action}-tooltip") if I18n.exists?("activerecord.actions.#{action}-tooltip")
78
+ return O18n.t("activerecord.actions.#{key}.#{action}-tooltip") if I18n.exists?("activerecord.actions.#{key}.#{action}-tooltip")
79
+ return O18n.t("activerecord.actions.#{action}-tooltip") if I18n.exists?("activerecord.actions.#{action}-tooltip")
80
80
 
81
81
  action.to_s.titleize
82
82
  end
83
83
 
84
84
  def resource_form_action_label(resource, action)
85
85
  key = resource.class.name.underscore
86
- return I18n.t("activerecord.actions.#{key}.#{action}") if I18n.exists?("activerecord.actions.#{key}.#{action}")
87
- return I18n.t("activerecord.actions.#{action}") if I18n.exists?("activerecord.actions.#{action}")
86
+ return O18n.t("activerecord.actions.#{key}.#{action}") if I18n.exists?("activerecord.actions.#{key}.#{action}")
87
+ return O18n.t("activerecord.actions.#{action}") if I18n.exists?("activerecord.actions.#{action}")
88
88
 
89
89
  action.to_s.titleize
90
90
  end
91
91
 
92
92
  def resource_form_action_icon(resource, action)
93
93
  key = resource.class.name.underscore
94
- return I18n.t("activerecord.actions.#{key}.#{action}-icon") if I18n.exists?("activerecord.actions.#{key}.#{action}-icon")
95
- return I18n.t("activerecord.actions.#{action}-icon") if I18n.exists?("activerecord.actions.#{action}-icon")
94
+ return O18n.t("activerecord.actions.#{key}.#{action}-icon") if I18n.exists?("activerecord.actions.#{key}.#{action}-icon")
95
+ return O18n.t("activerecord.actions.#{action}-icon") if I18n.exists?("activerecord.actions.#{action}-icon")
96
96
 
97
97
  action.to_s.titleize
98
98
  end
99
99
 
100
100
  def resource_field_group_label(resource_class, key)
101
101
  i18n_key = "activerecord.attributes.#{resource_class.name.underscore}.resource_field_groups.#{key}"
102
- I18n.exists?(i18n_key) ? I18n.t(i18n_key) : key.to_s.titleize
102
+ I18n.exists?(i18n_key) ? O18n.t(i18n_key) : key.to_s.titleize
103
103
  end
104
104
 
105
105
  def current_user
@@ -128,7 +128,7 @@ module Olivander
128
128
  def field_label_for(resource_class, sym)
129
129
  sym_s = sym.to_s.gsub('.', '_')
130
130
  i18n_key = "activerecord.attributes.#{resource_class.name.underscore}.#{sym_s}"
131
- return I18n.t(i18n_key) if I18n.exists?(i18n_key)
131
+ return O18n.t(i18n_key) if I18n.exists?(i18n_key)
132
132
 
133
133
  sym.to_s.titleize
134
134
  end
@@ -12,6 +12,6 @@
12
12
  = render Olivander::Components::ResourceFormComponent.new(@resource, f)
13
13
  = render_optional_partial 'form_inside_after', locals: {f: f}
14
14
  .card-footer.text-right
15
- = link_to 'Cancel', @_effective_resource.action_path(:index), class: 'btn btn-secondary'
15
+ = link_to 'Cancel', @cancel_path || @_effective_resource.action_path(:index), class: 'btn btn-secondary'
16
16
  - unless read_only
17
17
  = f.button :submit, class: 'btn btn-primary'
@@ -77,9 +77,9 @@ module Olivander
77
77
  return nil unless raw
78
78
 
79
79
  if key && I18n.exists?(key)
80
- I18n.t(key)
80
+ O18n.t(key)
81
81
  elsif fallback && I18n.exists?(fallback)
82
- I18n.t(fallback)
82
+ O18n.t(fallback)
83
83
  else
84
84
  raw.titleize
85
85
  end
@@ -88,12 +88,12 @@ module Olivander
88
88
 
89
89
  class Badge
90
90
  attr_accessor :text, :badge_class
91
-
91
+
92
92
  def initialize(text = nil, badge_class = nil)
93
93
  @text = text
94
94
  @badge_class = badge_class
95
95
  end
96
-
96
+
97
97
  def with_proc
98
98
  yield(self)
99
99
  self
@@ -2,5 +2,5 @@
2
2
 
3
3
  # needed for gem
4
4
  module Olivander
5
- VERSION = '0.2.0.32'
5
+ VERSION = '0.2.0.33'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: five-two-nw-olivander
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0.32
4
+ version: 0.2.0.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Dennis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-19 00:00:00.000000000 Z
11
+ date: 2024-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chartkick