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
<%=
component_wrapper do
  flex_layout(data: wrapper_data_attributes) do |flex|
    flex.with_row do
      render(Primer::OpenProject::SubHeader.new) do |subheader|
        subheader.with_action_button(
          scheme: :primary,
          leading_icon: :plus,
          label: t(:button_add),
          tag: :a,
          href: helpers.url_for(action: :new),
          test_selector: "add-enumeration-button"
        ) do
          I18n.t(:button_add)
        end
      end
    end

    flex.with_row do
      render(border_box_container(data: drop_target_config)) do |component|
        component.with_header(font_weight: :bold) { enumeration_class.model_name.human(count: :other) }

        if enumerations.empty?
          component.with_row do
            render(Primer::Beta::Text.new(color: :subtle)) { t(:no_results_title_text) }
          end
        else
          enumerations.each do |enumeration|
            component.with_row(test_selector: "enumeration-row-#{enumeration.id}", data: draggable_item_config(enumeration)) do
              render(item_component_class.new(enumeration: enumeration, max_position: max_position))
            end
          end
        end
      end
    end
  end
end
%>