From 435ea536687a88f5ffa765947eb23b3dc70eca4d Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 9 Dec 2011 15:41:02 +0100 Subject: [PATCH] Rename some Ruby methods of Review.rb in order to respect convention namings --- .../app/controllers/api/reviews_controller.rb | 8 +- .../app/controllers/reviews_controller.rb | 55 ++-- .../main/webapp/WEB-INF/app/models/review.rb | 8 +- .../app/views/resource/_violation.html.erb | 209 +++++++------- .../app/views/reviews/_review.html.erb | 255 +++++++++--------- 5 files changed, 268 insertions(+), 267 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/reviews_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/reviews_controller.rb index 0d090f58905..9aa8e7100e4 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/reviews_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/reviews_controller.rb @@ -155,7 +155,7 @@ class Api::ReviewsController < Api::ApiController review = get_review(params[:id]) review.transaction do comment = params[:comment] || request.raw_post - if review.isClosed? + if review.closed? raise "Closed review can not be commented." end raise "Comment must be provided." unless comment && !comment.blank? @@ -187,7 +187,7 @@ class Api::ReviewsController < Api::ApiController review = get_review(params[:id]) review.transaction do assignee = params[:assignee] - if !review.isOpen? && !review.isReopened? + if !review.open? && !review.reopened? raise "Only open review can be reassigned." end if assignee.blank? @@ -227,7 +227,7 @@ class Api::ReviewsController < Api::ApiController review.transaction do resolution = params[:resolution] comment = params[:comment] || request.raw_post - if !review.isOpen? && !review.isReopened? + if !review.open? && !review.reopened? raise "Only open review can be resolved." end if resolution == Review::RESOLUTION_FALSE_POSITIVE @@ -266,7 +266,7 @@ class Api::ReviewsController < Api::ApiController review = get_review(params[:id]) review.transaction do comment = params[:comment] || request.raw_post - if !review.isResolved? + if !review.resolved? raise "Only resolved review can be reopened." end if review.resolution == Review::RESOLUTION_FALSE_POSITIVE diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb index 8631455ae96..189903eff56 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb @@ -22,9 +22,9 @@ class ReviewsController < ApplicationController SECTION=Navigation::SECTION_HOME - verify :method => :post, + verify :method => :post, :only => [:assign, :flag_as_false_positive, :save_comment, :delete_comment, :change_status, - :violation_assign, :violation_flag_as_false_positive,:violation_save_comment, :violation_delete_comment, :violation_change_status], + :violation_assign, :violation_flag_as_false_positive, :violation_save_comment, :violation_delete_comment, :violation_change_status], :redirect_to => {:action => :error_not_post} helper SourceHelper, UsersHelper @@ -32,7 +32,7 @@ class ReviewsController < ApplicationController init_params() search_reviews() end - + # Used for the permalink, e.g. http://localhost:9000/reviews/view/1 def view @review = Review.find(params[:id], :include => ['project']) @@ -133,7 +133,7 @@ class ReviewsController < ApplicationController render :text => "Cannot delete the comment : access denied." return end - + if @review @review.delete_comment(current_user, params[:comment_id].to_i) end @@ -148,7 +148,7 @@ class ReviewsController < ApplicationController return end - if @review.isResolved? + if @review.resolved? @review.reopen(current_user) else # for the moment, if a review is not open, it can only be "RESOLVED" @@ -168,7 +168,7 @@ class ReviewsController < ApplicationController # GET def display_violation violation = RuleFailure.find(params[:id]) - render :partial => "resource/violation", :locals => { :violation => violation } + render :partial => "resource/violation", :locals => {:violation => violation} end # GET @@ -190,7 +190,7 @@ class ReviewsController < ApplicationController violation.review.reassign(current_user, assignee) violation.save - render :partial => "resource/violation", :locals => { :violation => violation } + render :partial => "resource/violation", :locals => {:violation => violation} end # GET @@ -206,7 +206,7 @@ class ReviewsController < ApplicationController return end sanitize_violation(violation) - + unless params[:comment].blank? if violation.review.nil? violation.build_review(:user_id => current_user.id) @@ -216,7 +216,7 @@ class ReviewsController < ApplicationController violation=RuleFailure.find(params[:id]) end - render :partial => "resource/violation", :locals => { :violation => violation } + render :partial => "resource/violation", :locals => {:violation => violation} end # GET @@ -240,8 +240,8 @@ class ReviewsController < ApplicationController unless violation.review assignee = findUserByLogin(params[:assignee_login]) unless params[:assignee_login].blank? violation.create_review!( - :assignee => assignee, - :user => current_user) + :assignee => assignee, + :user => current_user) end unless params[:text].blank? @@ -252,7 +252,7 @@ class ReviewsController < ApplicationController end end - render :partial => "resource/violation", :locals => { :violation => violation } + render :partial => "resource/violation", :locals => {:violation => violation} end # POST @@ -266,9 +266,9 @@ class ReviewsController < ApplicationController if violation.review violation.review.delete_comment(current_user, params[:comment_id].to_i) end - render :partial => "resource/violation", :locals => { :violation => violation } + render :partial => "resource/violation", :locals => {:violation => violation} end - + # POST def violation_change_status violation = RuleFailure.find(params[:id], :include => 'snapshot') @@ -277,18 +277,18 @@ class ReviewsController < ApplicationController return end sanitize_violation(violation) - + if violation.review review = violation.review - if review.isResolved? + if review.resolved? review.reopen(current_user) else # for the moment, if a review is not open, it can only be "RESOLVED" review.resolve(current_user) end - end + end - render :partial => "resource/violation", :locals => { :violation => violation } + render :partial => "resource/violation", :locals => {:violation => violation} end @@ -297,7 +297,7 @@ class ReviewsController < ApplicationController # ACTIONS FROM THE REVIEW WIDGETS # # - + # GET def widget_reviews_list @snapshot = Snapshot.find(params[:snapshot_id]) @@ -305,20 +305,19 @@ class ReviewsController < ApplicationController render :text => "Cannot access the reviews of this project: access denied." return end - + @dashboard_configuration=Api::DashboardConfiguration.new(nil, :period_index => params[:period], :snapshot => @snapshot) render :partial => 'project/widgets/reviews/reviews_list' end - ## -------------- PRIVATE -------------- ## private - + def findUserByLogin(login) - User.find(:all, :conditions => [ "login = ?", login ]).first + User.find(:all, :conditions => ["login = ?", login]).first end - + def init_params default_user = (current_user ? current_user.login : '') @assignee_login = params[:assignee_login] || default_user @@ -367,7 +366,7 @@ class ReviewsController < ApplicationController if @to options['to']=@to end - unless @id == '' + unless @id == '' if is_number? @id options['id'] = @id else @@ -376,13 +375,13 @@ class ReviewsController < ApplicationController end options['sort'] = @sort unless @sort.blank? options['asc'] = @asc - + found_reviews = Review.search(options) @reviews = select_authorized(:user, found_reviews, :project) if found_reviews.size != @reviews.size @security_exclusions = true end - + # table pagination @page_size = 20 @page_size = params[:page_size].to_i if is_number?(params[:page_size]) && params[:page_size].to_i > 5 @@ -401,7 +400,7 @@ class ReviewsController < ApplicationController def is_number?(s) true if Float(s) rescue false end - + def has_rights_to_modify?(object) current_user && has_role?(:user, object) end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb index ce5e94d0176..a222fb837d9 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb @@ -184,19 +184,19 @@ class Review < ActiveRecord::Base (status == STATUS_RESOLVED && resolution == RESOLUTION_FALSE_POSITIVE) || status == STATUS_OPEN || status == STATUS_REOPENED end - def isResolved? + def resolved? status == STATUS_RESOLVED end - def isClosed? + def closed? status == STATUS_CLOSED end - def isReopened? + def reopened? status == STATUS_REOPENED end - def isOpen? + def open? status == STATUS_OPEN end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb index 9d3c1ff5cc5..9b59550f798 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb @@ -1,141 +1,142 @@
-
-
- <% if violation.review %> - - <% end %> - - <%= image_tag("priority/" + violation.failure_level.to_s + '.png') -%> -   - -   - > - <%= h(violation.rule.name) -%> - -   - -   - <% if violation.created_at %> - <%= distance_of_time_in_words_to_now(violation.created_at) -%> -   - <% end %> - <% if violation.switched_off? %> - -   - <%= message('false_positive') -%> +
+
+ <% if violation.review %> + + <% end %> + + <%= image_tag("priority/" + violation.failure_level.to_s + '.png') -%>   - <% end %> - <% if violation.review && violation.review.isReopened? %>   - <%= message('reopened') -%> + > + <%= h(violation.rule.name) -%> +   - <% end %> - <% if violation.review && violation.review.assignee_id %>   - <%= message('assigned_to') -%>: <%= h(violation.review.assignee.name) -%> -   - <% end %> - - <% if current_user %> + <% if violation.created_at %> + <%= distance_of_time_in_words_to_now(violation.created_at) -%> +   + <% end %> + <% if violation.switched_off? %> + +   + <%= message('false_positive') -%> +   + <% end %> + <% if violation.review && violation.review.reopened? %> + +   + <%= message('reopened') -%> +   + <% end %> + <% if violation.review && violation.review.assignee_id %> + +   + <%= message('assigned_to') -%>: <%= h(violation.review.assignee.name) -%> +   + <% end %> + + <% if current_user %> - <% - if violation.review - unless violation.switched_off? - %> + <% + if violation.review + unless violation.switched_off? + %>   - <%= link_to_remote (violation.review.isResolved? ? message('reopen') : message('resolve')), - :url => { :controller => "reviews", :action => "violation_change_status", :id => violation.id}, - :update => "vId" + violation.id.to_s, - :confirm => violation.review.isResolved? ? message('reviews.do_you_want_to_reopen') : message('reviews.do_you_want_to_resolve') -%> - - <% unless violation.review && violation.review.isResolved? %> + <%= link_to_remote (violation.review.resolved? ? message('reopen') : message('resolve')), + :url => {:controller => "reviews", :action => "violation_change_status", :id => violation.id}, + :update => "vId" + violation.id.to_s, + :confirm => violation.review.resolved? ? message('reviews.do_you_want_to_reopen') : message('reviews.do_you_want_to_resolve') -%> + + <% unless violation.review && violation.review.resolved? %>   - <%= link_to_remote (violation.review.assignee_id ? message('reassign') : message('assign')), - :url => { :controller => "reviews", :action => "violation_assign_form", :violation_id => violation.id}, - :update => "vActions" + violation.id.to_s, - :complete => "$('vActions" + violation.id.to_s + "').show();$('commentActions" + violation.id.to_s + "').hide();$('assignee_login').focus();" -%> + <%= link_to_remote (violation.review.assignee_id ? message('reassign') : message('assign')), + :url => {:controller => "reviews", :action => "violation_assign_form", :violation_id => violation.id}, + :update => "vActions" + violation.id.to_s, + :complete => "$('vActions" + violation.id.to_s + "').show();$('commentActions" + violation.id.to_s + "').hide();$('assignee_login').focus();" -%> <% - end - end - else - %> + end + end + else + %>   <%= link_to_remote message('review_verb'), - :url => { :controller => "reviews", :action => "violation_comment_form", :id => violation.id }, - :update => "reviewForm" + violation.id.to_s, - :complete => "$('reviewForm" + violation.id.to_s + "').show();$('commentText" + violation.id.to_s + "').focus();$('vActions#{violation.id}').hide();" -%> + :url => {:controller => "reviews", :action => "violation_comment_form", :id => violation.id}, + :update => "reviewForm" + violation.id.to_s, + :complete => "$('reviewForm" + violation.id.to_s + "').show();$('commentText" + violation.id.to_s + "').focus();$('vActions#{violation.id}').hide();" -%> <% end %> - -   - <% if (!violation.review) || (violation.review && violation.review.can_change_false_positive_flag?) %> + +   + <% if (!violation.review) || (violation.review && violation.review.can_change_false_positive_flag?) %> <%= link_to_remote (violation.switched_off? ? message('reviews.unflag_as_false_positive') : message('reviews.flag_as_false_positive')), - :url => { :controller => "reviews", :action => "violation_false_positive_form", :id => violation.id, :false_positive => !violation.switched_off? }, - :update => "reviewForm" + violation.id.to_s, - :complete => "$('reviewForm" + violation.id.to_s + "').show();$('commentText" + violation.id.to_s + "').focus();$('vActions" + violation.id.to_s + "').hide();$('commentActions" + violation.id.to_s + "').hide();" -%> + :url => {:controller => "reviews", :action => "violation_false_positive_form", :id => violation.id, :false_positive => !violation.switched_off?}, + :update => "reviewForm" + violation.id.to_s, + :complete => "$('reviewForm" + violation.id.to_s + "').show();$('commentText" + violation.id.to_s + "').focus();$('vActions" + violation.id.to_s + "').hide();$('commentActions" + violation.id.to_s + "').hide();" -%> <% end %> - <% end %> - -
+ <% end %> -
- <%= violation.html_message -%> -
+
+ +
+ <%= violation.html_message -%> +
- <% - if violation.review - violation.review.comments.each_with_index do |review_comment, comment_index| - is_last_comment=(comment_index==violation.review.comments.size-1) - %> -
-

