From 96b04f39b18e40fe4d31bd5d4ac2ccac077d76cd Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 1 Aug 2016 15:33:47 +0800 Subject: [PATCH] =?UTF-8?q?pull=20requests=E6=A1=86=E6=9E=B6=E6=90=AD?= =?UTF-8?q?=E5=BB=BA=EF=BC=88=E8=B7=AF=E7=94=B1=E6=8E=A7=E5=88=B6=E5=99=A8?= =?UTF-8?q?=E3=80=81views=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/javascripts/pull_rquests.js.coffee | 3 +++ app/assets/stylesheets/pull_rquests.css.scss | 3 +++ app/controllers/pull_rquests_controller.rb | 18 ++++++++++++++++++ app/helpers/pull_rquests_helper.rb | 2 ++ app/views/projects/_development_group.html.erb | 9 +++++++++ app/views/pull_rquests/index.html.erb | 0 app/views/pull_rquests/new.html.erb | 0 app/views/pull_rquests/show.html.erb | 1 + config/routes.rb | 7 +++++++ .../pull_rquests_controller_spec.rb | 5 +++++ 10 files changed, 48 insertions(+) create mode 100644 app/assets/javascripts/pull_rquests.js.coffee create mode 100644 app/assets/stylesheets/pull_rquests.css.scss create mode 100644 app/controllers/pull_rquests_controller.rb create mode 100644 app/helpers/pull_rquests_helper.rb create mode 100644 app/views/pull_rquests/index.html.erb create mode 100644 app/views/pull_rquests/new.html.erb create mode 100644 app/views/pull_rquests/show.html.erb create mode 100644 spec/controllers/pull_rquests_controller_spec.rb diff --git a/app/assets/javascripts/pull_rquests.js.coffee b/app/assets/javascripts/pull_rquests.js.coffee new file mode 100644 index 000000000..761567942 --- /dev/null +++ b/app/assets/javascripts/pull_rquests.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_rquests.css.scss b/app/assets/stylesheets/pull_rquests.css.scss new file mode 100644 index 000000000..89d608475 --- /dev/null +++ b/app/assets/stylesheets/pull_rquests.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the pull_rquests 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_rquests_controller.rb b/app/controllers/pull_rquests_controller.rb new file mode 100644 index 000000000..2fcdf79df --- /dev/null +++ b/app/controllers/pull_rquests_controller.rb @@ -0,0 +1,18 @@ +class PullRquestsController < ApplicationController + before_filter :find_project + layout "base_projects" + + def index + + end + + def new + + end + + def find_project + @project = Project.find(params[:project_id]) + rescue ActiveRecord::RecordNotFound + render_404 + end +end diff --git a/app/helpers/pull_rquests_helper.rb b/app/helpers/pull_rquests_helper.rb new file mode 100644 index 000000000..1b3eef9a4 --- /dev/null +++ b/app/helpers/pull_rquests_helper.rb @@ -0,0 +1,2 @@ +module PullRquestsHelper +end diff --git a/app/views/projects/_development_group.html.erb b/app/views/projects/_development_group.html.erb index 2c7d36fb5..a218e368d 100644 --- a/app/views/projects/_development_group.html.erb +++ b/app/views/projects/_development_group.html.erb @@ -57,6 +57,15 @@ <% end %> +<% if User.current.member_of?(@project) %> + +<% end %> +