summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgitlabhq <m@gitlabhq.com>2011-10-27 16:44:29 +0300
committergitlabhq <m@gitlabhq.com>2011-10-27 16:44:29 +0300
commitd64f23e29419c92c36a0f64917563336ed6012e3 (patch)
treebb922de1330e4c513bde57cdaedf3e66cc60db48
parent1beb84161c80eec8c5df2ca3888409143f25a8e0 (diff)
downloadgitlab-ce-d64f23e29419c92c36a0f64917563336ed6012e3.tar.gz
code cleaning
-rw-r--r--Gemfile3
-rw-r--r--Gemfile.lock2
-rw-r--r--app/controllers/admin/projects_controller.rb44
-rw-r--r--app/controllers/admin/team_members_controller.rb44
-rw-r--r--app/controllers/admin/users_controller.rb15
5 files changed, 19 insertions, 89 deletions
diff --git a/Gemfile b/Gemfile
index 77a00659ac7..46320d221f2 100644
--- a/Gemfile
+++ b/Gemfile
@@ -5,7 +5,7 @@ gem 'rails', '3.1.0'
gem 'sqlite3'
gem 'devise', "1.4.7"
gem 'stamp'
-gem 'will_paginate', '~> 3.0'
+gem 'kaminari'
gem 'haml-rails'
gem 'jquery-rails'
gem 'grit', :git => 'git://github.com/gitlabhq/grit.git'
@@ -16,7 +16,6 @@ gem 'faker'
gem 'seed-fu', :git => 'git://github.com/mbleigh/seed-fu.git'
gem "inifile"
gem "pygments.rb", "0.2.3"
-gem "kaminari"
gem "thin"
gem "git"
gem "acts_as_list"
diff --git a/Gemfile.lock b/Gemfile.lock
index 5ba34459752..44faaad7b70 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -232,7 +232,6 @@ GEM
multi_json (>= 1.0.2)
warden (1.0.5)
rack (>= 1.0)
- will_paginate (3.0.0)
xpath (0.1.4)
nokogiri (~> 1.3)
@@ -274,4 +273,3 @@ DEPENDENCIES
thin
turn
uglifier
- will_paginate (~> 3.0)
diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb
index 5575261959a..a71136398fa 100644
--- a/app/controllers/admin/projects_controller.rb
+++ b/app/controllers/admin/projects_controller.rb
@@ -4,29 +4,14 @@ class Admin::ProjectsController < ApplicationController
def index
@admin_projects = Project.page(params[:page])
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render json: @admin_projects }
- end
end
def show
@admin_project = Project.find_by_code(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.json { render json: @admin_project }
- end
end
def new
@admin_project = Project.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.json { render json: @admin_project }
- end
end
def edit
@@ -37,28 +22,20 @@ class Admin::ProjectsController < ApplicationController
@admin_project = Project.new(params[:project])
@admin_project.owner = current_user
- respond_to do |format|
- if @admin_project.save
- format.html { redirect_to [:admin, @admin_project], notice: 'Project was successfully created.' }
- format.json { render json: @admin_project, status: :created, location: @admin_project }
- else
- format.html { render action: "new" }
- format.json { render json: @admin_project.errors, status: :unprocessable_entity }
- end
+ if @admin_project.save
+ redirect_to [:admin, @admin_project], notice: 'Project was successfully created.'
+ else
+ render :action => "new"
end
end
def update
@admin_project = Project.find_by_code(params[:id])
- respond_to do |format|
- if @admin_project.update_attributes(params[:project])
- format.html { redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.' }
- format.json { head :ok }
- else
- format.html { render action: "edit" }
- format.json { render json: @admin_project.errors, status: :unprocessable_entity }
- end
+ if @admin_project.update_attributes(params[:project])
+ redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.'
+ else
+ render :action => "edit"
end
end
@@ -66,9 +43,6 @@ class Admin::ProjectsController < ApplicationController
@admin_project = Project.find_by_code(params[:id])
@admin_project.destroy
- respond_to do |format|
- format.html { redirect_to admin_projects_url }
- format.json { head :ok }
- end
+ redirect_to admin_projects_url
end
end
diff --git a/app/controllers/admin/team_members_controller.rb b/app/controllers/admin/team_members_controller.rb
index bca9bfebbfd..8ae32bc6613 100644
--- a/app/controllers/admin/team_members_controller.rb
+++ b/app/controllers/admin/team_members_controller.rb
@@ -4,29 +4,14 @@ class Admin::TeamMembersController < ApplicationController
def index
@admin_team_members = UsersProject.page(params[:page]).per(100).order("project_id DESC")
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render json: @admin_team_members }
- end
end
def show
@admin_team_member = UsersProject.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.json { render json: @admin_team_member }
- end
end
def new
@admin_team_member = UsersProject.new(params[:team_member])
-
- respond_to do |format|
- format.html # new.html.erb
- format.json { render json: @admin_team_member }
- end
end
def edit
@@ -37,14 +22,10 @@ class Admin::TeamMembersController < ApplicationController
@admin_team_member = UsersProject.new(params[:team_member])
@admin_team_member.project_id = params[:team_member][:project_id]
- respond_to do |format|
- if @admin_team_member.save
- format.html { redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.' }
- format.json { render json: @admin_team_member, status: :created, location: @team_member }
- else
- format.html { render action: "new" }
- format.json { render json: @admin_team_member.errors, status: :unprocessable_entity }
- end
+ if @admin_team_member.save
+ redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.'
+ else
+ render action: "new"
end
end
@@ -52,14 +33,10 @@ class Admin::TeamMembersController < ApplicationController
@admin_team_member = UsersProject.find(params[:id])
@admin_team_member.project_id = params[:team_member][:project_id]
- respond_to do |format|
- if @admin_team_member.update_attributes(params[:team_member])
- format.html { redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.' }
- format.json { head :ok }
- else
- format.html { render action: "edit" }
- format.json { render json: @admin_team_member.errors, status: :unprocessable_entity }
- end
+ if @admin_team_member.update_attributes(params[:team_member])
+ redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.'
+ else
+ render action: "edit"
end
end
@@ -67,9 +44,6 @@ class Admin::TeamMembersController < ApplicationController
@admin_team_member = UsersProject.find(params[:id])
@admin_team_member.destroy
- respond_to do |format|
- format.html { redirect_to admin_team_members_url }
- format.json { head :ok }
- end
+ redirect_to admin_team_members_url
end
end
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
index e9ad1e55983..f6304e15ce0 100644
--- a/app/controllers/admin/users_controller.rb
+++ b/app/controllers/admin/users_controller.rb
@@ -4,29 +4,14 @@ class Admin::UsersController < ApplicationController
def index
@admin_users = User.page(params[:page])
-
- respond_to do |format|
- format.html # index.html.erb
- format.json { render json: @admin_users }
- end
end
def show
@admin_user = User.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.json { render json: @admin_user }
- end
end
def new
@admin_user = User.new(:projects_limit => 10)
-
- respond_to do |format|
- format.html # new.html.erb
- format.json { render json: @admin_user }
- end
end
def edit