]> source.dussan.org Git - redmine.git/commitdiff
Add "Repository" menu item after repository creation (#5328).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 17 Apr 2010 12:51:46 +0000 (12:51 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 17 Apr 2010 12:51:46 +0000 (12:51 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3680 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/repositories_controller.rb

index 714dfedde840eaa7133a7f9e4ef4f65845bcb7b0..b6dcc317343fcaa20aee2ed79e2cdb080777f889 100644 (file)
@@ -24,6 +24,7 @@ class InvalidRevisionParam < Exception; end
 
 class RepositoriesController < ApplicationController
   menu_item :repository
+  menu_item :settings, :only => :edit
   default_search_scope :changesets
   
   before_filter :find_repository, :except => :edit
@@ -43,7 +44,13 @@ class RepositoriesController < ApplicationController
       @repository.attributes = params[:repository]
       @repository.save
     end
-    render(:update) {|page| page.replace_html "tab-content-repository", :partial => 'projects/settings/repository'}
+    render(:update) do |page|
+      page.replace_html "tab-content-repository", :partial => 'projects/settings/repository'
+      if @repository && !@project.repository
+        @project.reload #needed to reload association
+        page.replace_html "main-menu", render_main_menu(@project)
+      end
+    end
   end
   
   def committers