diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-10-29 17:05:09 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-10-29 17:05:09 +0100 |
commit | cf8b89e598f53cefd01cdb45a0c67ad53b473ab5 (patch) | |
tree | fb60acda92f4d942b66f421663b18d743c36533d /sonar-server | |
parent | 1cf660f5361e96f5282d9e32caf4047d2b9bdb60 (diff) | |
download | sonarqube-cf8b89e598f53cefd01cdb45a0c67ad53b473ab5.tar.gz sonarqube-cf8b89e598f53cefd01cdb45a0c67ad53b473ab5.zip |
improve way to display remaining transitions on issue modal window
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb | 18 |
1 files changed, 8 insertions, 10 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 068f3feeead..77bbe090616 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 @@ -118,19 +118,17 @@ # Display only the first transition if !transitions.empty? && transitions.first - transition = transitions.first + first_transition = transitions.first %> <img src="<%= ApplicationController.root_context -%>/images/sep12.png"/> - <a href="#" onclick="return doIssueTransition(this, '<%= transition.key -%>')" class="link-action spacer-right"><%= message("issue.transition.#{transition.key}") -%></a> + <a href="#" onclick="return doIssueTransition(this, '<%= first_transition.key -%>')" class="link-action spacer-right"><%= message("issue.transition.#{first_transition.key}") -%></a> <% end %> <% plugin_actions = Internal.issues.listActions(issue) shouldDisplayDropDown = transitions.size > 1 || !issue.resolution || !plugin_actions.empty? if shouldDisplayDropDown - # Remove first transition because it was displayed previsously - transitions.delete_at(0) if transitions.size > 1 %> <div class="dropdown"> <a href="#" class="link-action link-more" onclick="showDropdownMenuOnElement($j(this).next('.dropdown-menu')); return false;"><%= message('more_actions') -%></a> @@ -141,16 +139,16 @@ </li> <% end %> - <% - # Display remaining transitions - transitions.each do |transition| %> + <% # Display remaining transitions + if transitions.size > 1 + transitions[1..-1].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 %> + <% end + end %> - <% - # Display actions defined by plugins + <% # 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> |