rao-component 0.0.47.pre → 0.0.48.pre
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f4ac5d5ed82bac75905e6823feb4739e79342826e41db0fe703b8289edd8ab1
|
4
|
+
data.tar.gz: c14f34f46df0809f913f87f192fbd297e1a0e9e1ae336b4dcdca18f9aa3b0645
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fbd5608daee90d8fc4ed7c7b9a7e95baccffa4460b5b1bba4d84b78a5879223f575005c46a52fd03e3d15228afc98d46a388b52d01ef1c00a1d6ff7fe726598
|
7
|
+
data.tar.gz: 7e3e83a2c6bf33b1b054c62684bad5d86067d7228e38c1e0bfd815bbfd8456f81e97aa20c42ff9b73286354b0e4919ea4dddec0223ec5c933e866f62276535f6
|
@@ -38,6 +38,10 @@ module Rao
|
|
38
38
|
@resource_class = @options.delete(:resource_class) || @collection.first.class
|
39
39
|
end
|
40
40
|
|
41
|
+
def tr_html=(value)
|
42
|
+
@tr_html = value
|
43
|
+
end
|
44
|
+
|
41
45
|
def column(name, options = {}, &block)
|
42
46
|
options.reverse_merge!(render_as: :default)
|
43
47
|
options.reverse_merge!(block: block) if block_given?
|
@@ -79,7 +83,8 @@ module Rao
|
|
79
83
|
collection: @collection,
|
80
84
|
resource_class: @resource_class,
|
81
85
|
table_css_classes: table_css_classes,
|
82
|
-
show_header: show_header
|
86
|
+
show_header: show_header,
|
87
|
+
tr_html: @tr_html || {}
|
83
88
|
}
|
84
89
|
end
|
85
90
|
|
@@ -124,7 +129,7 @@ module Rao
|
|
124
129
|
end
|
125
130
|
|
126
131
|
def t(key, options = {})
|
127
|
-
I18n.t("#{self.class.name.underscore.gsub('/', '.')}#{key}", options)
|
132
|
+
I18n.t("#{self.class.name.underscore.gsub('/', '.')}#{key}", **options)
|
128
133
|
end
|
129
134
|
end
|
130
135
|
end
|
@@ -12,19 +12,24 @@
|
|
12
12
|
- elsif title === false
|
13
13
|
- title = nil
|
14
14
|
- if options.has_key?(:sort)
|
15
|
-
%
|
15
|
+
%th= sort_link(name, title, options[:sort])
|
16
16
|
- else
|
17
|
-
%
|
17
|
+
%th= title
|
18
18
|
%tbody
|
19
|
-
- collection.
|
19
|
+
- collection.each_with_index do |resource, index|
|
20
20
|
- tr_options = { class: resource_class.name.underscore.gsub('/', '-') }
|
21
21
|
- if resource.respond_to?(:model_name)
|
22
22
|
- tr_options[:id] = dom_id(resource)
|
23
23
|
- else
|
24
24
|
- tr_options[:id] = "#{resource.class.name.underscore.gsub('/', '-')}-#{resource.object_id}"
|
25
|
-
|
25
|
+
|
26
|
+
%tr{ tr_options.merge(tr_html.respond_to?(:call) ? (tr_html.call(resource, index) || {}) : (tr_html || {})) }
|
26
27
|
- columns.each do |name, options|
|
27
|
-
-
|
28
|
+
- td_html = if options[:td_html].respond_to?(:call)
|
29
|
+
- options[:td_html].call(resource) || {}
|
30
|
+
- else
|
31
|
+
- options[:td_html] || {}
|
32
|
+
- td_options = { class: ["attribute-#{name}", td_html.delete(:class)].compact.join(" "), id: "#{tr_options[:id]}-#{name}" }.merge(td_html)
|
28
33
|
- if options[:block].present?
|
29
34
|
%td{ td_options }= options[:block].call(resource)
|
30
35
|
- else
|
data/config/locales/de.yml
CHANGED
data/config/locales/en.yml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rao-component
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.48.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '6.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rao
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: '1.4'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: '1.4'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec-rails
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -211,7 +211,6 @@ files:
|
|
211
211
|
- app/views/rao/component/table/body_cells/_default.html.haml
|
212
212
|
- app/views/rao/component/table/body_cells/_email.html.haml
|
213
213
|
- app/views/rao/component/table/body_cells/_thumbnail.html.haml
|
214
|
-
- app/views/rao/component/table/body_cells/_thumbnail.html.haml~
|
215
214
|
- app/views/rao/component/table/body_cells/_timestamp.html.haml
|
216
215
|
- app/views/rao/component/table/header_cells/_batch_actions.html.haml
|
217
216
|
- config/initializers/assets.rb
|
@@ -236,14 +235,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
236
235
|
requirements:
|
237
236
|
- - ">="
|
238
237
|
- !ruby/object:Gem::Version
|
239
|
-
version:
|
238
|
+
version: 2.6.0
|
240
239
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
241
240
|
requirements:
|
242
241
|
- - ">"
|
243
242
|
- !ruby/object:Gem::Version
|
244
243
|
version: 1.3.1
|
245
244
|
requirements: []
|
246
|
-
rubygems_version: 3.
|
245
|
+
rubygems_version: 3.2.24
|
247
246
|
signing_key:
|
248
247
|
specification_version: 4
|
249
248
|
summary: View Components for Ruby on Rails.
|
@@ -1,6 +0,0 @@
|
|
1
|
-
- if resource.send(name).present? && resource.send(name).respond_to?(:variant)
|
2
|
-
- begin
|
3
|
-
- image_html = options[:image_html] || { src: main_app.url_for(resource.send(name).variant(options[:variant_options])) }
|
4
|
-
- rescue ActiveStorage::InvariableError => e
|
5
|
-
- image_html = { src: main_app.url_for(resource.send(name)) }
|
6
|
-
%img{ image_html }
|