summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-12-14 17:37:08 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2011-12-14 17:37:08 +0100
commitcd19885928f5aae1e8b1663eb45dd301b46ccb49 (patch)
tree4f5462811de2756e2d5810726630d53119bf8d4a /plugins
parente8a499ef6872dff2a66d36c594fcc7e066db8ae5 (diff)
downloadsonarqube-cd19885928f5aae1e8b1663eb45dd301b46ccb49.tar.gz
sonarqube-cd19885928f5aae1e8b1663eb45dd301b46ccb49.zip
SONAR-2984 review widgets must not fail if reviews have no comments
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/project_reviews.html.erb52
1 files changed, 27 insertions, 25 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/project_reviews.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/project_reviews.html.erb
index 84a76981c3b..2d89c60c43e 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/project_reviews.html.erb
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/reviews/project_reviews.html.erb
@@ -1,31 +1,33 @@
-<%
- if has_role?(:user, @project)
- limit = widget_properties["numberOfLines"].to_i == 0 ? 5 : widget_properties["numberOfLines"].to_i
-
- if @dashboard_configuration.selected_period?
- from_date = @dashboard_configuration.from_datetime
- to_date = DateTime.now
- end
+<%
+ if has_role?(:user, @project)
+ limit = widget_properties["numberOfLines"].to_i == 0 ? 5 : widget_properties["numberOfLines"].to_i
+
+ from_date=nil
+ to_date=nil
+ if @dashboard_configuration.selected_period?
+ from_date = @dashboard_configuration.from_datetime
+ to_date = DateTime.now
+ end
%>
-<div class="line-block">
- <div style="float:right">
- <a href="<%= url_for :controller => 'reviews', :action => 'index', :projects => [@project.id],
- :assignee_login => '', :from => from_date, :to => to_date -%>">
- <%= message('widgets.more') -%>
- </a>
+ <div class="line-block">
+ <div style="float:right">
+ <a href="<%= url_for :controller => 'reviews', :action => 'index', :projects => [@project.id],
+ :assignee_login => '', :from => from_date, :to => to_date -%>">
+ <%= message('widgets.more') -%>
+ </a>
+ </div>
+ <h3><%= message('widget.project_reviews.name') -%></h3>
</div>
- <h3><%= message('widget.project_reviews.name') -%></h3>
-</div>
-<div id="reviews-widget-<%= widget.id -%>">
- <%= render :partial => 'project/widgets/reviews/reviews_list',
- :locals => {:assignee_login => '',
- :project_key => @project.key,
- :statuses => 'OPEN,REOPENED',
- :resolution => '',
- :limit => limit,
- :widget_id => widget.id.to_s} %>
-</div>
+ <div id="reviews-widget-<%= widget.id -%>">
+ <%= render :partial => 'project/widgets/reviews/reviews_list',
+ :locals => {:assignee_login => '',
+ :project_key => @project.key,
+ :statuses => 'OPEN,REOPENED',
+ :resolution => '',
+ :limit => limit,
+ :widget_id => widget.id.to_s} %>
+ </div>
<% end %>