Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

1.2 KB
Raw Blame
<%
  erroneous_results = service_result.results_with_errors(include_self: false)
  error_count = erroneous_results.count
  total_count = service_result.dependent_results.map(&:result).uniq.count
  selected_count = selected_work_packages.count
%>

<% if total_count - error_count == 0 %>
  <%= t(
        "work_packages.bulk.none_could_be_saved",
        total: total_count
      ) %>
<% else %>
  <%= t(
        "work_packages.bulk.x_out_of_y_could_be_saved",
        failing: error_count,
        total: total_count,
        success: total_count - error_count
      ) %>

  <%= t("work_packages.bulk.could_not_be_saved") %>
<% end %>

<% if selected_count < total_count %>
  <%= t(
        "work_packages.bulk.selected_because_descendants",
        total: total_count,
        selected: selected_count
      ) %>
<% end %>

<ul>
  <% erroneous_results.each do |call| %>
    <% wp_id = call.state.copied_from_work_package_id || call.result.id %>

    <li>
      <%= link_to "##{wp_id}", work_package_path(wp_id) %><%= selected_work_packages.map(&:id).include?(wp_id) ? "" : " (#{I18n.t('work_packages.bulk.descendant')})" %>:
      <%= safe_join call.errors.full_messages, " " %>
    </li>
  <% end %>
</ul>