<% if RailsConnector::Configuration.enabled?(:comments) and @obj.allow_comments? -%>
<%=t :"rails_connector.views.cms.comments.title" %> <% if @obj.allow_anonymous_comments? or (not @obj.allow_anonymous_comments? and logged_in?) -%>
<%= form_for(@comment, :as => :comment, :url => {:controller => "comments", :action => "create", :obj_id => @obj}, :html => {:id => "comment_form"}) do |f| %>
<%= content_tag :legend, t(:"rails_connector.views.cms.comments.add_comment") %> <% unless logged_in? -%> <%= f.label :name, t(:"rails_connector.views.cms.comments.name"), :id => 'comment_form_name_label' %> <%= f.text_field :name %>
<%= f.label :email, t(:"rails_connector.views.cms.comments.email"), :id => 'comment_form_email_label' %> <%= f.text_field :email %>
<% end -%> <%= f.label :subject, t(:"rails_connector.views.cms.comments.subject"), :id => 'comment_form_subject_label' %> <%= f.text_field :subject, :size => 40 %>
<%= f.label :body, t(:"rails_connector.views.cms.comments.body"), :id => 'comment_form_body_label' %> <%= f.text_area :body, :rows => 5, :cols => 50 %>
<%= submit_tag(t(:"rails_connector.views.cms.comments.submit"), :class => 'submit', :name => 'submit') %>
<% end %>
<% else -%>
<%=t :"rails_connector.views.cms.comments.login_required" %>
<% end -%>
<% if @obj.comments.empty? -%> <%=t :"rails_connector.views.cms.comments.no_comments" %> <% else -%> <%= render(:partial => 'comments/comment', :collection => @obj.comments, :as => :comment) %> <% end -%>
<% end -%>