]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2399 Improvements on review widgets
authorFabrice Bellingard <bellingard@gmail.com>
Tue, 6 Dec 2011 17:48:09 +0000 (18:48 +0100)
committerFabrice Bellingard <bellingard@gmail.com>
Tue, 6 Dec 2011 17:49:07 +0000 (18:49 +0100)
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/false_positive_reviews.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/my_reviews.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/project_reviews.html.erb
plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/controllers/reviews_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/reviews/_reviews_list.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb

index 1fdb0177c4b2bd9a0463290d06316d2d37f03562..e0429e02b3ac4dccb0398b7548670dcf026103f7 100644 (file)
@@ -3,7 +3,15 @@
     limit = widget_properties["numberOfLines"].to_i == 0 ? 5 : widget_properties["numberOfLines"].to_i
 %>
 
-<h3><%= message('widget.false_positive_reviews.name') -%></h3>
+<div class="line-block">
+  <div style="float:right">
+    <a href="<%= url_for :controller => 'reviews', :action => 'index', :projects => [@project.id], :false_positives => 'only',
+                         :assignee_login => '', :statuses => [''] -%>">
+      <%= message('widgets.more') -%>
+    </a>
+  </div>
+  <h3><%= message('widget.false_positive_reviews.name') -%></h3>
+</div>
 
 <div id="reviews-widget-<%= widget.id -%>">
   <%= render :partial => 'project/widgets/reviews/reviews_list', 
index 0fb0c9d7aceb9b200523e9a375acd2b52084a1ff..52fe8206a86f7285bc80b646af77f15e632f3376 100644 (file)
@@ -3,7 +3,14 @@
     limit = widget_properties["numberOfLines"].to_i == 0 ? 5 : widget_properties["numberOfLines"].to_i
 %>
 
-<h3><%= message('widget.my_reviews.name') -%></h3>
+<div class="line-block">
+  <div style="float:right">
+    <a href="<%= url_for :controller => 'reviews', :action => 'index', :projects => [@project.id] -%>">
+      <%= message('widgets.more') -%>
+    </a>
+  </div>
+  <h3><%= message('widget.my_reviews.name') -%></h3>
+</div>
 
 <div id="reviews-widget-<%= widget.id -%>">
   <%= render :partial => 'project/widgets/reviews/reviews_list', 
index 943d37920c2d37822a6397ec5c121c441e6f729e..a82e6bb5e05605c180d9f230398c1e8cf56bdd91 100644 (file)
@@ -3,7 +3,14 @@
     limit = widget_properties["numberOfLines"].to_i == 0 ? 5 : widget_properties["numberOfLines"].to_i
 %>
 
-<h3><%= message('widget.project_reviews.name') -%></h3>
+<div class="line-block">
+  <div style="float:right">
+    <a href="<%= url_for :controller => 'reviews', :action => 'index', :projects => [@project.id], :assignee_login => '' -%>">
+      <%= message('widgets.more') -%>
+    </a>
+  </div>
+  <h3><%= message('widget.project_reviews.name') -%></h3>
+</div>
 
 <div id="reviews-widget-<%= widget.id -%>">
   <%= render :partial => 'project/widgets/reviews/reviews_list', 
index f7fecf2ca5aa6555d719a41bf9ce124e3b02da59..50de65d3241987686c0450d4207eacff905ad237 100644 (file)
@@ -382,6 +382,7 @@ reviews.do_you_want_to_delete_comment=Do you want to delete this comment?
 reviews.only_false_positives=Only false positives
 reviews.without_false_positives=Without false positives
 reviews.showing_false_positives_only=Showing false positives only
+reviews.reviews_filtered_by_date_x_to_y=Reviews filtered by date: {0} to {1}.
 reviews.why_false_positive=Why is it a false-positive ?
 reviews.why_not_false_positive=Why is it not a false-positive anymore ?
 reviews.user_does_not_exist=\ : user does not exist. \\nPlease select a valid user or leave the field blank.
@@ -447,6 +448,8 @@ property.category.server_id=Server ID
 #
 #------------------------------------------------------------------------------
 
+widgets.more=More
+
 widget.alerts.name=Alerts
 widget.alerts.description=Display current alerts on the project.
 widget.alerts.no_alert=No alerts
@@ -581,7 +584,7 @@ widget.my_reviews.no_review=No review.
 widget.project_reviews.name=Project open reviews
 widget.project_reviews.description=Shows all the open/reopened reviews.
 
-widget.false_positive_reviews.name=False positive reviews
+widget.false_positive_reviews.name=Active False Positive Reviews
 widget.false_positive_reviews.description=Shows all the false positives found on the project.
 
 widget.reviews_per_developer.name=Open reviews per developer
index a975245a13deeb82b2ca8af412e24cb614742661..9c9495522900180cb183a755b6a683f0365f69aa 100644 (file)
@@ -306,7 +306,7 @@ class ReviewsController < ApplicationController
       return
     end
     
-    @dashboard_configuration=Api::DashboardConfiguration.new(nil, :period_index => params[:period], :snapshot => @snapshot) if params[:period]
+    @dashboard_configuration=Api::DashboardConfiguration.new(nil, :period_index => params[:period], :snapshot => @snapshot)
     render :partial => 'project/widgets/reviews/reviews_list'
   end
 
index f7605f0deb8cff55ef416b22dd58493929d4087a..3e00d19ce67334d007649c6e223ffe83b2743eca 100644 (file)
@@ -54,6 +54,7 @@
             <%= total_number -%> <%= message('results').downcase -%>
                <% 
                  if page_count
+                   page_count = 20 if page_count>20
                    link_params = {}
                    link_params[:controller] = 'reviews'
                    link_params[:action] = 'widget_reviews_list'
                    link_params[:period] = params[:period]
                %>
                  |
-                 <%=link_to_remote (message('paging_previous'),
+                 <%= link_to_remote(message('paging_previous'),
                                      :update => "reviews-widget-#{widget_id}",
                                      :url => {:params => link_params.merge({:page_id => page_id-1})})  if page_id>1 %>
                  <%= message('paging_previous') unless page_id>1 %>
                  <% for index in 1..page_count %>
                    <%= index.to_s if index==page_id %>
-                   <%=link_to_remote (index.to_s,
+                   <%= link_to_remote(index.to_s,
                                       :update => "reviews-widget-#{widget_id}",
                                       :url => {:params => link_params.merge({:page_id => index})}) unless index==page_id %>
                  <% end %>
-                 <%=link_to_remote (message('paging_next'),
+                 <%= link_to_remote(message('paging_next'),
                                      :update => "reviews-widget-#{widget_id}", 
                                      :url => {:params => link_params.merge({:page_id => page_id+1})}) if page_id<page_count %>
                  <%= message('paging_next') unless page_id<page_count %>
index 31f0acbb95c1edac8a6e93fbf0084a9aa70df47b..8f515c64eeef5dedaa515c8a8ad2790d46123545 100644 (file)
@@ -103,8 +103,20 @@ function launchSearch(columnName, link) {
      if @reviews && !@reviews.empty?
   %>
     <% if @false_positives=='only' %>
-    <div style="color:#777777; font-size:93%; padding: 4px 0px 4px 10px;"><span class="falsePositive"><%= message('reviews.showing_false_positives_only') -%></span></div>
+      <div style="color:#777777; font-size:93%; padding: 4px 0px 4px 10px;"><span class="falsePositive"><%= message('reviews.showing_false_positives_only') -%></span></div>
     <% end %>
+    <% 
+      if params[:from] && params[:to]
+        from = Time.parse(params[:from])
+        to = Time.parse(params[:to])
+    %>
+      <div style="color:#777777; font-size:93%; padding: 4px 0px 4px 10px;">
+        <span style="background-color: #FFF6BF; padding-left: 5px; padding-right: 5px;">
+          <%= message('reviews.reviews_filtered_by_date_x_to_y', :params => [l(from, :format => '%d %B %Y'), l(to, :format => '%d %B %Y')] ) -%>
+        </span>
+      </div>
+    <% end %>
+    
     <table id="reviews-list" class="data width100">
       <thead>
       <tr>