]> source.dussan.org Git - sonarqube.git/commitdiff
[SONAR-1973] Rename code elements to follow conventions
authorFabrice Bellingard <bellingard@gmail.com>
Thu, 7 Apr 2011 12:05:12 +0000 (14:05 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Wed, 20 Apr 2011 06:49:56 +0000 (08:49 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_comment.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_index.html.erb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_list.html.erb [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/create.html.erb [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb [deleted file]

index fba4a4b3e0b41192dbee5f7788d1ee1a2a2719a4..8004460ddfdcce7196b9965b1b04a86741e0a4be 100644 (file)
@@ -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
index 6ac4247163f0248f5bf7137e5d23e86fdf180816..1b1bdeee3316826faa991112506250c6212eff57 100644 (file)
@@ -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>
       
index 50c9a9e6b09ac5a7690529e3d32c37e237519a7e..3ef46ed88a6297b282179e59be0177a5efcf416a 100644 (file)
@@ -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/_index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_index.html.erb
new file mode 100644 (file)
index 0000000..2fbbd00
--- /dev/null
@@ -0,0 +1,11 @@
+<% 
+   unless reviews.blank? 
+     reviews.each do |review|
+%>
+
+  <%= render :partial => "reviews/view", :locals => { :review => review } %>
+
+<% 
+     end
+   end
+%>
\ No newline at end of file
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/_list.html.erb
deleted file mode 100644 (file)
index 2fbbd00..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<% 
-   unless reviews.blank? 
-     reviews.each do |review|
-%>
-
-  <%= render :partial => "reviews/view", :locals => { :review => review } %>
-
-<% 
-     end
-   end
-%>
\ No newline at end of file
index bc1b5bc3133f30980413ea66553420e95e6ee39a..7d3a07a3f0643cb90ab33ffa4cd1e17cae89e3de 100644 (file)
@@ -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 (file)
index 5ddd60c..0000000
+++ /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 (file)
index c95d9de..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Hello !
\ No newline at end of file