aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2011-05-18 17:12:54 +0200
committerFabrice Bellingard <bellingard@gmail.com>2011-05-18 17:12:54 +0200
commitcdf59a22ac046c66ab1887fec00bbe6f571097e5 (patch)
tree6d0f561499356574e0d13a6ae63c236ff8ca2c27 /sonar-server
parent6642d7a799acb8e45024cb7178d66bf8fa67d3d6 (diff)
downloadsonarqube-cdf59a22ac046c66ab1887fec00bbe6f571097e5.tar.gz
sonarqube-cdf59a22ac046c66ab1887fec00bbe6f571097e5.zip
SONAR-2419 Improve permalink visibility on review
- Permalinks are more visible on the resource viewer - The review search page returns directly permalinks
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb10
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_review.html.erb3
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_show.html.erb11
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb24
-rw-r--r--sonar-server/src/main/webapp/stylesheets/style.css17
6 files changed, 25 insertions, 42 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 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 @@
<div class="violation">
<div class="vtitle">
<% if violation.review %>
- <div style="float: right"><span class="review_permalink"><%= link_to violation.review.id.to_s, :controller => "reviews", :action => "view", :id => violation.review.id -%></span></div>
+ <div class="review_permalink"><span class="review_permalink"><%= link_to "Review #"+violation.review.id.to_s, :controller => "reviews", :action => "view", :id => violation.review.id -%></span></div>
<% 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 @@
<div id="rev_<%= review.id -%>">
<div class="reportTitle">
- <div style="float: right"><span class="violation_date"><%= review.id.to_s -%></span></div>
- <h2><%= h(review.title) -%></h2>
+ <h2>Review #<%= h(review.id.to_s) -%> - <%= h(review.title) -%></h2>
<% if current_user && review.status != "CLOSED" %>
<span class="actions" id="rActions">
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 @@
-<div id="backReviewDiv" class="marginbottom10">
- <a href="#" onclick="backReviews()">&laquo; Back to reviews</a>
-</div>
-<script>
- if ($('reviews-search')==null) {
- // This happens when this page results from a call made from the review permalink page
- $('backReviewDiv').hide();
- }
-</script>
-
-<%= 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 @@
-<script>
- function onReviewLoading() {
- $('reviews-search').hide();
- $('review').hide();
- $('review-loading').show();
- }
- function onReviewLoaded() {
- $('reviews-search').hide();
- $('review-loading').hide();
- $('review').show();
- }
- function backReviews() {
- $('review').hide();
- $('review-loading').hide();
- $('reviews-search').show();
- }
-</script>
-
<div id="reviews-search">
<h1>Reviews</h1>
<% form_tag({:action => 'index'}, {:method => 'get'}) do %>
@@ -114,11 +96,11 @@
<tr class="<%= cycle('even', 'odd') -%>">
<td><img src="<%= ApplicationController.root_context -%>/images/status/<%= review.status -%>.png" title="<%= review.status.capitalize -%>"/></td>
<td>
- <%= link_to_remote( h(review.id), :update => 'review', :url => {:action => 'show', :id => review.id}, :loading => 'onReviewLoading()', :complete => "onReviewLoaded()") -%>
+ <%= link_to h(review.id), :controller => "reviews", :action => "view", :id => review.id -%>
</td>
<td><img src="<%= ApplicationController.root_context -%>/images/priority/<%= review.severity -%>.png" title="<%= review.severity.capitalize -%>"/></td>
<td>
- <%= link_to_remote(h(review.title), :update => 'review', :url => {:action => 'show', :id => review.id}, :loading => 'onReviewLoading()', :complete => "onReviewLoaded()") -%>
+ <%= link_to h(review.title), :controller => "reviews", :action => "view", :id => review.id -%>
</td>
<td><%= review.project.name -%>
<br/><span class="note"><%= review.resource.long_name -%></span></td>
@@ -145,8 +127,6 @@
</div>
-<div id="review-loading" style="display: none"><%= image_tag 'loading.gif' -%></div>
-<div id="review" style="display: none"></div>
<script>
$('review_id').focus();
</script> \ 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;