]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2419 Improve permalink visibility on review
authorFabrice Bellingard <bellingard@gmail.com>
Wed, 18 May 2011 15:12:54 +0000 (17:12 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Thu, 19 May 2011 14:39:27 +0000 (16:39 +0200)
- Permalinks are more visible on the resource viewer
- The review search page returns directly permalinks

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/_review.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_show.html.erb [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb
sonar-server/src/main/webapp/stylesheets/style.css

index 7a69b96676c76a863bb05a1317e23b48d06b2862..62b3f3b87596ef48c26b4b2783506cbbeaeb7f58 100644 (file)
@@ -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
 
 
index 3282a0fedee0ef8339f0ce1b1c1a07ae1faf9089..25989a7b1e000e1e7597d0a2f74f23f8dc307acc 100644 (file)
@@ -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') -%>
index 79b0a2c864d2fd0805bcc9f8356692f8d8e4b20e..5e8fcd7299e83ea095bec5094b5c836f4b4552a7 100644 (file)
@@ -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 (file)
index b9faf2e..0000000
+++ /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
index 7bd4895f05a3654cdffb59da44e490ef6b755187..9946a4564f88da4df7452fa2aad68bb9fd4ba582 100644 (file)
@@ -107,11 +107,11 @@ function reviewIdFieldModified(field) {
         <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>
@@ -138,8 +138,6 @@ function reviewIdFieldModified(field) {
   
 </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
index a6a1af75d40bcae78b576a8af30bd14a39f00d5e..fd11c07a403c2f573d6c1b662077805438e9a69d 100644 (file)
@@ -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;