修訂 | 108 (tree) |
---|---|
時間 | 2008-09-05 21:42:52 |
作者 | junkikuchi |
updated.
@@ -12,11 +12,11 @@ | ||
12 | 12 | css |
13 | 13 | |
14 | 14 | def render_html(head, body) |
15 | - body.tag('div', html_attr) do |div| | |
16 | - @preview = true | |
17 | - resource.resource.content.preview(@service, [], head, div) | |
18 | - div.text('') if div.empty? | |
19 | - end unless @preview | |
15 | + #body.tag('div', html_attr) do |div| | |
16 | + # @preview = true | |
17 | + # resource.resource.content.preview(@service, [], head, div) | |
18 | + # div.text('') if div.empty? | |
19 | + #end unless @preview | |
20 | 20 | end |
21 | 21 | end |
22 | 22 | end |
@@ -12,40 +12,33 @@ | ||
12 | 12 | css |
13 | 13 | |
14 | 14 | def render_property_form(xml, widget) |
15 | - widget.property.each do |ppt| | |
16 | - xml.tag('h3').text(ppt.name) | |
17 | - ppt.each do |group| | |
18 | - xml.tag( | |
19 | - 'form', | |
20 | - 'method' => 'post', | |
21 | - 'action' => uri( | |
22 | - @builder.view, | |
23 | - resource.content.id | |
24 | - ) do |query| | |
25 | - query[form_id('update')] = nil | |
26 | - end | |
27 | - ) do |form| | |
28 | - form.tag('h4').text(group.name) | |
29 | - form.tag('dl') do |dl| | |
30 | - group.each do |item| | |
31 | - _id = form_id(item.path_name) | |
32 | - dl.tag('dt').tag('label', 'for' => _id).text(item.name) | |
33 | - dl.tag('dd').tag( | |
34 | - 'input', | |
35 | - 'type' => 'text', | |
36 | - 'id' => _id, | |
37 | - 'name' => _id, | |
38 | - 'value' => item.value | |
39 | - ) | |
40 | - end | |
41 | - dl.tag('dt').tag('br') | |
15 | + xml.tag( | |
16 | + 'form', | |
17 | + 'method' => 'post', | |
18 | + 'action' => uri( | |
19 | + @builder.view, | |
20 | + resource.content.id | |
21 | + ) do |query| | |
22 | + query[form_id('update')] = nil | |
23 | + end | |
24 | + ) do |form| | |
25 | + form.tag('dl') do |dl| | |
26 | + widget.property.each do |key, val| | |
27 | + dl.tag('dt').tag('label', 'for' => key.to_s).text(key) | |
42 | 28 | dl.tag('dd').tag( |
43 | 29 | 'input', |
44 | - 'type' => 'submit', | |
45 | - 'value' => 'update' | |
30 | + 'type' => 'text', | |
31 | + 'id' => key.to_s, | |
32 | + 'name' => key.to_s, | |
33 | + 'value' => val | |
46 | 34 | ) |
47 | - end | |
48 | 35 | end |
36 | + dl.tag('dt').tag('br') | |
37 | + dl.tag('dd').tag( | |
38 | + 'input', | |
39 | + 'type' => 'submit', | |
40 | + 'value' => 'update' | |
41 | + ) | |
49 | 42 | end |
50 | 43 | end |
51 | 44 | end |
@@ -59,7 +52,7 @@ | ||
59 | 52 | |
60 | 53 | def post(query={}) |
61 | 54 | query.each do |key, val| |
62 | - resource.content.property.find(key).value = if val.empty? | |
55 | + resource.content.property[key.to_sym] = if val.empty? | |
63 | 56 | nil |
64 | 57 | else |
65 | 58 | val |
@@ -54,7 +54,7 @@ | ||
54 | 54 | |
55 | 55 | def render_html(head, body) |
56 | 56 | body.tag('div', html_attr) do |div| |
57 | - render_css_form(div, resource.content) | |
57 | + #render_css_form(div, resource.content) | |
58 | 58 | div.text('') if div.empty? |
59 | 59 | end |
60 | 60 | end |