<%= image_tag("reviews/comment.png") -%>  <%= review_comment.user.name -%> (<%= distance_of_time_in_words_to_now(review_comment.created_at) -%>) - <% if is_last_comment && current_user %> + <% + if violation.review + violation.review.comments.each_with_index do |review_comment, comment_index| + is_last_comment=(comment_index==violation.review.comments.size-1) + %> +
+

<%= image_tag("reviews/comment.png") -%>  <%= review_comment.user.name -%> (<%= distance_of_time_in_words_to_now(review_comment.created_at) -%>) + <% if is_last_comment && current_user %>       <%= link_to_remote message('add_comment'), - :url => { :controller => "reviews", :action => "violation_comment_form", :id => violation.id }, - :update => "reviewForm" + violation.id.to_s, - :complete => "$('vActions#{violation.id}').hide();$('commentActions" + violation.id.to_s + "').hide();$('reviewForm" + violation.id.to_s + "').show();$('commentText" + violation.id.to_s + "').focus()" -%> - <% - if current_user.id == review_comment.user_id + :url => {:controller => "reviews", :action => "violation_comment_form", :id => violation.id}, + :update => "reviewForm" + violation.id.to_s, + :complete => "$('vActions#{violation.id}').hide();$('commentActions" + violation.id.to_s + "').hide();$('reviewForm" + violation.id.to_s + "').show();$('commentText" + violation.id.to_s + "').focus()" -%> + <% + if current_user.id == review_comment.user_id %>   - <%= link_to_remote message('edit'), - :url => { :controller => "reviews", :action => "violation_comment_form", :comment_id => review_comment.id, :id => violation.id }, - :update => "lastComment" + violation.id.to_s, - :complete => "$('vActions#{violation.id}').hide();$('commentActions#{violation.id}').hide();$('commentText#{violation.id}').focus();" -%> + <%= link_to_remote message('edit'), + :url => {:controller => "reviews", :action => "violation_comment_form", :comment_id => review_comment.id, :id => violation.id}, + :update => "lastComment" + violation.id.to_s, + :complete => "$('vActions#{violation.id}').hide();$('commentActions#{violation.id}').hide();$('commentText#{violation.id}').focus();" -%> <% unless comment_index == 0 %>   - <%= link_to_remote message('delete'), - :url => { :controller => "reviews", :action => "violation_delete_comment", :comment_id => review_comment.id, :id => violation.id }, - :update => "vId" + violation.id.to_s, - :confirm => message('reviews.do_you_want_to_delete_comment') -%> + <%= link_to_remote message('delete'), + :url => {:controller => "reviews", :action => "violation_delete_comment", :comment_id => review_comment.id, :id => violation.id}, + :update => "vId" + violation.id.to_s, + :confirm => message('reviews.do_you_want_to_delete_comment') -%> <% end %> <% - end + end %> - <% end %> -

