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 budget show page

Behrokh Satarnejad4e7d69307ca0
diff --git a/modules/budgets/app/views/budgets/show.html.erb b/modules/budgets/app/views/budgets/show.html.erb
index 091bdfc329d..ada6c333fb3 100644
--- a/modules/budgets/app/views/budgets/show.html.erb
+++ b/modules/budgets/app/views/budgets/show.html.erb
@@ -26,34 +26,54 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See COPYRIGHT and LICENSE files for more details.
++#%>
-
<% html_title "#{t(:label_budget_id, id: @budget.id)}: #{@budget.subject}" %>
-<%= toolbar title: t(:label_budget_id, id: @budget.id) do %>
- <% if authorize_for(:budgets, :edit) %>
- <li class="toolbar-item">
- <%= link_to({ controller: 'budgets', action: 'edit', id: @budget }, class: 'button', accesskey: accesskey(:edit)) do %>
- <%= op_icon('button--icon icon-edit') %>
- <span class="button--text"><%= t(:button_update) %></span>
- <% end %>
- </li>
- <% end %>
- <% if authorize_for(:budgets, :copy) %>
- <li class="toolbar-item hidden-for-tablet">
- <%= link_to({ controller: 'budgets', action: 'copy', id: @budget }, class: 'button') do %>
- <%= op_icon('button--icon icon-copy') %>
- <span class="button--text"><%= t(:button_copy) %></span>
- <% end %>
- </li>
- <% end %>
- <% if authorize_for(:budgets, :destroy) %>
- <li class="toolbar-item">
- <%= link_to({ controller: 'budgets', action: 'destroy', id: @budget }, class: 'button', method: :delete) do %>
- <%= op_icon('button--icon icon-delete') %>
- <span class="button--text"><%= t(:button_delete) %></span>
- <% end %>
- </li>
- <% end %>
-<% end %>
+
+<%=
+ render(Primer::OpenProject::PageHeader.new) do |header|
+ header.with_title { t(:label_budget_id, id: @budget.id) }
+ header.with_breadcrumbs([{ href: project_overview_path(@project.id), text: @project.name },
+ { href: projects_budgets_path(@project.id), text: t(:label_budget_plural) },
+ t(:label_budget_id, id: @budget.id)])
+
+ if authorize_for(:budgets, :edit)
+ header.with_action_button(tag: :a,
+ mobile_icon: :pencil,
+ mobile_label: t(:button_edit),
+ size: :medium,
+ href: url_for({ controller: 'budgets', action: 'edit', id: @budget }),
+ aria: { label: t(:button_update) },
+ title: t(:button_update)) do |button|
+ button.with_leading_visual_icon(icon: :pencil)
+ t(:button_update)
+ end
+ end
+ if authorize_for(:budgets, :copy)
+ header.with_action_button(tag: :a,
+ mobile_icon: :copy,
+ mobile_label: t(:button_copy),
+ size: :medium,
+ href: url_for({ controller: 'budgets', action: 'copy', id: @budget }),
+ aria: { label: I18n.t(:button_copy) },
+ title: I18n.t(:button_copy)) do |button|
+ button.with_leading_visual_icon(icon: :copy)
+ t(:button_copy)
+ end
+ end
+ if authorize_for(:budgets, :destroy)
+ header.with_action_button(tag: :a,
+ scheme: :danger,
+ mobile_icon: :trash,
+ mobile_label: t(:button_delete),
+ size: :medium,
+ href: url_for({ controller: 'budgets', action: 'destroy', id: @budget }),
+ aria: { label: I18n.t(:button_delete) },
+ title: I18n.t(:button_delete)) do |button|
+ button.with_leading_visual_icon(icon: :trash)
+ t(:button_delete)
+ end
+ end
+ end
+%>
<div class="<%= @budget.css_classes %> details">
<h3><%=h @budget.subject %></h3>