From cdf59a22ac046c66ab1887fec00bbe6f571097e5 Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Wed, 18 May 2011 17:12:54 +0200 Subject: [PATCH] SONAR-2419 Improve permalink visibility on review - Permalinks are more visible on the resource viewer - The review search page returns directly permalinks --- .../app/controllers/reviews_controller.rb | 10 ++++---- .../app/views/resource/_violation.html.erb | 2 +- .../app/views/reviews/_review.html.erb | 3 +-- .../WEB-INF/app/views/reviews/_show.html.erb | 11 --------- .../WEB-INF/app/views/reviews/index.html.erb | 24 ++----------------- .../src/main/webapp/stylesheets/style.css | 17 ++++++++++++- 6 files changed, 25 insertions(+), 42 deletions(-) delete mode 100644 sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_show.html.erb 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 8404e2a6eb2..2fe120b3e34 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 @@ -53,7 +53,7 @@ class ReviewsController < ApplicationController def show @review = Review.find(params[:id], :include => ['project']) if has_role?(:user, @review.project) - render :partial => 'reviews/show' + render :partial => 'reviews/view' else render :text => "access denied" end @@ -76,7 +76,7 @@ class ReviewsController < ApplicationController @review.assignee = User.find params[:assignee_id] @review.save - render :partial => 'reviews/show' + render :partial => 'reviews/view' end # GET @@ -106,7 +106,7 @@ class ReviewsController < ApplicationController @review.comments.create!(:user => current_user, :text => params[:text]) end - render :partial => "reviews/show" + render :partial => "reviews/view" end # GET @@ -134,7 +134,7 @@ class ReviewsController < ApplicationController @review.comments.create(:review_text => params[:comment], :user_id => current_user.id) end - render :partial => "reviews/show" + render :partial => "reviews/view" end # POST @@ -149,7 +149,7 @@ class ReviewsController < ApplicationController comment=@review.comments.find(params[:comment_id].to_i) comment.delete if comment end - render :partial => "reviews/show" + render :partial => "reviews/view" 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 3282a0fedee..25989a7b1e0 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 @@ -2,7 +2,7 @@
<% if violation.review %> -
<%= link_to violation.review.id.to_s, :controller => "reviews", :action => "view", :id => violation.review.id -%>
+ <% end %> <%= image_tag("priority/" + violation.failure_level.to_s + '.png') -%> 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 79b0a2c864d..5e8fcd7299e 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 @@ -1,7 +1,6 @@
-
<%= review.id.to_s -%>
-

<%= h(review.title) -%>

+

Review #<%= h(review.id.to_s) -%> - <%= h(review.title) -%>

<% if current_user && review.status != "CLOSED" %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_show.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_show.html.erb deleted file mode 100644 index b9faf2e6d30..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_show.html.erb +++ /dev/null @@ -1,11 +0,0 @@ - - - -<%= render :partial => 'reviews/review', :locals => {:review => @review} -%> \ 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 index a347bd8374c..c8970c6ebb5 100644 --- 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 @@ -1,21 +1,3 @@ - - - - \ No newline at end of file diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css index a6a1af75d40..fd11c07a403 100644 --- a/sonar-server/src/main/webapp/stylesheets/style.css +++ b/sonar-server/src/main/webapp/stylesheets/style.css @@ -686,7 +686,7 @@ ul.operations li img { div.vtitle{ background-color:#E4ECF3; margin:0; - padding:0 10px; + padding:0 0 0 10px; line-height: 2.2em; text-shadow: 0 1px 0 #FFF; color:#777 @@ -706,9 +706,24 @@ span.violation_date { color:#777; font-size:90%; } +div.review_permalink { + float: right; + background-color: #F4F4F4; + border-color: #CDCDCD; + border-style: none none none solid; + border-width: 1px; + color: #333333; + font-size: 12px; + font-weight: bold; + margin: 0; + padding: 0 10px; + text-shadow: 1px 1px 0 #FFFFFF; +} span.review_permalink a { color:#777; font-size:90%; + padding: 0 0 0 20px; + background: url('../images/zoom.png') no-repeat left; } span.rulename a:hover { text-decoration: underline; -- 2.39.5