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

974 B
Raw Blame
<%
  default_form = Class.new(ApplicationForm) do
    form do |f|
      f.text_field(
        name: :ultimate_answer,
        label: "Ultimate answer",
        required: true,
        caption: "The answer to life, the universe, and everything",
        input_width: :medium
      )

      f.select_list(
        name: "cities",
        label: "Cool cities",
        caption: "Select your favorite!",
        include_blank: true,
        input_width: :small
      ) do |city_list|
        city_list.option(label: "Lopez Island", value: "lopez_island")
        city_list.option(label: "Bellevue", value: "bellevue")
        city_list.option(label: "Seattle", value: "seattle")
      end
    end
  end
%>

<%=
  render(Primer::OpenProject::CollapsibleSection.new) do |component|
    component.with_title { "A collapsible form" }
    component.with_collapsible_content do
      primer_form_with(url: "/foo") do |f|
        render(default_form.new(f))
      end
    end
  end
%>