Commit d64f23e2 authored by gitlabhq's avatar gitlabhq

code cleaning

parent 1beb8416
...@@ -5,7 +5,7 @@ gem 'rails', '3.1.0' ...@@ -5,7 +5,7 @@ gem 'rails', '3.1.0'
gem 'sqlite3' gem 'sqlite3'
gem 'devise', "1.4.7" gem 'devise', "1.4.7"
gem 'stamp' gem 'stamp'
gem 'will_paginate', '~> 3.0' gem 'kaminari'
gem 'haml-rails' gem 'haml-rails'
gem 'jquery-rails' gem 'jquery-rails'
gem 'grit', :git => 'git://github.com/gitlabhq/grit.git' gem 'grit', :git => 'git://github.com/gitlabhq/grit.git'
...@@ -16,7 +16,6 @@ gem 'faker' ...@@ -16,7 +16,6 @@ gem 'faker'
gem 'seed-fu', :git => 'git://github.com/mbleigh/seed-fu.git' gem 'seed-fu', :git => 'git://github.com/mbleigh/seed-fu.git'
gem "inifile" gem "inifile"
gem "pygments.rb", "0.2.3" gem "pygments.rb", "0.2.3"
gem "kaminari"
gem "thin" gem "thin"
gem "git" gem "git"
gem "acts_as_list" gem "acts_as_list"
......
...@@ -232,7 +232,6 @@ GEM ...@@ -232,7 +232,6 @@ GEM
multi_json (>= 1.0.2) multi_json (>= 1.0.2)
warden (1.0.5) warden (1.0.5)
rack (>= 1.0) rack (>= 1.0)
will_paginate (3.0.0)
xpath (0.1.4) xpath (0.1.4)
nokogiri (~> 1.3) nokogiri (~> 1.3)
...@@ -274,4 +273,3 @@ DEPENDENCIES ...@@ -274,4 +273,3 @@ DEPENDENCIES
thin thin
turn turn
uglifier uglifier
will_paginate (~> 3.0)
...@@ -4,29 +4,14 @@ class Admin::ProjectsController < ApplicationController ...@@ -4,29 +4,14 @@ class Admin::ProjectsController < ApplicationController
def index def index
@admin_projects = Project.page(params[:page]) @admin_projects = Project.page(params[:page])
respond_to do |format|
format.html # index.html.erb
format.json { render json: @admin_projects }
end
end end
def show def show
@admin_project = Project.find_by_code(params[:id]) @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 end
def new def new
@admin_project = Project.new @admin_project = Project.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @admin_project }
end
end end
def edit def edit
...@@ -37,28 +22,20 @@ class Admin::ProjectsController < ApplicationController ...@@ -37,28 +22,20 @@ class Admin::ProjectsController < ApplicationController
@admin_project = Project.new(params[:project]) @admin_project = Project.new(params[:project])
@admin_project.owner = current_user @admin_project.owner = current_user
respond_to do |format| if @admin_project.save
if @admin_project.save redirect_to [:admin, @admin_project], notice: 'Project was successfully created.'
format.html { redirect_to [:admin, @admin_project], notice: 'Project was successfully created.' } else
format.json { render json: @admin_project, status: :created, location: @admin_project } render :action => "new"
else
format.html { render action: "new" }
format.json { render json: @admin_project.errors, status: :unprocessable_entity }
end
end end
end end
def update def update
@admin_project = Project.find_by_code(params[:id]) @admin_project = Project.find_by_code(params[:id])
respond_to do |format| if @admin_project.update_attributes(params[:project])
if @admin_project.update_attributes(params[:project]) redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.'
format.html { redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.' } else
format.json { head :ok } render :action => "edit"
else
format.html { render action: "edit" }
format.json { render json: @admin_project.errors, status: :unprocessable_entity }
end
end end
end end
...@@ -66,9 +43,6 @@ class Admin::ProjectsController < ApplicationController ...@@ -66,9 +43,6 @@ class Admin::ProjectsController < ApplicationController
@admin_project = Project.find_by_code(params[:id]) @admin_project = Project.find_by_code(params[:id])
@admin_project.destroy @admin_project.destroy
respond_to do |format| redirect_to admin_projects_url
format.html { redirect_to admin_projects_url }
format.json { head :ok }
end
end end
end end
...@@ -4,29 +4,14 @@ class Admin::TeamMembersController < ApplicationController ...@@ -4,29 +4,14 @@ class Admin::TeamMembersController < ApplicationController
def index def index
@admin_team_members = UsersProject.page(params[:page]).per(100).order("project_id DESC") @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 end
def show def show
@admin_team_member = UsersProject.find(params[:id]) @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 end
def new def new
@admin_team_member = UsersProject.new(params[:team_member]) @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 end
def edit def edit
...@@ -37,14 +22,10 @@ class Admin::TeamMembersController < ApplicationController ...@@ -37,14 +22,10 @@ class Admin::TeamMembersController < ApplicationController
@admin_team_member = UsersProject.new(params[:team_member]) @admin_team_member = UsersProject.new(params[:team_member])
@admin_team_member.project_id = params[:team_member][:project_id] @admin_team_member.project_id = params[:team_member][:project_id]
respond_to do |format| if @admin_team_member.save
if @admin_team_member.save redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.'
format.html { redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.' } else
format.json { render json: @admin_team_member, status: :created, location: @team_member } render action: "new"
else
format.html { render action: "new" }
format.json { render json: @admin_team_member.errors, status: :unprocessable_entity }
end
end end
end end
...@@ -52,14 +33,10 @@ class Admin::TeamMembersController < ApplicationController ...@@ -52,14 +33,10 @@ class Admin::TeamMembersController < ApplicationController
@admin_team_member = UsersProject.find(params[:id]) @admin_team_member = UsersProject.find(params[:id])
@admin_team_member.project_id = params[:team_member][:project_id] @admin_team_member.project_id = params[:team_member][:project_id]
respond_to do |format| if @admin_team_member.update_attributes(params[:team_member])
if @admin_team_member.update_attributes(params[:team_member]) redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.'
format.html { redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.' } else
format.json { head :ok } render action: "edit"
else
format.html { render action: "edit" }
format.json { render json: @admin_team_member.errors, status: :unprocessable_entity }
end
end end
end end
...@@ -67,9 +44,6 @@ class Admin::TeamMembersController < ApplicationController ...@@ -67,9 +44,6 @@ class Admin::TeamMembersController < ApplicationController
@admin_team_member = UsersProject.find(params[:id]) @admin_team_member = UsersProject.find(params[:id])
@admin_team_member.destroy @admin_team_member.destroy
respond_to do |format| redirect_to admin_team_members_url
format.html { redirect_to admin_team_members_url }
format.json { head :ok }
end
end end
end end
...@@ -4,29 +4,14 @@ class Admin::UsersController < ApplicationController ...@@ -4,29 +4,14 @@ class Admin::UsersController < ApplicationController
def index def index
@admin_users = User.page(params[:page]) @admin_users = User.page(params[:page])
respond_to do |format|
format.html # index.html.erb
format.json { render json: @admin_users }
end
end end
def show def show
@admin_user = User.find(params[:id]) @admin_user = User.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @admin_user }
end
end end
def new def new
@admin_user = User.new(:projects_limit => 10) @admin_user = User.new(:projects_limit => 10)
respond_to do |format|
format.html # new.html.erb
format.json { render json: @admin_user }
end
end end
def edit def edit
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment