_comment_form.rhtml 1011 Bytes
<%
  comment_form_id = 'comment_form'+ rand(9999).to_s
%>
<div
  class="post_comment_box closed"
  onclick="f=$(<%= comment_form_id %>); f.style.display='block';
           this.className = this.className.replace(/closed/,'opened');
           f.commit.focus(); f['comment[title]'].focus()">

<h4><%= _('Post a comment') %></h4>

<% form_tag( {}, { :id => comment_form_id, :style => 'display:none' } ) do %>

  <% unless logged_in? %>

    <%= labelled_form_field(_('Name'), text_field(:comment, :name)) %>
    <%= labelled_form_field(_('e-mail'), text_field(:comment, :email)) %>

    <p>
    <%= _('If you are a registered user, you can login and be automatically recognized.') %>
    </p>

  <% end %>

  <%= labelled_form_field(_('Title'), text_field(:comment, :title)) %>
  <%= labelled_form_field(_('Enter your comment'), text_area(:comment, :body, :rows => 5)) %>
  <% button_bar do %>
    <%= submit_button('add', _('Post comment')) %>
  <% end %>
<% end %>

</div><!-- end class="post_comment_box" -->