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 pageheader and subheader in news page

Behrokh Satarnejadddc57b577d70
diff --git a/app/views/news/index.html.erb b/app/views/news/index.html.erb
index ba47943a1fe..8264d568e9b 100644
--- a/app/views/news/index.html.erb
+++ b/app/views/news/index.html.erb
@@ -30,20 +30,26 @@ See COPYRIGHT and LICENSE files for more details.
managable = User.current.allowed_in_project?(:manage_news, @project)
%>
-<% html_title(t(:label_news_plural)) -%>
-<%= toolbar title: t(:label_news_plural) do %>
- <% if managable %>
- <li class="toolbar-item">
- <%= link_to new_project_news_path(@project),
- { class: 'button -primary',
- id: 'new_news_link',
- aria: {label: t(:label_news_new)},
- title: t(:label_news_new)} do %>
- <%= op_icon('button--icon icon-add') %>
- <span class="button--text"><%= t(:label_news_singular) %></span>
- <% end %>
- </li>
- <% end %>
+<%=
+ render Primer::OpenProject::PageHeader.new do |header|
+ header.with_title { t(:label_news_plural) }
+ header.with_breadcrumbs([t(:label_news_plural)])
+ end
+%>
+<% if managable %>
+ <%=
+ render(Primer::OpenProject::SubHeader.new) do |subheader|
+ subheader.with_action_button(scheme: :primary,
+ aria: { label: t(:label_news_new)},
+ title: I18n.t(:label_work_package_status_new),
+ tag: :a,
+ id: 'new_news_link',
+ href: new_project_news_path(@project)) do |button|
+ button.with_leading_visual_icon(icon: :plus)
+ t(:label_news_singular)
+ end
+ end
+ %>
<% end %>
<% if @newss.any? %>