aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-06-03 11:16:23 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-06-03 11:16:23 +0200
commit507e8b9a0c214ca86722af265cb3fa81c3d0c09f (patch)
tree1e8e09d3197c8eda121a414ab57a4b9ba4118c40 /sonar-server/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb
parent6ce3ec7f1b3f0b3c1baf823037873bdd672af4e5 (diff)
downloadsonarqube-507e8b9a0c214ca86722af265cb3fa81c3d0c09f.tar.gz
sonarqube-507e8b9a0c214ca86722af265cb3fa81c3d0c09f.zip
SONAR-4315 Add Issue Action WS and add Action links to Issue detail
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb22
1 files changed, 19 insertions, 3 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb
index de7d6ba2812..7ea645906f3 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb
@@ -92,7 +92,9 @@
<%
transitions = Internal.issues.listTransitions(issue)
- if transitions.size > 0 && transitions.first
+
+ # Display only the first transition
+ if !transitions.empty? && transitions.first
transition = transitions.first
%>
<%= image_tag 'sep12.png' -%>
@@ -101,7 +103,10 @@
<% end %>
<%
- if transitions.size > 1 || !issue.resolution
+ plugin_actions = Internal.issues.listActions(issue)
+ puts "### "
+ shouldDisplayDropDown = transitions.size > 1 || !issue.resolution || !plugin_actions.empty?
+ if shouldDisplayDropDown
transitions.remove(0)
%>
<div class="dropdown">
@@ -112,11 +117,22 @@
<a href="#" onclick="return issueForm('severity', this)" class="link-action spacer-right"><%= message("issue.set_severity") -%></a>
</li>
<% end %>
- <% transitions.each do |transition| %>
+
+ <%
+ # Display remaining transitions
+ transitions.each do |transition| %>
<li>
<a href="#" onclick="return doIssueTransition(this, '<%= transition.key -%>')" class="link-action spacer-right"><%= message("issue.transition.#{transition.key}") -%></a>
</li>
<% end %>
+
+ <%
+ # Display actions defined by plugins
+ plugin_actions.each do |action| %>
+ <li>
+ <a href="#" onclick="return doPluginIssueAction(this, '<%= action.key -%>')" class="link-action spacer-right"><%= message("issue.action.#{action.key}.formlink") -%></a>
+ </li>
+ <% end %>
</ul>
</div>
<% end %>