From 03d33e497dcbb6979a6cfca726df697b8bbb68fa Mon Sep 17 00:00:00 2001 From: Rodrigo Souto Date: Thu, 21 Mar 2013 23:09:02 +0000 Subject: [PATCH] Fixed test: comment.feature --- app/views/content_viewer/_comment_form.rhtml | 23 +++++++---------------- app/views/content_viewer/view_page.rhtml | 2 +- features/comment.feature | 53 ++++++++++++++++++++++++++++------------------------- features/step_definitions/web_steps.rb | 10 ++++++++++ public/javascripts/comment_form.js | 23 +++++++++++++++++++++++ public/stylesheets/application.css | 19 +++++++++++-------- 6 files changed, 80 insertions(+), 50 deletions(-) create mode 100644 public/javascripts/comment_form.js diff --git a/app/views/content_viewer/_comment_form.rhtml b/app/views/content_viewer/_comment_form.rhtml index c19a877..423d44e 100644 --- a/app/views/content_viewer/_comment_form.rhtml +++ b/app/views/content_viewer/_comment_form.rhtml @@ -21,8 +21,6 @@ function submit_comment_form(button) { } -<% focus_on = logged_in? ? 'title' : 'name' %> - <% if @comment && @comment.errors.any? && @comment.reply_of_id.blank? %> <%= error_messages_for :comment %> @@ -32,17 +30,7 @@ function submit_comment_form(button) {
-<% 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 %> <% unless 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 15023a4..20bafe8 100644 --- a/app/views/content_viewer/view_page.rhtml +++ b/app/views/content_viewer/view_page.rhtml @@ -90,7 +90,7 @@ <% end %> <% if @page.accept_comments? && @comments_count > 1 %> -

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

+ <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form') %> <% end %>