]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5157 Add a link to the Quality Gate in the Description widget
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 23 Apr 2014 09:27:05 +0000 (11:27 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 23 Apr 2014 09:27:11 +0000 (11:27 +0200)
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/description.html.erb
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 329f301139a0ab2bea5514def3ec337b2f659d73..2032027f451fdaef5dd5c0b9d29370bb79b46f70 100644 (file)
       <td><span id="resource_profile"><%= link_to profile_measure.data, {:controller => '/rules_configuration', :action => 'index', :id => profile_measure.value.to_i}, :id => 'profile_link' -%></span> (<%= message('widget.description.profile_version_x', :params => format_measure('profile_version', :default => '1')) -%>)</td>
     </tr>
     <% end %>
+    <%
+      using_default=false
+      quality_gate=Property.value('sonar.qualitygate', @resource && @resource.id, nil)
+      unless quality_gate
+        quality_gate=Property.value('sonar.qualitygate', nil, nil)
+        using_default=false || quality_gate
+      end
+      if quality_gate
+        qgate = Internal.quality_gates.get(quality_gate.to_i)
+    %>
+    <tr>
+      <td><%= message('widget.description.qualitygate') -%>:</td>
+      <td><span id="resource_qgate"><%= link_to qgate.getName(), (url_for :controller => '/quality_gates') + '#show/' + quality_gate, :id => 'qgate_link' -%>
+        <% if using_default %>
+          <span class="subtitle">(<%= message('default') -%>)</span>
+        <% end %>
+        </span>
+      </td>
+    </tr>
+    <% end %>
     <% unless @project.project_links.empty? %>
       <tr>
         <td valign="top"><%= message('widget.description.links') -%>: </td>
@@ -44,4 +64,4 @@
     <% end %>
     </tbody>
   </table>
-</div>
\ No newline at end of file
+</div>
index c9a1ae7140ad955f4f1164b2552a46b2a0fad09c..fc43b1470e4e46567a9e7b998f8edce3d12a04a1 100644 (file)
@@ -1053,6 +1053,7 @@ widget.description.key=Key
 widget.description.language=Language
 widget.description.profile=Profile
 widget.description.profile_version_x=version {0}
+widget.description.qualitygate=Quality Gate
 widget.description.alerts=Displays a summary of the project's quality gate status.
 widget.description.alerts_rss_feed=RSS Feed
 widget.description.links=Links