From 1ed7d9c38fa74dbb38c61eedc1fcd6b00a1b3a4f Mon Sep 17 00:00:00 2001 From: vfcosta Date: Fri, 28 Jun 2013 09:11:14 -0300 Subject: [PATCH] fixing creation of comment --- app/views/comment/_comment_form.rhtml | 18 ++++++------------ app/views/content_viewer/view_page.rhtml | 2 +- public/javascripts/application.js | 63 --------------------------------------------------------------- public/javascripts/comment_form.js | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 4 files changed, 75 insertions(+), 82 deletions(-) diff --git a/app/views/comment/_comment_form.rhtml b/app/views/comment/_comment_form.rhtml index 96bb539..a9413ca 100644 --- a/app/views/comment/_comment_form.rhtml +++ b/app/views/comment/_comment_form.rhtml @@ -5,17 +5,7 @@
-<% if display_link %> -

- <%= content_tag('a', '', :name => 'comment_form') + _('Post a comment') %> -

-<% end %> +<%= link_to(_('Post a comment'), '#', :class => 'display-comment-form') if display_link %> <% if !edition_mode && !pass_without_comment_captcha? %>
+ +<%= javascript_include_tag 'comment_form'%> diff --git a/app/views/content_viewer/view_page.rhtml b/app/views/content_viewer/view_page.rhtml index 648203f..f7621cb 100644 --- a/app/views/content_viewer/view_page.rhtml +++ b/app/views/content_viewer/view_page.rhtml @@ -95,7 +95,7 @@ <% end %> <% if @page.accept_comments? && @comments_count > 1 %> - <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form', :id => 'top-post-comment-button') %> + <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form', :id => 'top-post-comment-button', :onclick => "jQuery('#page-comment-form .display-comment-form').first().click();") %> <% end %>