Clean up tab_helper.rb code
This commit is contained in:
parent
cbea0af290
commit
fb4b571fa6
1 changed files with 4 additions and 10 deletions
|
@ -12,23 +12,17 @@ module TabHelper
|
||||||
return "current" if current_page?(:controller => "projects", :action => action, :id => @project)
|
return "current" if current_page?(:controller => "projects", :action => action, :id => @project)
|
||||||
end
|
end
|
||||||
|
|
||||||
if controller.controller_name == "snippets" ||
|
if ['snippets', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name
|
||||||
controller.controller_name == "hooks" ||
|
|
||||||
controller.controller_name == "deploy_keys" ||
|
|
||||||
controller.controller_name == "team_members"
|
|
||||||
"current"
|
"current"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def tree_tab_class
|
def tree_tab_class
|
||||||
controller.controller_name == "refs" ?
|
controller.controller_name == "refs" ? "current" : nil
|
||||||
"current" : nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def commit_tab_class
|
def commit_tab_class
|
||||||
if controller.controller_name == "commits" ||
|
if ['commits', 'repositories', 'protected_branches'].include? controller.controller_name
|
||||||
controller.controller_name == "repositories" ||
|
|
||||||
controller.controller_name == "protected_branches"
|
|
||||||
"current"
|
"current"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -37,7 +31,7 @@ module TabHelper
|
||||||
if current_page?(branches_project_repository_path(@project)) ||
|
if current_page?(branches_project_repository_path(@project)) ||
|
||||||
controller.controller_name == "protected_branches" ||
|
controller.controller_name == "protected_branches" ||
|
||||||
current_page?(project_repository_path(@project))
|
current_page?(project_repository_path(@project))
|
||||||
'active'
|
'active'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue