yaks-html 0.7.6 → 0.7.7

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
  SHA1:
3
- metadata.gz: 718c073ef0b3f2faa79cac7c2e933d84e9cd3067
4
- data.tar.gz: fd16d091cb9d29110f73c3ce2e762bda340378e0
3
+ metadata.gz: 1777856e4e47dd9771ad5f0f3a6ee2bb0162053c
4
+ data.tar.gz: 18547188e16d518b7a604cca7e832efb71a9e84d
5
5
  SHA512:
6
- metadata.gz: 7307b19d51bdc38bf7f6ec84b830a4970027f721fbe1d431e0ac585c4c553a849edc0dd5ba7b58b9802f96ea6d0c95d80b20be0480805308104ea3b46afc8c14
7
- data.tar.gz: 38ba4bcfddee28418b43e3f0d690513bfe89f0203f9fee6365a420571a01141a348392cba222476118ccc7112afa1ff607f158a19507b8e37f8ca4e020d4cbe3
6
+ metadata.gz: 3cf0c777333ff5cc8c42c1dea270e11406e224725ca5fffdc3d0142b141d64fde9973c2a4f681fd1dad00da09b912c052b0690eade3ff80d4dda3034a615870a
7
+ data.tar.gz: 141708ec6e2bcee9cfee23495d0300ac63c74a7b995f5c0f55413fb192f09c96252ddecc02297f1f3cdb0c7ad63cad9a49f104c221f01679a5cddb835243d61c
@@ -27,7 +27,7 @@ module Yaks
27
27
  .replace('.type') { |header| header.content(resource.type.to_s + (resource.collection? ? ' collection' : '')) }
28
28
  .replace('.attribute', &render_attributes(resource.attributes))
29
29
  .replace('.links') {|links| resource.links.empty? ? [] : links.replace('.link', &render_links(resource.links)) }
30
- .replace('.controls') {|div| render_controls(resource.controls).call(div) }
30
+ .replace('.forms') {|div| render_forms(resource.forms).call(div) }
31
31
  .replace('.subresource') {|sub_templ| render_subresources(resource, templ, sub_templ) }
32
32
  end
33
33
 
@@ -70,22 +70,22 @@ module Yaks
70
70
  end
71
71
 
72
72
 
73
- def render_controls(controls)
73
+ def render_forms(forms)
74
74
  ->(div) do
75
75
  div.content(
76
- controls.map(&method(:render_control))
76
+ forms.map(&method(:render_form))
77
77
  )
78
78
  end
79
79
  end
80
80
 
81
- def render_control(control)
81
+ def render_form(form_control)
82
82
  form = H[:form]
83
- form = form.attr('name', control.name) if control.name
84
- form = form.attr('method', control.method) if control.method
85
- form = form.attr('action', control.action) if control.action
86
- form = form.attr('enctype', control.media_type) if control.media_type
83
+ form = form.attr('name', form_control.name) if form_control.name
84
+ form = form.attr('method', form_control.method) if form_control.method
85
+ form = form.attr('action', form_control.action) if form_control.action
86
+ form = form.attr('enctype', form_control.media_type) if form_control.media_type
87
87
 
88
- rows = control.fields.map do |field|
88
+ rows = form_control.fields.map do |field|
89
89
  H[:tr,
90
90
  H[:td, H[:label, {for: field.name}, field.label || '']],
91
91
  H[:td, case field.type
@@ -96,7 +96,7 @@ module Yaks
96
96
  end]
97
97
  ]
98
98
  end
99
- form.content(H[:table, control.title || '', *rows, H[:tr, H[:td, H[:input, {type: 'submit'}]]]])
99
+ form.content(H[:table, form_control.title || '', *rows, H[:tr, H[:td, H[:input, {type: 'submit'}]]]])
100
100
  end
101
101
  end
102
102
  end
@@ -71,7 +71,7 @@
71
71
  <div class="value"></div>
72
72
  </div>
73
73
 
74
- <div class="controls"></div>
74
+ <div class="forms"></div>
75
75
  </div>
76
76
 
77
77
 
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.7.6
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arne Brasseur
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-18 00:00:00.000000000 Z
11
+ date: 2014-12-02 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.7.6
19
+ version: 0.7.7
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.7.6
26
+ version: 0.7.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: hexp
29
29
  requirement: !ruby/object:Gem::Requirement