hydra-editor 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/inputs/multi_value_input.rb +24 -13
- data/lib/hydra_editor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07b3e61fba7144fb5d24d64cdc241ab1c5e09f5a
|
4
|
+
data.tar.gz: 046d6ccb60e056267ed1e09c29b74999715f2ccf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 712434962668b46f9b6b4dbbc5df09e2acf60b02e4f43b06218a0df30d5891a3046ef938f8ab039c96f1d12da5cc1a072a641f1614308bcecc7fb93bd4154acf
|
7
|
+
data.tar.gz: 3875cf1521283e6358fa89d400876665a931f719ce08ea8c0a54b24eebcd41acd4c6ad7720b7545865b9aa85eaa91403af9d365943e1437a0f772792598dd7a7
|
@@ -3,25 +3,36 @@ class MultiValueInput < SimpleForm::Inputs::CollectionInput
|
|
3
3
|
@rendered_first_element = false
|
4
4
|
input_html_classes.unshift("string")
|
5
5
|
input_html_options[:name] ||= "#{object_name}[#{attribute_name}][]"
|
6
|
-
markup = <<-HTML
|
7
6
|
|
7
|
+
outer_wrapper do
|
8
|
+
buffer_each(collection) do |value, index|
|
9
|
+
inner_wrapper do
|
10
|
+
build_field(value, index)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
protected
|
8
17
|
|
9
|
-
|
10
|
-
|
18
|
+
def buffer_each(collection)
|
19
|
+
collection.each_with_object('').with_index do |(value, buffer), index|
|
20
|
+
buffer << yield(value, index)
|
21
|
+
end
|
22
|
+
end
|
11
23
|
|
12
|
-
|
13
|
-
|
14
|
-
<li class="field-wrapper">
|
15
|
-
#{build_field(value, index)}
|
16
|
-
</li>
|
17
|
-
HTML
|
24
|
+
def outer_wrapper
|
25
|
+
" <ul class=\"listing\">\n #{yield}\n </ul>\n"
|
18
26
|
end
|
19
27
|
|
20
|
-
markup << <<-HTML
|
21
|
-
</ul>
|
22
28
|
|
23
|
-
|
24
|
-
|
29
|
+
def inner_wrapper
|
30
|
+
<<-HTML
|
31
|
+
<li class="field-wrapper">
|
32
|
+
#{yield}
|
33
|
+
</li>
|
34
|
+
HTML
|
35
|
+
end
|
25
36
|
|
26
37
|
private
|
27
38
|
|
data/lib/hydra_editor/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-editor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-04-
|
12
|
+
date: 2015-04-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|