]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2327 Fix a problem on the permalink page
authorFabrice Bellingard <bellingard@gmail.com>
Fri, 29 Apr 2011 14:33:51 +0000 (16:33 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Fri, 29 Apr 2011 14:34:46 +0000 (16:34 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_show.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb [new file with mode: 0644]

index f94e9ad46851f7d0ad726c864c3286755a6f792a..ceae2e09cf76a1a07a55f49b55630f375bc1e1b8 100644 (file)
@@ -37,7 +37,7 @@ class ReviewsController < ApplicationController
   def view
     @review = Review.find(params[:id], :include => ['project'])
     if current_user && has_role?(:user, @review.project)
-      render 'reviews/_review', :locals => {:review => @review}
+      render 'reviews/_view', :locals => {:review => @review}
     else
       render :text => "<b>Cannot access this review</b> : access denied."
     end
index 7e90b13accbe68bf1fa2c09bab176903c3b3a14b..b9faf2e6d3017de59fb1299ee6a260e3ecb6d2cc 100644 (file)
@@ -1,5 +1,11 @@
-<div class="marginbottom10">
+<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/_view.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb
new file mode 100644 (file)
index 0000000..3a8dd35
--- /dev/null
@@ -0,0 +1,3 @@
+<div id="review">
+  <%= render :partial => 'reviews/review' -%>
+</div>