- <% if is_last_comment %> -
- <%= review_comment.html_text -%> + <% end %> +

+ <% if is_last_comment %> +
+ <%= review_comment.html_text -%> +
+ <% else %> + <%= review_comment.html_text -%> + <% end %>
- <% else %> - <%= review_comment.html_text -%> - <% end %> -
- <% - end - end - %> + <% + end + end + %> - -
+ +
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_review.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_review.html.erb index 58a3faa7542..5ccf941cf08 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_review.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_review.html.erb @@ -6,108 +6,109 @@   <%= message('false_positive') -%> <% end %> - - <% - if current_user && !review.isClosed? && review.rule_failure - violation_switched_off = review.rule_failure.switched_off? + + <% + if current_user && !review.closed? && review.rule_failure + violation_switched_off = review.rule_failure.switched_off? %>   - <%= image_tag("sep12.png") -%> + <%= image_tag("sep12.png") -%> +   + <% + if !violation_switched_off + %> + <%= link_to_remote (review.resolved? ? message('reopen') : message('resolve')), + :url => {:controller => "reviews", :action => "change_status", :id => review.id}, + :update => "review", + :confirm => review.resolved? ? message('reviews.do_you_want_to_reopen') : message('reviews.do_you_want_to_resolve') -%>   - <% - if !violation_switched_off - %> - <%= link_to_remote (review.isResolved? ? message('reopen') : message('resolve')), - :url => { :controller => "reviews", :action => "change_status", :id => review.id}, - :update => "review", - :confirm => review.isResolved? ? message('reviews.do_you_want_to_reopen') : message('reviews.do_you_want_to_resolve') -%> + <% unless review.resolved? %> + <%= link_to_remote (review.assignee_id ? message('reassign') : message('assign')), + :url => {:controller => "reviews", :action => "assign_form", :review_id => review.id}, + :update => "assignForm", + :complete => "$('rActions').hide(); $('editActions').hide(); $('assignee_login').focus();" -%> +   - <% unless review.isResolved? %> - <%= link_to_remote (review.assignee_id ? message('reassign') : message('assign')), - :url => { :controller => "reviews", :action => "assign_form", :review_id => review.id}, - :update => "assignForm", - :complete => "$('rActions').hide(); $('editActions').hide(); $('assignee_login').focus();" -%> - -   <% end %> <% end %> - <% if review.can_change_false_positive_flag? %> + <% if review.can_change_false_positive_flag? %> <%= link_to_remote (violation_switched_off ? message('reviews.unflag_as_false_positive') : message('reviews.flag_as_false_positive')), - :url => { :controller => "reviews", :action => "false_positive_form", :id => review.id, :false_positive => !violation_switched_off }, - :update => "reviewForm", - :complete => "$('reviewForm').show(); $('rActions').hide(); $('editActions').hide(); $('commentText').focus();" -%> + :url => {:controller => "reviews", :action => "false_positive_form", :id => review.id, :false_positive => !violation_switched_off}, + :update => "reviewForm", + :complete => "$('reviewForm').show(); $('rActions').hide(); $('editActions').hide(); $('commentText').focus();" -%> <% end %> <% end %> - + - - - - - - - - - + + + + + + + + - - - - - - - - - - <% if review.rule %> - - - - - <% end %> - - - - + + + + + + + + + + + <% if review.rule %> + + + + + <% end %> + + + +
- <%= message('status') -%>: - - <%= image_tag "status/#{review.status}.png" -%> <%= message(review.status.downcase).capitalize -%> - - <%= message('severity') -%>: - - <%= image_tag "priority/#{review.severity}.png" -%> <%= message(review.severity.downcase).capitalize -%> -
- <%= message('assignee') -%>: - +
+ <%= message('status') -%>: + + <%= image_tag "status/#{review.status}.png" -%> <%= message(review.status.downcase).capitalize -%> + + <%= message('severity') -%>: + + <%= image_tag "priority/#{review.severity}.png" -%> <%= message(review.severity.downcase).capitalize -%> +
+ <%= message('assignee') -%>: + - <%= review.assignee ? h(review.assignee.name) : '-'-%> + <%= review.assignee ? h(review.assignee.name) : '-' -%> - - <%= message('author') -%>: - - <%= h(review.user.name) -%> -
- <%= message('created') -%>: - - <%= l(review.created_at) -%> - - <%= message('updated') -%>: - - <%= l(review.updated_at) -%> -
- <%= message('rule') -%>: - - <%= h(review.rule.name) -%> -
- <%= message('file') -%>: - - <%= qualifier_icon(review.resource) -%> - <% if !review.on_project? %> <%= review.project.long_name -%> <%= image_tag 'sep12.png' -%> <% end %> - <%= link_to_resource(review.resource, review.resource.long_name, { :tab => :violations, :rule => review.false_positive ? "f-positive" : "" } ) %> -
+ <%= message('author') -%>: + + <%= h(review.user.name) -%> +
+ <%= message('created') -%>: + + <%= l(review.created_at) -%> + + <%= message('updated') -%>: + + <%= l(review.updated_at) -%> +
+ <%= message('rule') -%>: + + <%= h(review.rule.name) -%> +
+ <%= message('file') -%>: + + <%= qualifier_icon(review.resource) -%> + <% if !review.on_project? %> <%= review.project.long_name -%> <%= image_tag 'sep12.png' -%> + <% end %> + <%= link_to_resource(review.resource, review.resource.long_name, {:tab => :violations, :rule => review.false_positive ? "f-positive" : ""}) %> +
<% if review.rule_failure && review.resource_line && review.rule_failure.snapshot && has_role?(:codeviewer, review.project) %> @@ -117,59 +118,59 @@ <% end %>
- <% if review.rule_failure %> -
- <%= h(review.rule_failure.message) -%> -
- <% end %> - <% - review.comments.each_with_index do |comment, comment_index| - is_last_comment=(comment_index==review.comments.size-1) - %> -
-

- <%= image_tag("reviews/comment.png") -%>  <%= comment.user.name -%> (<%= distance_of_time_in_words_to_now(comment.created_at) -%>) - <% if is_last_comment && current_user && !review.isClosed? %> + <% if review.rule_failure %> +
+ <%= h(review.rule_failure.message) -%> +
+ <% end %> + <% + review.comments.each_with_index do |comment, comment_index| + is_last_comment=(comment_index==review.comments.size-1) + %> +
+

+ <%= image_tag("reviews/comment.png") -%>  <%= comment.user.name -%> (<%= distance_of_time_in_words_to_now(comment.created_at) -%>) + <% if is_last_comment && current_user && !review.closed? %>    <%= image_tag("sep12.png") -%>    <%= link_to_remote message('add_comment'), - :url => { :controller => "reviews", :action => "comment_form", :id => review.id }, - :update => "reviewForm", - :complete => "$('rActions').hide();$('editActions').hide();$('reviewForm').show();$('commentText').focus();" -%> + :url => {:controller => "reviews", :action => "comment_form", :id => review.id}, + :update => "reviewForm", + :complete => "$('rActions').hide();$('editActions').hide();$('reviewForm').show();$('commentText').focus();" -%> <% - if current_user.id == comment.user_id + if current_user.id == comment.user_id %>   - <%= link_to_remote message('edit'), - :url => { :controller => "reviews", :action => "comment_form", :comment_id => comment.id, :id => review.id }, - :update => "lastComment", - :complete => "$('rActions').hide();$('editActions').hide();$('commentText').focus();" -%> - <% unless comment_index == 0 %> + <%= link_to_remote message('edit'), + :url => {:controller => "reviews", :action => "comment_form", :comment_id => comment.id, :id => review.id}, + :update => "lastComment", + :complete => "$('rActions').hide();$('editActions').hide();$('commentText').focus();" -%> + <% unless comment_index == 0 %>   - <%= link_to_remote message('delete'), - :url => { :controller => "reviews", :action => "delete_comment", :comment_id => comment.id, :id => review.id }, - :update => "review", - :confirm => message('reviews.do_you_want_to_delete_comment') -%> + <%= link_to_remote message('delete'), + :url => {:controller => "reviews", :action => "delete_comment", :comment_id => comment.id, :id => review.id}, + :update => "review", + :confirm => message('reviews.do_you_want_to_delete_comment') -%> <% end %> - <% - end + <% + end %> - <% end %> -

- <% if is_last_comment %> -
- <%= comment.html_text -%> -
- <% else %> - <%= comment.html_text -%> - <% end %> -
- <% end %> + <% end %> +

+ <% if is_last_comment %> +
+ <%= comment.html_text -%> +
+ <% else %> + <%= comment.html_text -%> + <% end %> +
+ <% end %>
- + - + \ No newline at end of file -- 2.39.5