OSDN Git Service

Remove commit_tab_class helper
authorRobert Speicher <rspeicher@gmail.com>
Wed, 26 Sep 2012 03:34:26 +0000 (23:34 -0400)
committerRobert Speicher <rspeicher@gmail.com>
Wed, 26 Sep 2012 20:32:25 +0000 (16:32 -0400)
app/helpers/tab_helper.rb
app/views/layouts/_project_menu.html.haml

index 9491e27..c26e346 100644 (file)
@@ -51,12 +51,6 @@ module TabHelper
     end
   end
 
-  def commit_tab_class
-    if ['commits', 'repositories', 'protected_branches'].include? controller.controller_name
-      "active"
-    end
-  end
-
   def branches_tab_class
     if current_page?(branches_project_repository_path(@project)) ||
       controller.controller_name == "protected_branches" ||
index e257564..5a662a4 100644 (file)
@@ -6,7 +6,7 @@
     - if can? current_user, :download_code, @project
       %li{class: current_controller?(:tree, :blob, :blame) ? 'active' : ''}
         = link_to 'Files', project_tree_path(@project, @project.root_ref)
-      %li{class: commit_tab_class}
+      %li{class: current_controller?(:commit, :commits, :compare, :repositories, :protected_branches) ? 'active' : ''}
         = link_to "Commits", project_commits_path(@project, @project.root_ref)
       %li{class: tab_class(:network)}
         = link_to "Network", graph_project_path(@project)