biola_wcms_components 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/components/forms/presentation_data_editor.js.coffee +1 -1
- data/app/assets/stylesheets/components/forms/_presentation_data_editor.scss +5 -0
- data/lib/biola_wcms_components/version.rb +1 -1
- data/lib/components/presentation_data_editor.rb +35 -0
- 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: 15c3fcc2fbe8a94ac07b1a262c7bdd991774dfcd
|
4
|
+
data.tar.gz: 36947f8497653fa1e1846a81c2792005f85ee32e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb5a57ce8c2de76f6cce19eaf540ef3d45a331177f9f8de11429d7aecebdfa0a3bf853a7a983b6a305022eeebc873a66aef54b9ee3f7ea9d2eeac51c4551a0d5
|
7
|
+
data.tar.gz: 80d6a1c9a1c446b3a660d7561b40f597d7a984bbd246d3867ca5000879180ec9883fd8554411c7444822619c255d1d1739b7bcce5243076087367b205e6cda61
|
@@ -7,7 +7,7 @@ $(document).ready ->
|
|
7
7
|
|
8
8
|
# Delete an array item when you click the delete button
|
9
9
|
$('.array_wrapper').on 'click', '.delete_array_item', ->
|
10
|
-
$(this).parents('.array_item').remove()
|
10
|
+
$(this).parents('.array_item').first().remove()
|
11
11
|
false
|
12
12
|
|
13
13
|
# Add an new array item from the last array_item
|
@@ -44,6 +44,10 @@ class PresentationDataEditor
|
|
44
44
|
build_image_uploader(attribute, parent_keys)
|
45
45
|
when 'html'
|
46
46
|
build_html(attribute, parent_keys)
|
47
|
+
when 'checkbox'
|
48
|
+
build_check_box(attribute, parent_keys)
|
49
|
+
when 'number'
|
50
|
+
build_number(attribute, parent_keys)
|
47
51
|
end
|
48
52
|
end
|
49
53
|
|
@@ -109,6 +113,37 @@ class PresentationDataEditor
|
|
109
113
|
end
|
110
114
|
end
|
111
115
|
|
116
|
+
def build_check_box(attribute, parent_keys)
|
117
|
+
view.content_tag :div, class: 'form-group' do
|
118
|
+
view.label_tag(attribute[:name]) +
|
119
|
+
view.check_box_tag(
|
120
|
+
form_name(parent_keys, attribute[:name]), # name
|
121
|
+
1, # value
|
122
|
+
data_grab(parent_keys, attribute[:name]).to_i == 1,# checked or not
|
123
|
+
{ # options
|
124
|
+
class: "form-control #{attribute[:class]}",
|
125
|
+
id: attribute_id(parent_keys, attribute[:name]),
|
126
|
+
placeholder: attribute[:placeholder]
|
127
|
+
}
|
128
|
+
)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
def build_number(attribute, parent_keys)
|
133
|
+
view.content_tag :div, class: 'form-group' do
|
134
|
+
view.label_tag(attribute[:name]) +
|
135
|
+
view.number_field_tag(
|
136
|
+
form_name(parent_keys, attribute[:name]),
|
137
|
+
data_grab(parent_keys, attribute[:name]),
|
138
|
+
{
|
139
|
+
class: "form-control #{attribute[:class]}",
|
140
|
+
id: attribute_id(parent_keys, attribute[:name]),
|
141
|
+
placeholder: attribute[:placeholder]
|
142
|
+
}
|
143
|
+
)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
112
147
|
def build_image_uploader(attribute, parent_keys)
|
113
148
|
view.content_tag :div, class: 'form-group type-image-uploader' do
|
114
149
|
view.label_tag(attribute[:name]) +
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: biola_wcms_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Hall
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ace-rails-ap
|