[issue #133] Fixed redirection bugs
This commit is contained in:
parent
c26962c216
commit
4dcc39975d
14
Gemfile.lock
14
Gemfile.lock
|
@ -54,14 +54,14 @@ GEM
|
||||||
activerecord (>= 2.2.2)
|
activerecord (>= 2.2.2)
|
||||||
arel (2.0.10)
|
arel (2.0.10)
|
||||||
bcrypt-ruby (3.0.1)
|
bcrypt-ruby (3.0.1)
|
||||||
bluepill (0.0.52)
|
bluepill (0.0.55)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
daemons (~> 1.1.0)
|
daemons (~> 1.1.4)
|
||||||
i18n (>= 0.5.0)
|
i18n (>= 0.5.0)
|
||||||
state_machine (~> 1.1.0)
|
state_machine (~> 1.1.0)
|
||||||
builder (2.1.2)
|
builder (2.1.2)
|
||||||
cancan (1.6.7)
|
cancan (1.6.7)
|
||||||
cape (1.2.0)
|
cape (1.4.0)
|
||||||
capistrano (2.9.0)
|
capistrano (2.9.0)
|
||||||
highline
|
highline
|
||||||
net-scp (>= 1.0.0)
|
net-scp (>= 1.0.0)
|
||||||
|
@ -74,7 +74,7 @@ GEM
|
||||||
chronic (0.6.7)
|
chronic (0.6.7)
|
||||||
cocaine (0.2.1)
|
cocaine (0.2.1)
|
||||||
creole (0.4.2)
|
creole (0.4.2)
|
||||||
daemons (1.1.6)
|
daemons (1.1.8)
|
||||||
delayed_job (2.1.4)
|
delayed_job (2.1.4)
|
||||||
activesupport (~> 3.0)
|
activesupport (~> 3.0)
|
||||||
daemons
|
daemons
|
||||||
|
@ -92,7 +92,7 @@ GEM
|
||||||
factory_girl_rails (1.4.0)
|
factory_girl_rails (1.4.0)
|
||||||
factory_girl (~> 2.3.0)
|
factory_girl (~> 2.3.0)
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
github-markup (0.7.0)
|
github-markup (0.7.1)
|
||||||
gollum (1.3.1)
|
gollum (1.3.1)
|
||||||
albino (~> 1.3.2)
|
albino (~> 1.3.2)
|
||||||
github-markup (>= 0.4.0, < 1.0.0)
|
github-markup (>= 0.4.0, < 1.0.0)
|
||||||
|
@ -152,7 +152,7 @@ GEM
|
||||||
omniauth (~> 1.0)
|
omniauth (~> 1.0)
|
||||||
rack-openid (~> 1.3.1)
|
rack-openid (~> 1.3.1)
|
||||||
orm_adapter (0.0.6)
|
orm_adapter (0.0.6)
|
||||||
paperclip (2.5.2)
|
paperclip (2.6.0)
|
||||||
activerecord (>= 2.3.0)
|
activerecord (>= 2.3.0)
|
||||||
activesupport (>= 2.3.2)
|
activesupport (>= 2.3.2)
|
||||||
cocaine (>= 0.0.2)
|
cocaine (>= 0.0.2)
|
||||||
|
@ -179,7 +179,7 @@ GEM
|
||||||
rails-xmlrpc (0.3.6)
|
rails-xmlrpc (0.3.6)
|
||||||
rails3-generators (0.17.4)
|
rails3-generators (0.17.4)
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
rails3-jquery-autocomplete (1.0.5)
|
rails3-jquery-autocomplete (1.0.6)
|
||||||
rails (~> 3.0)
|
rails (~> 3.0)
|
||||||
railties (3.0.11)
|
railties (3.0.11)
|
||||||
actionpack (= 3.0.11)
|
actionpack (= 3.0.11)
|
||||||
|
|
|
@ -5,7 +5,7 @@ class Git::BlobsController < Git::BaseController
|
||||||
before_filter :set_commit_hash
|
before_filter :set_commit_hash
|
||||||
|
|
||||||
def show
|
def show
|
||||||
redirect_to project_repo_path(@project) unless @blob.present?
|
redirect_to project_repo_path(@project) and return unless @blob.present?
|
||||||
if params[:raw]
|
if params[:raw]
|
||||||
image_url = Rails.root.to_s + "/" + @path
|
image_url = Rails.root.to_s + "/" + @path
|
||||||
|
|
||||||
|
@ -18,12 +18,12 @@ class Git::BlobsController < Git::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
redirect_to project_repo_path(@project) unless @blob.present?
|
redirect_to project_repo_path(@project) and return unless @blob.present?
|
||||||
authorize! :write, @project
|
authorize! :write, @project
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
redirect_to project_repo_path(@project) unless @blob.present?
|
redirect_to project_repo_path(@project) and return unless @blob.present?
|
||||||
authorize! :write, @project
|
authorize! :write, @project
|
||||||
# Here might be callbacks for notification purposes:
|
# Here might be callbacks for notification purposes:
|
||||||
# @git_repository.after_update_file do |repo, sha|
|
# @git_repository.after_update_file do |repo, sha|
|
||||||
|
@ -44,7 +44,7 @@ class Git::BlobsController < Git::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def raw
|
def raw
|
||||||
redirect_to project_repo_path(@project) unless @blob.present?
|
redirect_to project_repo_path(@project) and return unless @blob.present?
|
||||||
headers["Content-Disposition"] = %[attachment;filename="#{@blob.name}"]
|
headers["Content-Disposition"] = %[attachment;filename="#{@blob.name}"]
|
||||||
render :text => @blob.data, :content_type => @blob.mime_type
|
render :text => @blob.data, :content_type => @blob.mime_type
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue