diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-04-07 14:05:12 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-04-20 08:49:56 +0200 |
commit | 0a8efe7fbc2043d97643b79bf320671a4ed6d49c (patch) | |
tree | 8c744ae7c6db9b11553e81469899ba4daac44d76 /sonar-server | |
parent | 82ff6127624f08ccec0d6bed2471cc67540c6acd (diff) | |
download | sonarqube-0a8efe7fbc2043d97643b79bf320671a4ed6d49c.tar.gz sonarqube-0a8efe7fbc2043d97643b79bf320671a4ed6d49c.zip |
[SONAR-1973] Rename code elements to follow conventions
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb | 13 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb | 2 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_comment.html.erb | 2 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_index.html.erb (renamed from sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_list.html.erb) | 0 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb | 2 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/reviews/create.html.erb | 1 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb | 1 |
7 files changed, 8 insertions, 13 deletions
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 fba4a4b3e0b..8004460ddfd 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 @@ -25,11 +25,8 @@ class ReviewsController < ApplicationController #verify :method => :post, :only => [ :create, :...... ], :redirect_to => { :action => :index } def index - end - - def list reviews = Review.find :all, :conditions => ['rule_failure_id=?', params[:rule_failure_id]] - render :partial => "list", :locals => { :reviews => reviews } + render :partial => "index", :locals => { :reviews => reviews } end def form @@ -43,7 +40,7 @@ class ReviewsController < ApplicationController render :partial => "form" end - def formComment + def form_comment @review_comment = ReviewComment.new @review_comment.user = current_user @review_comment.review_id = params[:review_id] @@ -65,17 +62,17 @@ class ReviewsController < ApplicationController review_comment.save params[:rule_failure_id] = review.rule_failure_id - list + index end - def createComment + def create_comment #return access_denied unless has_role?(:user, @project) review_comment = ReviewComment.new(params[:review_comment]) review_comment.user = current_user review_comment.save - list + index end 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 6ac4247163f..1b1bdeee331 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 @@ -32,7 +32,7 @@ <% end %> <div id="reviewFailure<%= violation.id -%>" style="padding:5px; background:white; display:<%= displayReviewFailureDiv -%>"> - <%= render :partial => "reviews/list", :locals => { :reviews => violation.reviews } %> + <%= render :partial => "reviews/index", :locals => { :reviews => violation.reviews } %> </div> </td> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_comment.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_comment.html.erb index 50c9a9e6b09..3ef46ed88a6 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_comment.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_comment.html.erb @@ -7,7 +7,7 @@ <%= f.text_area :review_text, :rows => 10, :id => "commentText" + @review_comment.review_id.to_s %> <br/> <%= submit_to_remote 'create_btn', 'Add comment', - :url => { :action => 'createComment', :rule_failure_id => @rule_failure_id }, + :url => { :action => 'create_comment', :rule_failure_id => @rule_failure_id }, :update => { :success => "reviewFailure" + @rule_failure_id.to_s, :failure => "fail" } %> <%= submit_to_remote 'cancel_btn', 'Cancel', :url => { :action => 'list', :rule_failure_id => @rule_failure_id.to_s }, diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_index.html.erb index 2fbbd000238..2fbbd000238 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_list.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_index.html.erb diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb index bc1b5bc3133..7d3a07a3f06 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb @@ -25,7 +25,7 @@ </div> <%= link_to_remote "Add a comment", - :url => { :controller => "reviews", :action => "formComment", :review_id => review.id, :rule_failure_id => review.rule_failure_id }, + :url => { :controller => "reviews", :action => "form_comment", :review_id => review.id, :rule_failure_id => review.rule_failure_id }, :update => "createComment" + review.id.to_s, :complete => "$('commentText" + review.id.to_s + "').focus()" -%> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/create.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/create.html.erb deleted file mode 100644 index 5ddd60c2e98..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/create.html.erb +++ /dev/null @@ -1 +0,0 @@ -Created!
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb deleted file mode 100644 index c95d9de3008..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb +++ /dev/null @@ -1 +0,0 @@ -Hello !
\ No newline at end of file |