diff options
author | David A. Cuadrado <krawek@gmail.com> | 2008-03-31 16:03:31 -0500 |
---|---|---|
committer | David A. Cuadrado <krawek@gmail.com> | 2008-03-31 16:03:31 -0500 |
commit | 53e86bc09f1481154ab63bed2f953e4b26f9c028 (patch) | |
tree | 5cb22b91edc4ec87782394b8c23b1e6e133c1217 | |
parent | 0ec5103e3f43ffab2801ed39e137754249fa70c3 (diff) | |
download | gitorious-mainline-outdated-53e86bc09f1481154ab63bed2f953e4b26f9c028.zip gitorious-mainline-outdated-53e86bc09f1481154ab63bed2f953e4b26f9c028.tar.gz gitorious-mainline-outdated-53e86bc09f1481154ab63bed2f953e4b26f9c028.tar.bz2 |
list committers, added 'list' to committers route and allow to use the post method to add committers
-rw-r--r-- | app/controllers/committers_controller.rb | 14 | ||||
-rw-r--r-- | config/routes.rb | 2 |
2 files changed, 11 insertions, 5 deletions
diff --git a/app/controllers/committers_controller.rb b/app/controllers/committers_controller.rb index 7f0fb94..fddcf48 100644 --- a/app/controllers/committers_controller.rb +++ b/app/controllers/committers_controller.rb @@ -1,8 +1,8 @@ class CommittersController < ApplicationController - before_filter :login_required, :only => [:new, :create, :destroy] + before_filter :login_required, :only => [:new, :create, :destroy, :list] before_filter :find_project before_filter :find_repository, - :only => [:show, :new, :create, :edit, :update, :destroy] + :only => [:show, :new, :create, :edit, :update, :destroy, :list] def new @committer = User.new @@ -23,8 +23,7 @@ class CommittersController < ApplicationController if @repository.add_committer(@committer) format.html { redirect_to([@repository.project, @repository]) } format.xml do - render :nothing, :status => :created, - :location => project_repository_path(@repository.project, @repository) + render :xml => @committer end else flash[:error] = "Could not add user or user is already a committer" @@ -51,6 +50,13 @@ class CommittersController < ApplicationController end end + def list + @committers = @repository.committers + respond_to do |format| + format.xml { render :xml => @committers } + end + end + def auto_complete_for_user_login login = params[:user][:login] @users = User.find(:all, diff --git a/config/routes.rb b/config/routes.rb index e635691..c85548b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -36,7 +36,7 @@ ActionController::Routing::Routes.draw do |map| :writable_by => :get, :confirm_delete => :get }, :as => "repos") do |repo| - repo.resources :committers, :name_prefix => nil, :collection => {:auto_complete_for_user_login => :post} + repo.resources :committers, :name_prefix => nil, :collection => {:auto_complete_for_user_login => :post, :list => :get, :create => :post} repo.resources :comments, :member => { :commmit => :get } repo.resources :merge_requests, :member => { :resolve => :put } repo.commit_comment "comments/commit/:sha", :controller => "comments", |