diff --git a/app/controllers/admin/settings_controller.rb b/app/controllers/admin/settings_controller.rb index 8fcb49a5311f..ae81c5fa823b 100644 --- a/app/controllers/admin/settings_controller.rb +++ b/app/controllers/admin/settings_controller.rb @@ -61,6 +61,18 @@ def update def show_plugin @partial = @plugin.settings[:partial] @settings = Setting["plugin_#{@plugin.id}"] + + page_title_key = @plugin.settings[:page_title_key] + @page_title = page_title_key ? I18n.t(page_title_key) : @plugin.name + + additional_breadcrumb_elements = @plugin.settings[:breadcrumb_elements] + if additional_breadcrumb_elements.present? + @breadcrumb_elements = if additional_breadcrumb_elements.respond_to?(:call) + instance_exec(&additional_breadcrumb_elements) + else + additional_breadcrumb_elements + end + end end def update_plugin diff --git a/app/views/admin/settings/show_plugin.html.erb b/app/views/admin/settings/show_plugin.html.erb index 1b0feba44eda..dfd8780a0fa4 100644 --- a/app/views/admin/settings/show_plugin.html.erb +++ b/app/views/admin/settings/show_plugin.html.erb @@ -27,7 +27,20 @@ See COPYRIGHT and LICENSE files for more details. ++#%> - <% html_title t(:label_administration), @plugin.name %> -<%= render partial: @partial, locals: {settings: @settings}%> +<%= + render(Primer::OpenProject::PageHeader.new) do |header| + header.with_title { @page_title } + header.with_breadcrumbs([{ href: admin_index_path, text: t("label_administration") }, + *(@breadcrumb_elements if @breadcrumb_elements.present?), + @page_title]) + end +%> + +