diff --git a/app/helpers/navs_helper.rb b/app/helpers/navs_helper.rb index 480823c..7c0b3ac 100644 --- a/app/helpers/navs_helper.rb +++ b/app/helpers/navs_helper.rb @@ -6,41 +6,41 @@ module NavsHelper pills: 'nav nav-pills d-flex d-sm-none flex-column', }.freeze - def nav_tabs(scope_name, current_tab_name, options) + def nav_tabs(scope_name, active_tab_name, options) capture do - concat nav_tabs_list scope_name, current_tab_name, :tabs, options - concat nav_tabs_list scope_name, current_tab_name, :pills, options + concat nav_tabs_list scope_name, active_tab_name, :tabs, options + concat nav_tabs_list scope_name, active_tab_name, :pills, options end end - def nav_sidebar(scope_name, current_tab_name, options) + def nav_sidebar(scope_name, active_tab_name, options) tag.div class: 'list-group' do options.each do |(k, v)| - concat nav_sidebar_item scope_name, current_tab_name, k, *v + concat nav_sidebar_item scope_name, active_tab_name, k, *v end end end - def nav_tabs_list(scope_name, current_tab_name, format, options) + def nav_tabs_list(scope_name, active_tab_name, format, options) tag.ul class: NAV_TABS_LIST_HTML_CLASS[format] do options.each do |(k, v)| - concat nav_tabs_item scope_name, current_tab_name, k, *v + concat nav_tabs_item scope_name, active_tab_name, k, *v end end end - def nav_tabs_item(scope_name, current_tab_name, tab_name, policy, url) + def nav_tabs_item(scope_name, active_tab_name, tab_name, policy, url) tag.li class: 'nav-item' do link_to translate(tab_name, scope: [:nav_tabs, scope_name]), url, - nav_tab_link_options(policy, tab_name == current_tab_name) + nav_tab_link_options(policy, tab_name == active_tab_name) end end - def nav_sidebar_item(scope_name, current_tab_name, tab_name, policy, url) + def nav_sidebar_item(scope_name, active_tab_name, tab_name, policy, url) link_to translate(tab_name, scope: [:nav_tabs, scope_name]), url, - nav_sidebar_link_options(policy, tab_name == current_tab_name) + nav_sidebar_link_options(policy, tab_name == active_tab_name) end def nav_tab_link_options(policy, active)