2017-02-09 18:34:52 +08:00
|
|
|
module UserSettingsHelper
|
|
|
|
def on_settings_account_page?
|
|
|
|
controller_name == 'registrations' && action_name == 'edit' ||
|
2017-10-17 19:17:49 +08:00
|
|
|
controller_name == 'preferences' && action_name == 'index' ||
|
2019-11-28 06:16:25 +08:00
|
|
|
controller_name == 'addons' && action_name == 'index' ||
|
|
|
|
controller_name == 'connected_accounts'
|
2017-02-09 18:34:52 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
def on_settings_account_profile_page?
|
|
|
|
controller_name == 'registrations'
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_settings_account_preferences_page?
|
|
|
|
controller_name == 'preferences'
|
|
|
|
end
|
|
|
|
|
2017-10-17 19:17:49 +08:00
|
|
|
def on_settings_account_addons_page?
|
2023-05-09 17:20:53 +08:00
|
|
|
controller_name == 'addons' ||
|
|
|
|
(controller_name == 'label_printers' && action_name == 'index_zebra')
|
2017-10-17 19:17:49 +08:00
|
|
|
end
|
|
|
|
|
2017-02-09 18:34:52 +08:00
|
|
|
def on_settings_team_page?
|
2017-04-28 17:31:14 +08:00
|
|
|
controller_name.in?(%w(teams audits)) &&
|
|
|
|
action_name.in?(%w(index new create show audits_index))
|
2017-02-09 18:34:52 +08:00
|
|
|
end
|
2019-11-28 06:16:25 +08:00
|
|
|
|
2021-06-03 20:00:43 +08:00
|
|
|
def on_settings_webhook_page?
|
|
|
|
controller_name.in?(%w(webhooks)) &&
|
|
|
|
action_name.in?(%w(index))
|
|
|
|
end
|
|
|
|
|
2019-11-28 06:16:25 +08:00
|
|
|
def on_settings_account_connected_accounts_page?
|
|
|
|
controller_name == 'connected_accounts'
|
|
|
|
end
|
2017-02-09 18:34:52 +08:00
|
|
|
end
|