15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/writecast/views/post.rb', line 15
def render_content_inner
div(:id => 'meta') {p {text "last modified: #{@doc.time}"}}
div :id => 'summary' do
rawtext Kramdown::Document.new(@doc.summary, KRAMDOWN_OPTS).to_html
end
div :id => 'body' do
rawtext Kramdown::Document.new(@doc.body, KRAMDOWN_OPTS).to_html
end
div :id => 'tags' do
p do
text 'tagged: '
@doc.tags and @doc.tags.each do |tag|
a tag, :href => "/tags/#{CGI.escape(tag)}"
text ', ' if tag != @doc.tags.last
end
end
end
div :id => 'comments' do
p 'comments:'
p a 'show comment form', {:id => 'toggle_comment_form', :href => '#'}
div :id => 'comment_form_wrapper', :style => 'display:none;' do
form :id => 'comment_form', :action => "/comment", :method => "post" do
label :id => 'name' do
text 'name'
input :type => 'text', :name => 'name', :class => 'required'
end
label :id => 'first_name' do
text 'first name'
input :type => 'text', :name => 'first_name'
end
label :id => 'email' do
text 'email'
input :type => 'text', :name => 'email', :class => 'required'
end
input :type => 'hidden', :name => 'file_path', :value => @doc.raw_file_path
br
label :id => 'comment' do
text 'comment'
textarea :name => 'comment', :class => 'required'
end
br
input :id => 'reset', :type => "reset", :value => "clear form"
input :id => 'submit', :type => "submit", :value => "send comment"
end
end
end
end
|