Commit fb4b571fa66f985bb9366944f63481c9937b5523
1 parent
cbea0af2
Exists in
master
and in
4 other branches
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 | 12 | return "current" if current_page?(:controller => "projects", :action => action, :id => @project) |
13 | 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 | 16 | "current" |
20 | 17 | end |
21 | 18 | end |
22 | 19 | |
23 | 20 | def tree_tab_class |
24 | - controller.controller_name == "refs" ? | |
25 | - "current" : nil | |
21 | + controller.controller_name == "refs" ? "current" : nil | |
26 | 22 | end |
27 | 23 | |
28 | 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 | 26 | "current" |
33 | 27 | end |
34 | 28 | end |
... | ... | @@ -37,7 +31,7 @@ module TabHelper |
37 | 31 | if current_page?(branches_project_repository_path(@project)) || |
38 | 32 | controller.controller_name == "protected_branches" || |
39 | 33 | current_page?(project_repository_path(@project)) |
40 | - 'active' | |
34 | + 'active' | |
41 | 35 | end |
42 | 36 | end |
43 | 37 | end | ... | ... |