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

update page header in new versions page

Behrokh Satarnejada2ed799e4f0a
diff --git a/app/views/projects/settings/versions/show.html.erb b/app/views/projects/settings/versions/show.html.erb
index aad2ca59bc9..a03e5462848 100644
--- a/app/views/projects/settings/versions/show.html.erb
+++ b/app/views/projects/settings/versions/show.html.erb
@@ -27,19 +27,27 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
-<%= toolbar title: t(:label_version_plural) do %>
- <% if current_user.allowed_in_project?(:manage_versions, @project) %>
- <li class="toolbar-item">
- <%= link_to_if_authorized({ controller: '/versions', action: 'new', project_id: @project },
- { class: 'button -primary',
- aria: {label: t(:label_version_new)},
- title: t(:label_version_new)}) do %>
- <%= op_icon('button--icon icon-add') %>
- <span class="button--text"><%= t('activerecord.models.version') %></span>
- <% end %>
- </li>
- <% end %>
-<% end %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t(:label_version_plural) }
+ header.with_breadcrumbs( [{ href: project_overview_path(@project.id), text: @project.name },
+ { href: project_settings_general_path(@project.id), text: I18n.t("label_project_settings") },
+ t(:label_version_plural)
+ ])
+ if current_user.allowed_in_project?(:manage_versions, @project)
+ header.with_action_button(scheme: :primary,
+ mobile_icon: :plus,
+ mobile_label: t(:label_version_new),
+ aria: { label: t(:label_version_new) },
+ title: t(:label_version_new),
+ tag: :a,
+ href: url_for({ controller: '/versions', action: 'new', project_id: @project })) do |button|
+ button.with_leading_visual_icon(icon: :plus)
+ t('activerecord.models.version')
+ end
+ end
+ end
+%>
<% if @versions.any? %>
<%= render Versions::TableComponent.new(rows: @versions, project: @project) %>