Files
openproject/app/components/workflows/table_component.html.erb
T

78 lines
2.9 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::Beta::BorderBox.new) do |component|
component.with_header do |header|
header.with_title(tag: :h2) do
Type.model_name.human
end
end
types.each do |type|
component.with_row(data: { "filter--filter-list-target": "searchItem" }) do
flex_layout(align_items: :center, justify_content: :space_between) do |type_row|
type_row.with_column do
link_to type.name, edit_workflow_path(type), class: "text-bold"
end
type_row.with_column do
render(Primer::Alpha::ActionMenu.new(test_selector: "op-action-menu")) do |menu|
menu.with_show_button(
icon: "kebab-horizontal",
scheme: :invisible,
"aria-label": "Actions"
)
menu.with_item(label:t("button_edit"),
tag: :a,
href: edit_workflow_path(type)) do |item|
item.with_leading_visual_icon(icon: :pencil)
end
menu.with_divider
menu.with_item(label: t("button_copy"),
content_arguments: { data: { controller: "async-dialog" }},
tag: :a,
href: new_workflow_copy_path(type)) do |item|
item.with_leading_visual_icon(icon: :copy)
end
end
end
end
end
end
if types.empty?
component.with_row do
render(Primer::Beta::Blankslate.new(border: false)) do |component|
component.with_heading(tag: :h2) { I18n.t(:label_nothing_display) }
component.with_description { I18n.t(:no_results_title_text) }
end
end
end
end
%>