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

Add missing breadcrumbs and remove unnecessary ones

Henriette Dinger3ebe7f4d52de
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 946b062e0f0..639e1251b81 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -588,8 +588,8 @@ class ApplicationController < ActionController::Base
helper_method :show_local_breadcrumb
def admin_first_level_menu_entry
- current_menu_item = self.admin_menu_item(self.current_menu_item)
- current_menu_item.parent
+ menu_item = admin_menu_item(current_menu_item)
+ menu_item.parent
end
helper_method :admin_first_level_menu_entry
diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb
index 5d8d3d7eb5a..3e91fc6074b 100644
--- a/app/controllers/settings_controller.rb
+++ b/app/controllers/settings_controller.rb
@@ -85,7 +85,12 @@ class SettingsController < ApplicationController
end
def default_breadcrumb
- l(:label_system_settings)
+ if params[:action] == "plugin"
+ plugin = Redmine::Plugin.find(params[:id])
+ plugin.name
+ else
+ l(:label_system_settings)
+ end
end
def show_local_breadcrumb
diff --git a/app/views/attribute_help_texts/edit.html.erb b/app/views/attribute_help_texts/edit.html.erb
index e7bfc365ff7..449991cf5f6 100644
--- a/app/views/attribute_help_texts/edit.html.erb
+++ b/app/views/attribute_help_texts/edit.html.erb
@@ -28,9 +28,7 @@ See docs/COPYRIGHT.rdoc for more details.
++#%>
<% html_title t(:label_administration), l(:'attribute_help_texts.edit', attribute_caption: @attribute_help_text.attribute_caption) %>
-<% local_assigns[:additional_breadcrumb] = link_to(@attribute_help_text.type_caption,
- attribute_help_texts_path(tab: @attribute_help_text.attribute_scope)),
- t(:'attribute_help_texts.edit', attribute_caption: @attribute_help_text.attribute_caption) %>
+<% local_assigns[:additional_breadcrumb] = t(:'attribute_help_texts.edit', attribute_caption: @attribute_help_text.attribute_caption) %>
<%= breadcrumb_toolbar t(:'attribute_help_texts.edit', attribute_caption: @attribute_help_text.attribute_caption)
%>
diff --git a/app/views/attribute_help_texts/new.html.erb b/app/views/attribute_help_texts/new.html.erb
index 448a9ba7459..b84c126828f 100644
--- a/app/views/attribute_help_texts/new.html.erb
+++ b/app/views/attribute_help_texts/new.html.erb
@@ -28,9 +28,7 @@ See docs/COPYRIGHT.rdoc for more details.
++#%>
<% html_title t(:label_administration), t(:'attribute_help_texts.add_new') %>
-<% local_assigns[:additional_breadcrumb] = link_to(@attribute_help_text.type_caption,
- attribute_help_texts_path(tab: @attribute_help_text.attribute_scope)),
- t(:'attribute_help_texts.add_new') %>
+<% local_assigns[:additional_breadcrumb] = t(:'attribute_help_texts.add_new') %>
<%= breadcrumb_toolbar t(:'attribute_help_texts.add_new')
%>
diff --git a/app/views/oauth/applications/edit.html.erb b/app/views/oauth/applications/edit.html.erb
index 074cac3e76b..96dca0ab8c9 100644
--- a/app/views/oauth/applications/edit.html.erb
+++ b/app/views/oauth/applications/edit.html.erb
@@ -29,6 +29,7 @@ See docs/COPYRIGHT.rdoc for more details.
<% edit_label = "#{l(:label_edit)} #{@application.class.model_name.human} #{h(@application.name)}" %>
<% html_title(l(:label_administration), edit_label) -%>
+<% local_assigns[:additional_breadcrumb] = h(@application.name) %>
<%= breadcrumb_toolbar(edit_label) %>
<%= labelled_tabular_form_for @application,
diff --git a/app/views/oauth/applications/new.html.erb b/app/views/oauth/applications/new.html.erb
index f262cabeeaf..a706d85b107 100644
--- a/app/views/oauth/applications/new.html.erb
+++ b/app/views/oauth/applications/new.html.erb
@@ -28,6 +28,7 @@ See docs/COPYRIGHT.rdoc for more details.
++#%>
<% html_title l(:label_administration), t('oauth.application.new') %>
+<% local_assigns[:additional_breadcrumb] = t('oauth.application.new') %>
<%= breadcrumb_toolbar(t('oauth.application.new')) %>
<%= labelled_tabular_form_for @application,
diff --git a/app/views/oauth/applications/show.html.erb b/app/views/oauth/applications/show.html.erb
index 8beb1c75d48..08e4a2b72a6 100644
--- a/app/views/oauth/applications/show.html.erb
+++ b/app/views/oauth/applications/show.html.erb
@@ -27,6 +27,7 @@ See docs/COPYRIGHT.rdoc for more details.
++#%>
<% html_title t(:label_administration), t('oauth.application.singular'), h(@application.name) -%>
+<% local_assigns[:additional_breadcrumb] = h(@application.name) %>
<%= toolbar title: "#{t('oauth.application.singular')} - #{h(@application.name)}",
title_class: 'no-padding-bottom' do %>
diff --git a/modules/avatars/app/views/settings/_openproject_avatars.html.erb b/modules/avatars/app/views/settings/_openproject_avatars.html.erb
index d400279c59f..45a1127339e 100644
--- a/modules/avatars/app/views/settings/_openproject_avatars.html.erb
+++ b/modules/avatars/app/views/settings/_openproject_avatars.html.erb
@@ -1,5 +1,5 @@
<% manager = ::OpenProject::Avatars::AvatarManager %>
-<% html_title l(:label_administration), l(:label_plugins), 'Openproject Avatars' %>
+<% html_title l(:label_administration), 'Openproject Avatars' %>
<fieldset class="form--fieldset">
<legend class="form--fieldset-legend" title="<%= t 'avatars.label_gravatar' %>"><%= t 'avatars.label_gravatar' %></legend>
diff --git a/modules/backlogs/app/views/shared/_settings.html.erb b/modules/backlogs/app/views/shared/_settings.html.erb
index 29d6bb5c878..30cfdf0a4c6 100644
--- a/modules/backlogs/app/views/shared/_settings.html.erb
+++ b/modules/backlogs/app/views/shared/_settings.html.erb
@@ -59,7 +59,7 @@ See docs/COPYRIGHT.rdoc for more details.
});
</script>
<% end %>
-<% html_title l(:label_administration), l(:label_plugins), l(:label_backlogs) %>
+<% html_title l(:label_administration), l(:label_backlogs) %>
<div class="form--field">
<%= styled_label_tag("settings[story_types]", l(:backlogs_story_type)) %>
diff --git a/modules/costs/app/views/settings/_openproject_costs.html.erb b/modules/costs/app/views/settings/_openproject_costs.html.erb
index f20006c7712..74863026acb 100644
--- a/modules/costs/app/views/settings/_openproject_costs.html.erb
+++ b/modules/costs/app/views/settings/_openproject_costs.html.erb
@@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See docs/COPYRIGHT.rdoc for more details.
++#%>
-<% html_title l(:label_administration), l(:label_plugins), 'Openproject Costs' %>
+<% html_title l(:label_administration), 'Openproject Costs' %>
<div class="form--field">
<%= styled_label_tag :label_currency, t(:label_currency) %>
<div class="form--field-container">
diff --git a/modules/ldap_groups/app/controllers/ldap_groups/synchronized_groups_controller.rb b/modules/ldap_groups/app/controllers/ldap_groups/synchronized_groups_controller.rb
index ff134c26f62..398de5791f2 100644
--- a/modules/ldap_groups/app/controllers/ldap_groups/synchronized_groups_controller.rb
+++ b/modules/ldap_groups/app/controllers/ldap_groups/synchronized_groups_controller.rb
@@ -77,7 +77,15 @@ module LdapGroups
end
def default_breadcrumb
- t('ldap_groups.synchronized_groups.plural')
+ if action_name == 'index'
+ t('ldap_groups.synchronized_groups.plural')
+ else
+ ActionController::Base.helpers.link_to(t('ldap_groups.synchronized_groups.plural'), ldap_groups_synchronized_groups_path)
+ end
+ end
+
+ def show_local_breadcrumb
+ true
end
end
end
diff --git a/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/new.html.erb b/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/new.html.erb
index a9d4733cc55..b83c9d67bd6 100644
--- a/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/new.html.erb
+++ b/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/new.html.erb
@@ -1,3 +1,4 @@
+<% local_assigns[:additional_breadcrumb] = t('ldap_groups.synchronized_groups.add_new') %>
<% html_title(t(:label_administration), t('ldap_groups.synchronized_groups.add_new')) -%>
<%= error_messages_for @group %>
diff --git a/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb b/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb
index fbd93b08442..9fadc287768 100644
--- a/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb
+++ b/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb
@@ -85,5 +85,15 @@ module OpenIDConnect
Provider::ALLOWED_TYPES.dup - providers.map(&:name)
end
helper_method :openid_connect_providers_available_for_configure
+
+ def default_breadcrumb
+ if action_name != 'index'
+ ActionController::Base.helpers.link_to(t('openid_connect.providers.plural'), openid_connect_providers_path)
+ end
+ end
+
+ def show_local_breadcrumb
+ true
+ end
end
end
diff --git a/modules/openid_connect/app/views/openid_connect/providers/edit.html.erb b/modules/openid_connect/app/views/openid_connect/providers/edit.html.erb
index 4d327ab0d8d..02bbbf6dc27 100644
--- a/modules/openid_connect/app/views/openid_connect/providers/edit.html.erb
+++ b/modules/openid_connect/app/views/openid_connect/providers/edit.html.erb
@@ -1,9 +1,7 @@
<% page_title = t('openid_connect.providers.label_edit', name: @provider.name) %>
+<% local_assigns[:additional_breadcrumb] = @provider.name %>
+
<% html_title(t(:label_administration), page_title) -%>
-<% local_assigns[:additional_breadcrumb] = [
- link_to(t('openid_connect.providers.plural'), url_for(action: :index)),
- page_title
-] %>
<%= toolbar title: page_title %>
diff --git a/modules/openid_connect/app/views/openid_connect/providers/new.html.erb b/modules/openid_connect/app/views/openid_connect/providers/new.html.erb
index a89346da6a2..ca9a4a29c57 100644
--- a/modules/openid_connect/app/views/openid_connect/providers/new.html.erb
+++ b/modules/openid_connect/app/views/openid_connect/providers/new.html.erb
@@ -1,9 +1,5 @@
<% html_title(t(:label_administration), t('openid_connect.providers.label_add_new')) -%>
-<% local_assigns[:additional_breadcrumb] = [
- link_to(t('openid_connect.providers.plural'), openid_connect_providers_path),
- t('openid_connect.providers.label_add_new')
- ]
-%>
+<% local_assigns[:additional_breadcrumb] = t('openid_connect.providers.label_add_new') %>
<%= toolbar title: t('openid_connect.providers.label_add_new') %>
diff --git a/modules/recaptcha/app/controllers/recaptcha/admin_controller.rb b/modules/recaptcha/app/controllers/recaptcha/admin_controller.rb
index 302a5b201fe..10d927e525b 100644
--- a/modules/recaptcha/app/controllers/recaptcha/admin_controller.rb
+++ b/modules/recaptcha/app/controllers/recaptcha/admin_controller.rb
@@ -34,5 +34,13 @@ module ::Recaptcha
def permitted_params
params.permit(:recaptcha_type, :website_key, :secret_key)
end
+
+ def default_breadcrumb
+ t('recaptcha.label_recaptcha')
+ end
+
+ def show_local_breadcrumb
+ true
+ end
end
end
diff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/two_factor_settings_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/two_factor_settings_controller.rb
index 251502974c4..32c7ae82465 100644
--- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/two_factor_settings_controller.rb
+++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/two_factor_settings_controller.rb
@@ -58,5 +58,13 @@ module ::TwoFactorAuthentication
def manager
::OpenProject::TwoFactorAuthentication::TokenStrategyManager
end
+
+ def default_breadcrumb
+ t('two_factor_authentication.settings.title')
+ end
+
+ def show_local_breadcrumb
+ true
+ end
end
end
diff --git a/spec/views/layouts/admin.html.erb_spec.rb b/spec/views/layouts/admin.html.erb_spec.rb
index 86879bf15a7..4fef9b436d2 100644
--- a/spec/views/layouts/admin.html.erb_spec.rb
+++ b/spec/views/layouts/admin.html.erb_spec.rb
@@ -39,6 +39,10 @@ describe 'layouts/admin', type: :view do
allow(view).to receive(:default_breadcrumb)
allow(controller).to receive(:default_search_scope)
+ parent_menu_item = Object.new
+ allow(view).to receive(:admin_first_level_menu_entry).and_return parent_menu_item
+ allow(parent_menu_item).to receive(:name).and_return :root
+
allow(User).to receive(:current).and_return admin
allow(view).to receive(:current_user).and_return admin
allow(view)