Rename var
This commit is contained in:
parent
59dc5d94c2
commit
9cf986ad4c
1 changed files with 11 additions and 11 deletions
|
@ -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)
|
||||
|
|
Reference in a new issue