yaks-html 0.8.3 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/yaks/format/html.rb +10 -2
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1f99d3f8ba5c761797f55ced896601d33321929
4
- data.tar.gz: f53fb62014f88bfb804bbd673b07610885bbcbc9
3
+ metadata.gz: ed93c7c669916c02044d83a3551c54ae5bfe3453
4
+ data.tar.gz: b65cb8b1b64bfb732fd7d7a64e7839035ed07a7f
5
5
  SHA512:
6
- metadata.gz: 5458ac0a14d6b99f81cf58ea80a5bd66e53b2701c42853582425816286708a4619080e9d059f0ff79ace396722ceb6e4dc1df0756d304541f40d3aa771e5bcdb
7
- data.tar.gz: 3edfe5607f489930f31d65039febb8382d734024d1986e72837caa9cf13f25fbed82ab8dbb9a6e64efa93d4f00e69232ae0d474fc048d4e8f8b9e79556c82e51
6
+ metadata.gz: 1f434db45836fa126ffb99da5416d98d43ffeb4448d32bf252a1c533336ab5872d0f48787f391df2c055597ab26e240c1b11c9584e50095c16bbb7651607d294
7
+ data.tar.gz: d29d68208ab4b5688cf34b6709ef9c7f228b4a8fde9885e76c6d393962ae78335e02cc7827326818a72514ae2ee3270f268e4426ecca0b2482fb2bc5d15d5e32
@@ -97,8 +97,11 @@ module Yaks
97
97
  form = form.attr('enctype', form_control.media_type) if form_control.media_type
98
98
 
99
99
  rows = form_control.fields.map(&method(:render_field))
100
+ rows << H[:tr, H[:td], H[:td, H[:input, {type: 'submit'}]]]
100
101
 
101
- form.content(H[:table, H[:h4, form_control.title || form_control.name.to_s], *rows, H[:tr, H[:td], H[:td, H[:input, {type: 'submit'}]]]])
102
+ H[:div,
103
+ H[:h4, form_control.title || form_control.name.to_s],
104
+ form.content(H[:table, rows])]
102
105
  end
103
106
 
104
107
  def render_field(field)
@@ -127,7 +130,12 @@ module Yaks
127
130
  end
128
131
 
129
132
  def render_fieldset(fieldset)
130
- H[:fieldset, fieldset.fields.map(&method(:render_field))]
133
+ legend = fieldset.fields.select {|field|field.type == :legend}.first
134
+ legend = legend ? legend.name : ''
135
+
136
+ H[:tr,
137
+ H[:th, legend],
138
+ H[:td, H[:fieldset, H[:table, fieldset.fields.map(&method(:render_field))]]]]
131
139
  end
132
140
 
133
141
  def render_select_options(options)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaks-html
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arne Brasseur
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-09 00:00:00.000000000 Z
11
+ date: 2015-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yaks
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.8.3
19
+ version: 0.9.0
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: 0.8.3
26
+ version: 0.9.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: hexp
29
29
  requirement: !ruby/object:Gem::Requirement