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 documents pages

Behrokh Satarnejad567c40190f72
diff --git a/modules/documents/app/views/documents/index.html.erb b/modules/documents/app/views/documents/index.html.erb
index 61cfb2268de..842896b2236 100644
--- a/modules/documents/app/views/documents/index.html.erb
+++ b/modules/documents/app/views/documents/index.html.erb
@@ -27,20 +27,30 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
-<%= toolbar title: t(:label_document_plural) do %>
- <% if authorize_for(:documents, :new) %>
- <li class="toolbar-item">
- <%= link_to({:controller => '/documents', :action => 'new', :project_id => @project},
- { class: 'button -primary',
- aria: {label: t(:label_document_new)},
- title: t(:label_document_new)}) do %>
- <%= op_icon('button--icon icon-add') %>
- <span class="button--text"><%= t('activerecord.models.document') %></span>
- <% end %>
- </li>
- <% end %>
+<%=
+ render(Primer::OpenProject::PageHeader.new) do |header|
+ header.with_title { t(:label_document_plural) }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ t(:label_document_plural)])
+ end
+%>
+
+<% if authorize_for(:documents, :new) %>
+ <%=
+ render(Primer::OpenProject::SubHeader.new) do |subheader|
+ subheader.with_action_button(scheme: :primary,
+ aria: { label: t(:label_document_new) },
+ title: t(:label_document_new),
+ tag: :a,
+ href: url_for({:controller => '/documents', :action => 'new', :project_id => @project})) do |button|
+ button.with_leading_visual_icon(icon: :plus)
+ t('activerecord.models.document')
+ end
+ end
+ %>
<% end %>
+
<% if @grouped.empty? %>
<%= no_results_box %>
<% end %>
diff --git a/modules/documents/app/views/documents/new.html.erb b/modules/documents/app/views/documents/new.html.erb
index e6dd45fdd91..2d8266a2cdf 100644
--- a/modules/documents/app/views/documents/new.html.erb
+++ b/modules/documents/app/views/documents/new.html.erb
@@ -26,7 +26,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See COPYRIGHT and LICENSE files for more details.
++#%>
-<%= toolbar title: t(:label_document_new) %>
+
+<%=
+ render(Primer::OpenProject::PageHeader.new) do |header|
+ header.with_title { t(:label_document_new) }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ { href: project_documents_path(@project.id), text: t(:label_document_plural) },
+ t(:label_document_new)])
+ end
+%>
+
<%= labelled_tabular_form_for @document, url: project_documents_path(@project), html: { multipart: true } do |f| -%>
<%= render :partial => 'documents/form', locals: { f: f } %>