]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4445 Improve Plan action of issue detail to include "Unplan" in the select...
authorJulien Lancelot <julien.lancelot@gmail.com>
Wed, 10 Jul 2013 10:17:49 +0000 (12:17 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Wed, 10 Jul 2013 10:17:49 +0000 (12:17 +0200)
sonar-server/src/main/webapp/WEB-INF/app/views/issue/_plan_form.html.erb

index 879e6331dba1a647e514e00937b72b3b06cb9e6b..5c167cd23b248a3c39856bf6529d45af458bb735 100644 (file)
 <%
    else
      first_plan = plans[0]
-     plan_options = options_for_select(plans.map { |plan|
-       if plan.deadLine
-         label = "#{h plan.name} (#{format_date(plan.deadLine)})"
-       else
-         label = h plan.name
-       end
+     options = plans.map { |plan|
+       label = plan.deadLine ? "#{h plan.name} (#{format_date(plan.deadLine)})" : h(plan.name)
        [label, plan.key]
-     }, first_plan.key)
-
+     }
+     if @issue.actionPlanKey
+      options.unshift([escape_javascript(message('issue.unplan.submit')), ''])
+     end
+     plan_options = options_for_select(options, first_plan.key)
 %>
   <form method="POST">
     <input type="hidden" name="issue" value="<%= params[:issue] -%>"/>
 
     <input type="button" value="<%= message('issue.plan.submit') -%>" onclick="submitIssueForm(this)">
     &nbsp;
-    <% if @issue.actionPlanKey %>
-      <%= image_tag 'sep12.png' -%>
-      &nbsp;
-      <input type="button" value="<%= message('issue.unplan.submit') -%>"
-             onclick="$j('#action-<%= plans_select_box_id %>').val('unplan'); $j('#<%= plans_select_box_id -%>').prop('disabled', false); submitIssueForm(this)">
-    <% end %>
     <%= link_to_function message('cancel'), 'closeIssueForm(this)' -%>&nbsp;
     <span class="loading hidden"></span>