Sha256: 68ebced006b7564c09734c6c1186cdb5e4e1199d2675e2b0f597095dea98f153

Contents?: true

Size: 1.4 KB

Versions: 3

Compression:

Stored size: 1.4 KB

Contents

<%= render Primer::OpenProject::PageHeader.new(state: in_edit_state ? :edit : :show) do |header| %>
  <%= header.with_title(variant: variant) do |t| %>
    <% if in_edit_state %>
      <%= t.with_editable_form(model: nil, update_path: "/foo", cancel_path: "/bar") %>
    <% end %>
    <%= title %>
  <% end %>
  <%= header.with_description { description } %>
  <%= header.with_leading_action(icon: with_leading_action, href: '#', 'aria-label': "A leading action") if with_leading_action && with_leading_action != :none %>
  <%= header.with_breadcrumbs(breadcrumb_items) %>
  <% if with_actions %>
    <% header.with_action_icon_button(icon: 'pencil', mobile_icon: 'pencil', label: 'Edit') %>
    <% header.with_action_menu(menu_arguments: { anchor_align: :end }, button_arguments: { icon: "op-kebab-vertical", "aria-label": "Menu" }) do |menu, button| %>
      <% menu.with_item(label: "Subitem 1") do |item| %>
        <% item.with_leading_visual_icon(icon: :unlock) %>
      <% end %>
      <% menu.with_item(label: "Subitem 2", scheme: :danger) do |item| %>
        <% item.with_leading_visual_icon(icon: :trash) %>
      <% end %>
    <% end %>
  <% end %>
  <% if with_tab_nav %>
    <% header.with_tab_nav(label: "label") do |nav| %>
      <% nav.with_tab(selected: true, href: "#") { "Tab 1" } %>
      <% nav.with_tab(href: "#") { "Tab 2" } %>
      <% nav.with_tab(href: "#") { "Tab 3" } %>
    <% end %>
  <% end %>
<% end %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
openproject-primer_view_components-0.49.2 previews/primer/open_project/page_header_preview/playground.html.erb
openproject-primer_view_components-0.49.1 previews/primer/open_project/page_header_preview/playground.html.erb
openproject-primer_view_components-0.49.0 previews/primer/open_project/page_header_preview/playground.html.erb