diff options
Diffstat (limited to 'sonar-server/src/main/webapp')
14 files changed, 326 insertions, 132 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb index 5cbf398eae5..12bfbb61ff6 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/resource_controller.rb @@ -171,7 +171,7 @@ class ResourceController < ApplicationController @expandable=(@lines!=nil)
@filtered=!@expanded
- conditions='snapshot_id=?'
+ conditions='switched_off is not true AND snapshot_id=?'
values=[@snapshot.id]
unless params[:rule].blank?
severity=Sonar::RulePriority.id(params[:rule])
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 39207c27671..d5c3b7c56a0 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 @@ -38,30 +38,23 @@ class ReviewsController < ApplicationController render :partial => "list", :locals => { :reviews => reviews }
end
+ def display_violation
+ violation = find_last_rule_failure_with_permanent_id params[:rule_failure_permanent_id]
+ render :partial => "resource/violation", :locals => { :violation => violation }
+ end
+
def form
rule_failure = find_last_rule_failure_with_permanent_id params[:rule_failure_permanent_id]
@review = Review.new
@review.rule_failure_permanent_id = rule_failure.permanent_id
- @review.user = current_user
- @review.assignee = current_user
- @user_options = add_all_users []
- @review.title = rule_failure.message
@review_comment = ReviewComment.new
@review_comment.review_text = ""
- render :partial => "form"
- end
-
- def form_comment
- @review_comment = ReviewComment.new
- @review_comment.user = current_user
- @review_comment.review_id = params[:review_id]
- @review_comment.review_text = ""
- @rule_failure_permanent_id = params[:rule_failure_permanent_id]
- if params[:update_comment]
- @update_comment = "true"
- @review_comment.review_text = params[:review_text]
+ if params[:switch_off]
+ @review.review_type = "f-positive"
+ else
+ @review.review_type = Review.default_type
end
- render :partial => "form_comment"
+ render :partial => "form"
end
def create
@@ -73,22 +66,45 @@ class ReviewsController < ApplicationController @review = Review.new(params[:review])
@review.user = current_user
+ if params[:assign_to_me]
+ @review.assignee = current_user
+ end
+ @review.title = rule_failure.message
@review.status = Review.default_status
- @review.review_type = Review.default_type
@review.severity = Sonar::RulePriority.to_s rule_failure.failure_level
@review.resource = RuleFailure.find( @review.rule_failure_permanent_id, :include => ['snapshot'] ).snapshot.project
@review_comment = ReviewComment.new(params[:review_comment])
@review_comment.user = current_user
@review.review_comments << @review_comment
if @review.valid?
+ if @review.review_type == "f-positive"
+ if rule_failure.get_open_review
+ current_open_review = rule_failure.get_open_review
+ current_open_review.status = "closed"
+ current_open_review.save
+ end
+ rule_failure.switched_off = true
+ rule_failure.save
+ end
@review.save
- @reviews = find_reviews_for_rule_failure @review.rule_failure_permanent_id
- else
- @user_options = add_all_users []
+ @violation = rule_failure
end
render "create_result"
end
+ def form_comment
+ @review_comment = ReviewComment.new
+ @review_comment.user = current_user
+ @review_comment.review_id = params[:review_id]
+ @review_comment.review_text = ""
+ @rule_failure_permanent_id = params[:rule_failure_permanent_id]
+ if params[:update_comment]
+ @update_comment = true
+ @review_comment.review_text = params[:review_text]
+ end
+ render :partial => "form_comment"
+ end
+
def create_comment
rule_failure = find_last_rule_failure_with_permanent_id params[:rule_failure_permanent_id]
unless has_rights_to_create? rule_failure
@@ -106,7 +122,7 @@ class ReviewsController < ApplicationController review.updated_at = @review_comment.created_at
review.save
# -- End of TODO code --
- @reviews = find_reviews_for_rule_failure @rule_failure_permanent_id
+ @violation = rule_failure
end
render "create_comment_result"
end
@@ -124,9 +140,44 @@ class ReviewsController < ApplicationController @rule_failure_permanent_id = params[:rule_failure_permanent_id]
if @review_comment.valid?
@review_comment.save
- @reviews = find_reviews_for_rule_failure @rule_failure_permanent_id
+ review.updated_at = @review_comment.updated_at
+ review.save
+ @violation = find_last_rule_failure_with_permanent_id review.rule_failure_permanent_id
end
- render "update_comment_result"
+ render "create_comment_result"
+ end
+
+ def form_assign
+ @user_options = add_all_users []
+ @review_id = params[:review_id]
+ @rule_failure_permanent_id = params[:rule_failure_permanent_id]
+ render :partial => "form_assign"
+ end
+
+ def assign
+ review = Review.find params[:review_id]
+ unless current_user
+ render :text => "<b>Cannot edit the review</b> : access denied."
+ return
+ end
+
+ review.assignee = User.find params[:assignee_id]
+ review.save
+ violation = find_last_rule_failure_with_permanent_id review.rule_failure_permanent_id
+ render :partial => "resource/violation", :locals => { :violation => violation }
+ end
+
+ def close_review
+ review = Review.find params[:review_id]
+ unless current_user
+ render :text => "<b>Cannot edit the review</b> : access denied."
+ return
+ end
+
+ review.status = "closed"
+ review.save
+ violation = find_last_rule_failure_with_permanent_id review.rule_failure_permanent_id
+ render :partial => "resource/violation", :locals => { :violation => violation }
end
## -------------- PRIVATE -------------- ##
@@ -136,7 +187,6 @@ class ReviewsController < ApplicationController @user_names = [["Any", ""]]
default_user = [""]
if current_user
- @user_names << ["Me", current_user.id]
default_user = [current_user.id]
end
add_all_users @user_names
@@ -148,7 +198,11 @@ class ReviewsController < ApplicationController def add_all_users ( user_options )
User.find( :all ).each do |user|
- user_options << [user.name, user.id.to_s]
+ userName = user.name
+ if current_user.id == user.id
+ userName = "Me (" + user.name + ")"
+ end
+ user_options << [userName, user.id.to_s]
end
return user_options
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 9c6cb791852..df4179f309d 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 @@ -23,7 +23,6 @@ class Review < ActiveRecord::Base belongs_to :resource, :class_name => "Project", :foreign_key => "resource_id"
has_many :review_comments, :order => "created_at", :dependent => :destroy
validates_presence_of :user, :message => "can't be empty"
- validates_presence_of :assignee, :message => "can't be empty"
validates_presence_of :title, :message => "can't be empty"
validates_presence_of :review_type, :message => "can't be empty"
validates_presence_of :status, :message => "can't be empty"
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/rule_failure.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/rule_failure.rb index 27e1ec25401..45253ed2da9 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/rule_failure.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/rule_failure.rb @@ -24,6 +24,15 @@ class RuleFailure < ActiveRecord::Base belongs_to :snapshot
has_many :reviews, :primary_key => "permanent_id", :foreign_key => "rule_failure_permanent_id", :order => "created_at"
+ def get_open_review
+ reviews.each do |review|
+ if review.status == "open"
+ return review
+ end
+ end
+ return nil
+ end
+
def to_hash_json
json = {}
json['message'] = message
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 3a599ba11e6..de7ec93b152 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,48 +1,120 @@ -<%
- displayReviewFailureDiv = 'block'
- if violation.reviews.blank?
- displayReviewFailureDiv = 'none'
- end
-%>
-<div class="violation">
- <table style="width:100%">
- <tr>
- <td style="width: 30px; vertical-align: top; text-align: center;">
- <% if current_user && violation.reviews.blank? %>
- <%= link_to_remote image_tag("reviews/+review.png"),
- :url => { :controller => "reviews", :action => "form", :rule_failure_permanent_id => violation.permanent_id },
- :update => "reviewFailure" + violation.permanent_id.to_s,
- :html => { :id => "createReviewLink" + violation.permanent_id.to_s, :title => "Add a review" },
- :complete => "$('reviewFailure" + violation.permanent_id.to_s + "').style.display='';$('reviewText').focus();" -%>
- <% end %>
- <% unless violation.reviews.blank? %>
- <%= image_tag("reviews/review.png") -%>
- <% end %>
- </td>
-
- <td>
- <img src="<%= ApplicationController.root_context -%>/images/priority/<%=violation.failure_level-%>.png"/>
-
- <span class="rulename"><a onclick="window.open(this.href,'rule','height=800,width=900,scrollbars=1,resizable=1');return false;" href="<%= url_for :controller => 'rules', :action => 'show', :id => violation.rule.key, :layout => 'false' -%>"><%= h(violation.rule.name) -%></a></span>
- ยป
- <%= h(violation.message) -%>
- <%
- if violation.created_at
- duration=Date.today - violation.created_at.to_date
- %>
- <span class="violation_date"><%= duration==0 ? 'today' : "#{duration} days ago" -%></span>
- <% end %>
-
- </td>
- </tr>
-
- <tr>
- <td colspan="2">
- <div id="reviewFailure<%= violation.permanent_id -%>" style="margin-left: 13px; padding: 10px 5px 5px 10px; border-left: 2px solid #EFEFEF; display:<%= displayReviewFailureDiv -%>">
- <%= render :partial => "reviews/list", :locals => { :reviews => violation.reviews } %>
- </div>
- </td>
- </tr>
-
- </table>
-</div>
\ No newline at end of file +<div id="vId<%= violation.permanent_id -%>"> +<% + current_open_review = violation.get_open_review +%> + +<div class="violation"> + + <div class="vtitle"> + <% if current_open_review %> + <div style="float: right"><span class="violation_date">#<%= current_open_review.id.to_s -%></span></div> + <% end %> + + <%= image_tag("priority/" + violation.failure_level.to_s + ".png") -%> + + <%= image_tag("sep12.png") -%> + + <span class="rulename"> + <a onclick="window.open(this.href,'rule','height=800,width=900,scrollbars=1,resizable=1');return false;" href="<%= url_for :controller => 'rules', :action => 'show', :id => violation.rule.key, :layout => 'false' -%>"><%= h(violation.rule.name) -%></a> + </span> + + <%= image_tag("sep12.png") -%> + + <% + if violation.created_at + duration=Date.today - violation.created_at.to_date + %> + <span class="violation_date"><%= duration==0 ? 'today' : "#{duration} days ago" -%></span> + <% end %> + <% if current_open_review && current_open_review.assignee %> + <%= image_tag("sep12.png") -%> + + <%= h(current_open_review.assignee.name) -%> + <% end %> + + + <% if current_user %> + <span class="actions" id="vActions<%= violation.permanent_id.to_s -%>"> + + <%= image_tag("sep12.png") -%> + + <% if current_open_review %> + <%= link_to_remote "Close review", + :url => { :controller => "reviews", :action => "close_review", :review_id => current_open_review.id, :rule_failure_permanent_id => violation.permanent_id }, + :update => "vId" + violation.permanent_id.to_s -%> + + <% if current_open_review.assignee == nil %> + <%= link_to_remote "Assign", + :url => { :controller => "reviews", :action => "form_assign", :review_id => current_open_review.id, :rule_failure_permanent_id => violation.permanent_id }, + :update => "vActions" + violation.permanent_id.to_s -%> + + <% end %> + <% end %> + <% unless current_open_review %> + <%= link_to_remote "Review", + :url => { :controller => "reviews", :action => "form", :rule_failure_permanent_id => violation.permanent_id }, + :update => "reviewForm" + violation.permanent_id.to_s, + :complete => "$('reviewForm" + violation.permanent_id.to_s + "').style.display='';$('reviewText').focus();" -%> + + <% end %> + <%= link_to_remote "Switch-off", + :url => { :controller => "reviews", :action => "form", :rule_failure_permanent_id => violation.permanent_id, :switch_off => true }, + :update => "reviewForm" + violation.permanent_id.to_s, + :complete => "$('reviewForm" + violation.permanent_id.to_s + "').style.display='';$('reviewText').focus();" -%> + + </span> + <% end %> + + </div> + + <div class="comment"> + <%= h(violation.message) -%> + </div> + + <% + if current_open_review + last_comment = current_open_review.review_comments.last + current_open_review.review_comments.each do |review_comment| + %> + <div class="comment"> + <h4><%= image_tag("reviews/comment.png") -%> <b><%= review_comment.user.name -%></b> on <%= l review_comment.created_at -%> + <% if review_comment == last_comment && current_user && current_user.id == review_comment.user.id %> + <span class="actions"> + + <%= image_tag("sep12.png") -%> + + <%= link_to_remote "Edit", + :url => { :controller => "reviews", :action => "form_comment", :review_id => current_open_review.id, :rule_failure_permanent_id => violation.permanent_id, :review_text => last_comment.review_text, :update_comment => "true" }, + :update => "lastComment" + violation.permanent_id.to_s, + :complete => "$('commentText" + violation.permanent_id.to_s + "').focus()" -%> + </span> + <% end %> + </h4> + <% if review_comment == last_comment %> + <div id="lastComment<%= violation.id -%>"> + <%= h(review_comment.review_text) -%> + </div> + <% else %> + <%= h(review_comment.review_text) -%> + <% end %> + </div> + <% + end + end + %> + + <div class="comment" id="reviewForm<%= violation.permanent_id.to_s -%>" style="display: none"> + </div> + +</div> + +<% if current_user && current_open_review %> +<div style="padding: 5px" id="commentAction<%= violation.permanent_id -%>"> + <%= link_to_remote "Add comment", + :url => { :controller => "reviews", :action => "form_comment", :review_id => current_open_review.id, :rule_failure_permanent_id => violation.permanent_id }, + :update => "reviewForm" + violation.permanent_id.to_s, + :complete => "$('commentAction" + violation.permanent_id.to_s + "').style.display='none';$('reviewForm" + violation.permanent_id.to_s + "').style.display='';$('commentText" + violation.permanent_id.to_s + "').focus()" -%> +</div> +<% end %> + +<div>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/index.html.erb index 71d1e4634a3..b8e8092b36e 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/index.html.erb @@ -96,15 +96,21 @@ <% end %> <td class="line <%= status -%>"> <pre><%= line.source -%></pre> - <% if @display_violations && line.violations? %> - <div class="violations"> + </td> + </tr> + <% if @display_violations && line.violations? %> + <tr> + <% if @scm_available %> + <td class="scm"></td> + <% end %> + <td class="lid section"></td> + <td class="violations"> <% line.violations.each do |violation| %> <%= render :partial => 'violation', :locals => {:violation => violation} -%> <% end %> - </div> - <% end %> - </td> - </tr> + </td> + </tr> + <% end %> <% end %> </table> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form.html.erb index 16e214941c6..ceb5210de51 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form.html.erb @@ -1,18 +1,30 @@ <% form_for :review, @review do |f| %>
- <%= f.hidden_field :rule_failure_permanent_id %>
- <b>New review</b>:
- <%= f.text_field :title, :size => 100 %>
- <br/>
- Assignee:
- <%= select_tag "review[assignee_id]", options_for_select(@user_options, @review.assignee.id.to_s) %>
- <br/>
- <%= text_area :review_comment, :review_text, :id => "reviewText", :rows => 8, :style => "width:100%" %>
- <br/>
+ <%= f.hidden_field :rule_failure_permanent_id -%>
+ <%= f.hidden_field :review_type -%>
- <%= submit_to_remote "create_btn", "Create review", :url => { :action => 'create' } %>
- <input type="button" name="cancel_btn" value="Cancel"
- onclick="new Ajax.Updater({success:'reviewFailure<%= @review.rule_failure_permanent_id.to_s -%>'}, '<%= ApplicationController.root_context -%>/reviews/list?rule_failure_permanent_id=<%= @review.rule_failure_permanent_id.to_s -%>', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this.form), }); $('reviewFailure<%= @review.rule_failure_permanent_id.to_s -%>').style.display='none';">
-
- <%= f.error_messages :header_message => "Can't create the review", :message => "", :header_tag => :h3 %>
+ <% if @review.review_type == "f-positive" %>
+ <b>Reason for flagging this violation as a false-positive:</b>
+ <% end %>
+ <%= text_area :review_comment, :review_text,
+ :id => "reviewText", :rows => 8,
+ :style => "width:100%", :onKeyUp => "if (this.value=='') $('submit_btn').disabled='true'; else $('submit_btn').disabled='';" -%>
+ <br/>
+ <div>
+ <%
+ if @review.review_type == "comments"
+ button_text = "Post review"
+ else
+ button_text = "Switch-off violation"
+ end
+ %>
+ <%= submit_to_remote "submit_btn", button_text, :url => { :action => 'create' }, :html => { :id => "submit_btn", :disabled => "true" } -%>
+
+ <a onclick="$('reviewForm<%= @review.rule_failure_permanent_id.to_s -%>').style.display='none';" href="#">Cancel</a>
+ <% if @review.review_type == "comments" %>
+
+ <%= check_box_tag "assign_to_me", "me", true -%> Assign to me
+ <% end %>
+ </div>
+ </div class="clear"></div>
<% end %>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_assign.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_assign.html.erb new file mode 100644 index 00000000000..575c2f8aecc --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_assign.html.erb @@ -0,0 +1,12 @@ +<% form_tag do %> + <%= hidden_field_tag :review_id, @review_id -%> + <%= select_tag "assignee_id", options_for_select(@user_options, current_user.id.to_s) %> + + <%= submit_to_remote "submit_btn", "Assign", + :url => { :action => 'assign' }, + :update => "vId" + @rule_failure_permanent_id.to_s -%> + + <%= link_to_remote 'Cancel', + :url => { :action => 'display_violation', :rule_failure_permanent_id => @rule_failure_permanent_id }, + :update => "vId" + @rule_failure_permanent_id.to_s %> +<% end %>
\ No newline at end of file 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 8d5b25accd3..79ad5010402 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 @@ -1,22 +1,28 @@ <% form_for :review_comment, @review_comment do |f| %>
<%= f.hidden_field :review_id %>
<%= f.text_area :review_text, :rows => 8,
- :id => "commentText" + @review_comment.review_id.to_s,
- :style => "width:100%" %>
+ :id => "commentText" + @rule_failure_permanent_id.to_s,
+ :style => "width:100%",
+ :onKeyUp => "if (this.value=='') $('submit_btn').disabled='true'; else $('submit_btn').disabled='';" %>
<br/>
+
<% if @update_comment %>
- <%= submit_to_remote 'create_btn', 'Update',
+ <%= submit_to_remote 'submit_btn', 'Update comment',
:url => { :action => 'update_comment',
- :rule_failure_permanent_id => @rule_failure_permanent_id } %>
+ :rule_failure_permanent_id => @rule_failure_permanent_id },
+ :html => { :id => "submit_btn" } %>
+
+ <%= link_to_remote 'Cancel',
+ :url => { :action => 'display_violation',
+ :rule_failure_permanent_id => @rule_failure_permanent_id },
+ :update => "vId" + @rule_failure_permanent_id.to_s %>
<% else %>
- <%= submit_to_remote 'create_btn', 'Post',
+ <%= submit_to_remote 'submit_btn', 'Post comment',
:url => { :action => 'create_comment',
- :rule_failure_permanent_id => @rule_failure_permanent_id } %>
+ :rule_failure_permanent_id => @rule_failure_permanent_id },
+ :html => { :id => "submit_btn", :disabled => true } %>
+
+ <a onclick="$('reviewForm<%= @rule_failure_permanent_id.to_s -%>').style.display='none'; $('commentAction<%= @rule_failure_permanent_id.to_s -%>').style.display='';" href="#">Cancel</a>
<% end %>
- <%= submit_to_remote 'cancel_btn', 'Cancel',
- :url => { :action => 'list', :rule_failure_permanent_id => @rule_failure_permanent_id.to_s },
- :update => { :success => "reviewFailure" + @rule_failure_permanent_id.to_s } %>
-
- <%= f.error_messages :header_message => "Can't save the comment", :message => "", :header_tag => :h3%>
<% end %>
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/create_comment_result.js.rjs b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/create_comment_result.js.rjs index 6eae877ae47..f177aae9cb2 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/create_comment_result.js.rjs +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/create_comment_result.js.rjs @@ -1,5 +1,5 @@ -if @reviews
- page.replace_html "reviewFailure" + @rule_failure_permanent_id.to_s, :partial => "list", :locals => { :reviews => @reviews }
+if @violation
+ page.replace "vId" + @violation.permanent_id.to_s, :partial => "resource/violation", :locals => { :violation => @violation }
else
- page.replace_html "createComment" + @review_comment.review_id.to_s, :partial => "form_comment"
+ page.replace_html "reviewForm" + @rule_failure_permanent_id.to_s, :partial => "form_comment"
end
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/create_result.js.rjs b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/create_result.js.rjs index 5f802780b34..720e00f11b3 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/create_result.js.rjs +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/create_result.js.rjs @@ -1,6 +1,5 @@ -if @reviews
- page.replace_html "createReviewLink" + @review.rule_failure_permanent_id.to_s, image_tag("reviews/review.png")
- page.replace_html "reviewFailure" + @review.rule_failure_permanent_id.to_s, :partial => "list", :locals => { :reviews => @reviews }
-else
- page.replace_html "reviewFailure" + @review.rule_failure_permanent_id.to_s, :partial => "form"
+if @violation
+ page.replace "vId" + @violation.permanent_id.to_s, :partial => "resource/violation", :locals => { :violation => @violation }
+else
+ page.replace_html "reviewForm" + @review.rule_failure_permanent_id.to_s, :partial => "form"
end
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/update_comment_result.js.rjs b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/update_comment_result.js.rjs deleted file mode 100644 index f127394f53a..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/update_comment_result.js.rjs +++ /dev/null @@ -1,6 +0,0 @@ -if @reviews
- page.replace_html "reviewFailure" + @rule_failure_permanent_id.to_s, :partial => "list", :locals => { :reviews => @reviews }
-else
- @update_comment = "true"
- page.replace_html "lastComment" + @review_comment.review_id.to_s, :partial => "form_comment"
-end
\ No newline at end of file diff --git a/sonar-server/src/main/webapp/images/reviews/comment.png b/sonar-server/src/main/webapp/images/reviews/comment.png Binary files differnew file mode 100644 index 00000000000..d2b4d640851 --- /dev/null +++ b/sonar-server/src/main/webapp/images/reviews/comment.png diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css index be59f091b76..2e7a321d550 100644 --- a/sonar-server/src/main/webapp/stylesheets/style.css +++ b/sonar-server/src/main/webapp/stylesheets/style.css @@ -665,23 +665,47 @@ ul.operations li img { .sources2 span.author, .sources2 span.author a {
font-size: 85%;
}
-.sources2 div.violations {
- background-color: #FFFFFF; /* #EFEFEF */
- margin: 2px;
+.sources2 div.violation {
+ background-color:#FFF;
+ margin:0;
border: 1px solid #DDD;
}
-.sources2 div.violation {
- background-color: #FFFFFF; /* #EFEFEF */
- margin: 0;
- padding: 3px 5px;
+.sources2 div.comment{
+ background-color:#FBFBFB;
+ margin:0;
+ padding:5px 10px;
+ border-top: 1px solid #DDD;
+ line-height: 1.5em;
+}
+.sources2 div.comment h4{
+ font-size: 90%;
+ margin-bottom: 2px;
+}
+.sources2 div.violation .actions{
+ visibility: hidden;
+}
+.sources2 div.violation:hover .actions{
+ visibility: visible;
+}
+.sources2 div.vtitle{
+ background-color:#E4ECF3;
+ margin:0;
+ padding:0 10px;
+ line-height: 2.2em;
+ text-shadow: 1px 1px 0 #FFF;
+ color:#777
+}
+.sources2 div.vtitle a.action {
+ color: #777;
}
span.rulename, span.rulename a {
- color: #4183C4;
- text-decoration: none;
+ color:#4183C4;
+ text-decoration:none;
+ font-weight: bold;
}
span.violation_date {
- color: #AAA;
- font-size: 85%;
+ color:#777;
+ font-size:90%;
}
span.rulename a:hover {
text-decoration: underline;
@@ -725,6 +749,13 @@ span.rulename a:hover { border-bottom: 1px solid #DDD;
height: 40px;
}
+.sources2 td.violations{
+ background-color: #FFF;
+ padding: 10px;
+ border-bottom: 1px solid #DDD;
+ border-right: 1px solid #DDD;
+ border-top: 1px solid #DDD;
+}
#source_title {
padding: 10px 0;
}
|