Files
openproject/app/components/work_packages/bulk_delete_dialog_component.html.erb
2026-04-19 21:10:41 +02:00

82 lines
3.2 KiB
Plaintext

<%#
-- copyright
OpenProject is an open source project management software.
Copyright (C) the OpenProject GmbH
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.
OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
Copyright (C) 2006-2013 Jean-Philippe Lang
Copyright (C) 2010-2013 the ChiliProject Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See COPYRIGHT and LICENSE files for more details.
++#
%>
<%=
render(
Primer::OpenProject::DangerDialog.new(
id:,
title:,
form_arguments: {
action: form_action,
method: :delete,
data: { turbo: false }
},
size: :medium_portrait
)
) do |dialog|
%>
<% dialog.with_confirmation_message do |message|
message.with_heading(tag: :h2) { heading }
message.with_description_content(description)
end %>
<% dialog.with_additional_details(display: :block) do %>
<% if multiple_projects? %>
<%= render(Primer::Alpha::Banner.new(mb: 2, scheme: :warning, icon: :alert)) do %>
<%= I18n.t("work_packages.bulk_delete_dialog.cross_project_warning", projects: project_names) %>
<% end %>
<% end %>
<%= render(OpPrimer::InsetBoxComponent.new) do %>
<% work_packages.each do |wp| %>
<%= render WorkPackages::InfoLineComponent.new(work_package: wp,
show_subject: true,
show_status: false,
show_project: multiple_projects?) %>
<% if descendants_for(wp).any? %>
<%= render(Primer::Box.new(pl: 2, my: 1)) do %>
<%= render(Primer::Beta::Text.new(mt: 1, font_size: :small, font_weight: :bold, display: :block, mb: 1)) do %>
<%= I18n.t("work_packages.bulk_delete_dialog.children_label") %>
<% end %>
<% descendants_for(wp).each do |descendant| %>
<%= render WorkPackages::InfoLineComponent.new(work_package: descendant,
show_subject: true,
show_status: false,
show_project: descendant.project != wp.project) %>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>
<% dialog.with_confirmation_check_box_content(confirmation_checkbox_text) %>
<% end %>