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

move create button form header to subheader in versions pages

Behrokh Satarnejad400c3ccd5d31
diff --git a/app/views/projects/settings/versions/show.html.erb b/app/views/projects/settings/versions/show.html.erb
index a03e5462848..7b97ddfe464 100644
--- a/app/views/projects/settings/versions/show.html.erb
+++ b/app/views/projects/settings/versions/show.html.erb
@@ -26,7 +26,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See COPYRIGHT and LICENSE files for more details.
++#%>
-
<%=
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { t(:label_version_plural) }
@@ -34,21 +33,22 @@ See COPYRIGHT and LICENSE files for more details.
{ 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 current_user.allowed_in_project?(:manage_versions, @project) %>
+ <%= render(Primer::OpenProject::SubHeader.new) do |subheader|
+ subheader.with_action_button(scheme: :primary,
+ 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) %>
diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb
index d80e65189e2..c7f84a0435f 100644
--- a/app/views/versions/index.html.erb
+++ b/app/views/versions/index.html.erb
@@ -33,19 +33,20 @@ See COPYRIGHT and LICENSE files for more details.
header.with_breadcrumbs( [{ href: project_overview_path(@project.id), text: @project.name },
t(:label_roadmap)
])
- 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
%>
+<%= render(Primer::OpenProject::SubHeader.new) do |subheader|
+ subheader.with_action_button(scheme: :primary,
+ 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 %>
+
<% if @versions.empty? %>
<%= no_results_box %>
<% else %>