From 797ed5081df55d0fcaa584384d757eae561abf98 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 30 Jun 2015 22:12:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 1 + app/controllers/repositories_controller.rb | 8 ++++++++ app/views/projects/_development_group.html.erb | 2 +- config/initializers/gitlab_config.rb | 7 +++++++ lib/tasks/gitlab.rake | 11 +++++++++++ 5 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 config/initializers/gitlab_config.rb create mode 100644 lib/tasks/gitlab.rake diff --git a/Gemfile b/Gemfile index 660a7ff49..5a26ed6e0 100644 --- a/Gemfile +++ b/Gemfile @@ -6,6 +6,7 @@ unless RUBY_PLATFORM =~ /w32/ gem 'iconv' end +gem 'gitlab' gem 'rest-client' gem "mysql2", "= 0.3.18" gem 'redis-rails' diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 607c9b5db..e80fc4a9a 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -250,6 +250,14 @@ update return -1 end end + + if params[:to] == 'gitlab' + g = Gitlab.client + g.post('/session', body: {email: User.current.mail, password: User.current.hashed_password}) + redirect_to "http://192.168.41.130:3000/gitlab-org/gitlab-shell/tree/master" + return + end + #if( !User.current.member_of?(@project) || @project.hidden_repo) @repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty? diff --git a/app/views/projects/_development_group.html.erb b/app/views/projects/_development_group.html.erb index d4bc7012a..20a9976e5 100644 --- a/app/views/projects/_development_group.html.erb +++ b/app/views/projects/_development_group.html.erb @@ -41,7 +41,7 @@ <%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %> <% if visible_repository?(@project) %>