effective_bootstrap 1.15.0 → 1.15.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cfaf018bf0d9801faa459d991cc6831c09878bf7d7395c8eceeb247c2b8efb8
|
4
|
+
data.tar.gz: 7441f4d44bf47958d9a1bb85466750f2a55031436af91c34a53f9dc9a7328898
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acec024092be3e7a9ad139f88cac0651971bc3cde9e49857080b60cbfa10b3cd959be6e98002b8d103dea75b21382b4c67e644b9aadcfac0bacd078e55655dba
|
7
|
+
data.tar.gz: 2c0107069432b98107335a6827239e8b3ec61fc53ff3ae0d8f0e4ece573cc2e9af53bcc360d7281231466c6e7db82244abf567f54beceb45220521ab592fab27
|
@@ -117,6 +117,10 @@ module Effective
|
|
117
117
|
rows[name] = TableRow.new(name, options, builder: self).to_html
|
118
118
|
end
|
119
119
|
|
120
|
+
def article_editor(name, options = {})
|
121
|
+
rows[name] = TableRows::ArticleEditor.new(name, options, builder: self).to_html
|
122
|
+
end
|
123
|
+
|
120
124
|
def boolean_row(name, options = {})
|
121
125
|
rows[name] = TableRows::Boolean.new(name, options, builder: self).to_html
|
122
126
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Effective
|
4
|
+
module TableRows
|
5
|
+
class ArticleEditor < Effective::TableRow
|
6
|
+
|
7
|
+
def content
|
8
|
+
return unless value.present?
|
9
|
+
|
10
|
+
if value.start_with?('<') && value.end_with?('>')
|
11
|
+
value.html_safe
|
12
|
+
else
|
13
|
+
template.simple_format(value)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -13,11 +13,15 @@ module Effective
|
|
13
13
|
values = Array(value) - [nil, '']
|
14
14
|
|
15
15
|
if values.length > 1
|
16
|
-
values.map { |v| content_tag(:div, v) }.join.html_safe
|
16
|
+
values.map { |v| content_tag(:div, item_content(v)) }.join.html_safe
|
17
17
|
elsif values.length == 1
|
18
|
-
values.first
|
18
|
+
item_content(values.first)
|
19
19
|
end
|
20
|
+
end
|
20
21
|
|
22
|
+
def item_content(value)
|
23
|
+
item = @collection.find { |k, v| (k && k == value) || (v && v == value) || k.try(:id) == value }
|
24
|
+
(item || value).to_s
|
21
25
|
end
|
22
26
|
|
23
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.15.
|
4
|
+
version: 1.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -696,6 +696,7 @@ files:
|
|
696
696
|
- app/models/effective/form_logics/show_if_any.rb
|
697
697
|
- app/models/effective/table_builder.rb
|
698
698
|
- app/models/effective/table_row.rb
|
699
|
+
- app/models/effective/table_rows/article_editor.rb
|
699
700
|
- app/models/effective/table_rows/belongs_to.rb
|
700
701
|
- app/models/effective/table_rows/boolean.rb
|
701
702
|
- app/models/effective/table_rows/collection.rb
|