formnestic 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -15,7 +15,7 @@ An extension of famous [Formtastic Form Builder](https://github.com/justinfrench
15
15
  Add Formnestic to your Gemfile and run ``bundle install``:
16
16
 
17
17
  ```ruby
18
- gem "formnestic", '~> 1.0.0'
18
+ gem "formnestic", '~> 1.0.1'
19
19
  ```
20
20
 
21
21
  then run the installation
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -97,20 +97,30 @@ table.formnestic-table-inputs tbody tr.inputs {
97
97
  p.inline-hints {
98
98
  margin-left: 0;
99
99
  }
100
+
101
+ ol.choices-group {
102
+ padding-left: 0;
103
+ }
100
104
  }
101
105
  &.formnestic-odd-row td {
102
106
  background: #eee;
103
107
  }
104
108
 
105
109
  &.formnestic-even-row td {
106
- }
110
+ }
107
111
  }
108
112
 
109
- table.formnestic-table-inputs td.date_select ol.fragments-group {
113
+ table.formnestic-table-inputs td.date_select ol.fragments-group,
114
+ table.formnestic-table-inputs td.time_select ol.fragments-group,
115
+ table.formnestic-table-inputs td.datetime ol.fragments-group,
116
+ table.formnestic-table-inputs td.datetime_select ol.fragments-group,
117
+ table.formnestic-table-inputs td.date ol.fragments-group,
118
+ table.formnestic-table-inputs td.time ol.fragments-group {
110
119
  list-style-type: none;
120
+ padding-left: 0;
111
121
  }
112
122
 
113
- table.formnestic-table-inputs td.date_select ol.fragments-group li.fragment {
123
+ table.formnestic-table-inputs td.date_select ol.fragments-group li.fragment, table.formnestic-table-inputs td.date ol.fragments-group li.fragment {
114
124
  float: left;
115
125
  margin-right: 5px;
116
126
  }
data/formnestic.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "formnestic"
8
- s.version = "1.0.0"
8
+ s.version = "1.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["James"]
@@ -4,9 +4,7 @@ module Formnestic
4
4
  module Wrapping
5
5
  def input_wrapping(&block)
6
6
  if self.builder.options[:display_type] == "table"
7
- if self.instance_of?(Formtastic::Inputs::SelectInput)
8
- select_input_wrapping(&block)
9
- elsif [
7
+ if [
10
8
  "Formtastic::Inputs::DateSelectInput",
11
9
  "Formtastic::Inputs::TimeSelectInput",
12
10
  "Formtastic::Inputs::DateTimeSelectInput",
@@ -37,14 +35,6 @@ module Formnestic
37
35
  [template.capture(&block), error_html, hint_html].join("\n").html_safe,
38
36
  wrapper_html_options
39
37
  )
40
- end
41
-
42
- def select_input_wrapping(&block)
43
- self.builder.options[:parent_builder].add_table_header(self.attributized_method_name, self.class, label_text)
44
- template.content_tag(:td,
45
- [template.capture(&block), error_html, hint_html, extra_input_for_other_in_select].join("\n").html_safe,
46
- wrapper_html_options
47
- )
48
38
  end
49
39
  end
50
40
  end
@@ -274,4 +274,26 @@ describe 'Formnestic Table Form' do
274
274
  output_buffer.should have_tag('form table.formnestic-table-inputs thead tr th', /^Post date/)
275
275
  end
276
276
  end
277
+
278
+ describe 'table formnestic with table header with select input specified' do
279
+ before do
280
+ @output_buffer = ''
281
+ mock_everything
282
+
283
+ concat(semantic_form_for(@alan) do |builder|
284
+ concat(builder.semantic_fields_for(:posts, :display_type => "table", row_removable: true, row_addable: true, new_record_link_label: "Add new option", table_headers: [
285
+ [{label: "All my columns", :wrapper_html => {colspan: 3}}],
286
+ [{attr: :title}, {attr: :body}, {attr: :post_date}]
287
+ ]) do |post_builder|
288
+ concat(post_builder.inputs do
289
+ concat(post_builder.input :title, as: :select, collection: ["a", "b", "c"])
290
+ end)
291
+ end)
292
+ end)
293
+ end
294
+
295
+ it 'should have a 5 td tags - 2 columns for each of the 2 entries and another td for add new options link' do
296
+ output_buffer.should have_tag('form table.formnestic-table-inputs tbody tr td', :count => 5)
297
+ end
298
+ end
277
299
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formnestic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -255,7 +255,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
255
255
  version: '0'
256
256
  segments:
257
257
  - 0
258
- hash: -633784834194201470
258
+ hash: 3747089579446336106
259
259
  required_rubygems_version: !ruby/object:Gem::Requirement
260
260
  none: false
261
261
  requirements: