diff --git a/app/assets/javascripts/pull_requests.js.coffee b/app/assets/javascripts/pull_requests.js.coffee new file mode 100644 index 000000000..761567942 --- /dev/null +++ b/app/assets/javascripts/pull_requests.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/stylesheets/pull_requests.css.scss b/app/assets/stylesheets/pull_requests.css.scss new file mode 100644 index 000000000..f69ac413b --- /dev/null +++ b/app/assets/stylesheets/pull_requests.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the pull_requests controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb new file mode 100644 index 000000000..61fb9c9e4 --- /dev/null +++ b/app/controllers/pull_requests_controller.rb @@ -0,0 +1,36 @@ +class PullRequestsController < ApplicationController + before_filter :find_project_and_repository + before_filter :connect_gitlab, :only => [:index, :show] + + layout "base_projects" + + def index + results = @g.merge_requests(@project.gpid) + end + + def new + + end + + def create + + end + + def show + + end + + private + def connect_gitlab + @g = Gitlab.client + end + + def find_project_and_repository + @project = Project.find(params[:project_id]) + render_404 if @project.gpid.blank? + @repository = Repository.where(:project_id => @project.id, :type => "Repository::Gitlab") + rescue ActiveRecord::RecordNotFound + render_404 + end + +end diff --git a/app/controllers/pull_rquests_controller.rb b/app/controllers/pull_rquests_controller.rb index aaef56595..230f832bd 100644 --- a/app/controllers/pull_rquests_controller.rb +++ b/app/controllers/pull_rquests_controller.rb @@ -1,17 +1,29 @@ class PullRquestsController < ApplicationController before_filter :find_project_and_repository + before_filter :connect_gitlab, :only => [:index, :show] + layout "base_projects" def index - + results = @g.merge_requests(@project.gpid) end def new end + def create + + end + + private + def connect_gitlab + @g = Gitlab.client + end + def find_project_and_repository @project = Project.find(params[:project_id]) + render_404 if @project.gpid.blank? @repository = Repository.where(:project_id => @project.id, :type => "Repository::Gitlab") rescue ActiveRecord::RecordNotFound render_404 diff --git a/app/helpers/pull_requests_helper.rb b/app/helpers/pull_requests_helper.rb new file mode 100644 index 000000000..fa8554854 --- /dev/null +++ b/app/helpers/pull_requests_helper.rb @@ -0,0 +1,2 @@ +module PullRequestsHelper +end diff --git a/app/views/projects/_development_group.html.erb b/app/views/projects/_development_group.html.erb index d8d25dd3d..4dec58793 100644 --- a/app/views/projects/_development_group.html.erb +++ b/app/views/projects/_development_group.html.erb @@ -59,7 +59,7 @@ <% if allow_pull_request(@project) %>