1
0
Fork 0

Rename var

This commit is contained in:
Alex Kotov 2019-08-15 12:32:34 +05:00
parent 59dc5d94c2
commit 9cf986ad4c
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -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)