Commit fb4b571fa66f985bb9366944f63481c9937b5523

Authored by Andrey Vakarev
1 parent cbea0af2

Clean up tab_helper.rb code

Showing 1 changed file with 4 additions and 10 deletions   Show diff stats
app/helpers/tab_helper.rb
@@ -12,23 +12,17 @@ module TabHelper @@ -12,23 +12,17 @@ module TabHelper
12 return "current" if current_page?(:controller => "projects", :action => action, :id => @project) 12 return "current" if current_page?(:controller => "projects", :action => action, :id => @project)
13 end 13 end
14 14
15 - if controller.controller_name == "snippets" ||  
16 - controller.controller_name == "hooks" ||  
17 - controller.controller_name == "deploy_keys" ||  
18 - controller.controller_name == "team_members" 15 + if ['snippets', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name
19 "current" 16 "current"
20 end 17 end
21 end 18 end
22 19
23 def tree_tab_class 20 def tree_tab_class
24 - controller.controller_name == "refs" ?  
25 - "current" : nil 21 + controller.controller_name == "refs" ? "current" : nil
26 end 22 end
27 23
28 def commit_tab_class 24 def commit_tab_class
29 - if controller.controller_name == "commits" ||  
30 - controller.controller_name == "repositories" ||  
31 - controller.controller_name == "protected_branches" 25 + if ['commits', 'repositories', 'protected_branches'].include? controller.controller_name
32 "current" 26 "current"
33 end 27 end
34 end 28 end
@@ -37,7 +31,7 @@ module TabHelper @@ -37,7 +31,7 @@ module TabHelper
37 if current_page?(branches_project_repository_path(@project)) || 31 if current_page?(branches_project_repository_path(@project)) ||
38 controller.controller_name == "protected_branches" || 32 controller.controller_name == "protected_branches" ||
39 current_page?(project_repository_path(@project)) 33 current_page?(project_repository_path(@project))
40 - 'active' 34 + 'active'
41 end 35 end
42 end 36 end
43 end 37 end