mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-12 16:14:58 +08:00
Merge pull request #8794 from andrej-scinote/aj_SCI_12255
Fix settings menu link and order [SCI-12255]
This commit is contained in:
commit
f0220343b1
1 changed files with 5 additions and 13 deletions
|
@ -60,24 +60,16 @@ class NavigationsController < ApplicationController
|
|||
end
|
||||
|
||||
def settings_menu_links
|
||||
links = [
|
||||
{
|
||||
name: I18n.t('users.settings.sidebar.teams'), url: teams_path
|
||||
}, {
|
||||
name: I18n.t('users.settings.sidebar.groups'), url: users_settings_team_user_groups_path(current_team)
|
||||
}, {
|
||||
name: I18n.t('users.settings.sidebar.account_nav.addons'), url: addons_path
|
||||
}
|
||||
]
|
||||
|
||||
if can_create_acitivity_filters?
|
||||
links.push({ name: I18n.t('users.settings.sidebar.webhooks'), url: users_settings_webhooks_path })
|
||||
end
|
||||
links = [{ name: I18n.t('users.settings.sidebar.teams'), url: teams_path }]
|
||||
links << { name: I18n.t('users.settings.sidebar.groups'), url: users_settings_team_user_groups_path(current_team) } if can_manage_team?(current_team)
|
||||
links << { name: I18n.t('users.settings.sidebar.account_nav.addons'), url: addons_path }
|
||||
|
||||
private_methods.select { |i| i.to_s[/^settings_menu_links_[a-z]*_extension$/] }.each do |method|
|
||||
links = __send__(method, links)
|
||||
end
|
||||
|
||||
links << { name: I18n.t('users.settings.sidebar.webhooks'), url: users_settings_webhooks_path } if can_create_acitivity_filters?
|
||||
|
||||
links
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue