Commit a7f52b6c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'rails-4.1.9' into 'master'

Upgrade to Rails 4.1.9

Upgrade the Rails gem to 4.1.9.  Rails behavior changed in version 4.1.2, requiring that we avoid using slashes in arguments to path helpers.  This MR changes routing to use nested resources for that reason.

TODO:

* [x] Make Spinach tests green
* [x] Make it mergeable

cc @sytse @dzaporozhets

See merge request !1494
parents 3afd91f2 5a8d8b6f
v 7.9.0 (unreleased) v 7.9.0 (unreleased)
- Move labels/milestones tabs to sidebar - Move labels/milestones tabs to sidebar
- Upgrade Rails gem to version 4.1.9.
- Improve UI for commits, issues and merge request lists - Improve UI for commits, issues and merge request lists
- Fix commit comments on first line of diff not rendering in Merge Request Discussion view. - Fix commit comments on first line of diff not rendering in Merge Request Discussion view.
......
...@@ -3,31 +3,31 @@ GEM ...@@ -3,31 +3,31 @@ GEM
specs: specs:
RedCloth (4.2.9) RedCloth (4.2.9)
ace-rails-ap (2.0.1) ace-rails-ap (2.0.1)
actionmailer (4.1.1) actionmailer (4.1.9)
actionpack (= 4.1.1) actionpack (= 4.1.9)
actionview (= 4.1.1) actionview (= 4.1.9)
mail (~> 2.5.4) mail (~> 2.5, >= 2.5.4)
actionpack (4.1.1) actionpack (4.1.9)
actionview (= 4.1.1) actionview (= 4.1.9)
activesupport (= 4.1.1) activesupport (= 4.1.9)
rack (~> 1.5.2) rack (~> 1.5.2)
rack-test (~> 0.6.2) rack-test (~> 0.6.2)
actionview (4.1.1) actionview (4.1.9)
activesupport (= 4.1.1) activesupport (= 4.1.9)
builder (~> 3.1) builder (~> 3.1)
erubis (~> 2.7.0) erubis (~> 2.7.0)
activemodel (4.1.1) activemodel (4.1.9)
activesupport (= 4.1.1) activesupport (= 4.1.9)
builder (~> 3.1) builder (~> 3.1)
activerecord (4.1.1) activerecord (4.1.9)
activemodel (= 4.1.1) activemodel (= 4.1.9)
activesupport (= 4.1.1) activesupport (= 4.1.9)
arel (~> 5.0.0) arel (~> 5.0.0)
activeresource (4.0.0) activeresource (4.0.0)
activemodel (~> 4.0) activemodel (~> 4.0)
activesupport (~> 4.0) activesupport (~> 4.0)
rails-observers (~> 0.1.1) rails-observers (~> 0.1.1)
activesupport (4.1.1) activesupport (4.1.9)
i18n (~> 0.6, >= 0.6.9) i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7) json (~> 1.7, >= 1.7.7)
minitest (~> 5.1) minitest (~> 5.1)
...@@ -307,9 +307,8 @@ GEM ...@@ -307,9 +307,8 @@ GEM
rb-fsevent (>= 0.9.3) rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9) rb-inotify (>= 0.9)
lumberjack (1.0.4) lumberjack (1.0.4)
mail (2.5.4) mail (2.6.3)
mime-types (~> 1.16) mime-types (>= 1.16, < 3)
treetop (~> 1.4.8)
method_source (0.8.2) method_source (0.8.2)
mime-types (1.25.1) mime-types (1.25.1)
mini_portile (0.6.1) mini_portile (0.6.1)
...@@ -376,7 +375,6 @@ GEM ...@@ -376,7 +375,6 @@ GEM
cliver (~> 0.3.1) cliver (~> 0.3.1)
multi_json (~> 1.0) multi_json (~> 1.0)
websocket-driver (>= 0.2.0) websocket-driver (>= 0.2.0)
polyglot (0.3.4)
posix-spawn (0.3.9) posix-spawn (0.3.9)
powerpack (0.0.9) powerpack (0.0.9)
pry (0.9.12.4) pry (0.9.12.4)
...@@ -407,30 +405,30 @@ GEM ...@@ -407,30 +405,30 @@ GEM
rack (>= 1.1) rack (>= 1.1)
rack-protection (1.5.1) rack-protection (1.5.1)
rack rack
rack-test (0.6.2) rack-test (0.6.3)
rack (>= 1.0) rack (>= 1.0)
rails (4.1.1) rails (4.1.9)
actionmailer (= 4.1.1) actionmailer (= 4.1.9)
actionpack (= 4.1.1) actionpack (= 4.1.9)
actionview (= 4.1.1) actionview (= 4.1.9)
activemodel (= 4.1.1) activemodel (= 4.1.9)
activerecord (= 4.1.1) activerecord (= 4.1.9)
activesupport (= 4.1.1) activesupport (= 4.1.9)
bundler (>= 1.3.0, < 2.0) bundler (>= 1.3.0, < 2.0)
railties (= 4.1.1) railties (= 4.1.9)
sprockets-rails (~> 2.0) sprockets-rails (~> 2.0)
rails-observers (0.1.2) rails-observers (0.1.2)
activemodel (~> 4.0) activemodel (~> 4.0)
rails_autolink (1.1.6) rails_autolink (1.1.6)
rails (> 3.1) rails (> 3.1)
railties (4.1.1) railties (4.1.9)
actionpack (= 4.1.1) actionpack (= 4.1.9)
activesupport (= 4.1.1) activesupport (= 4.1.9)
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0) thor (>= 0.18.1, < 2.0)
rainbow (2.0.0) rainbow (2.0.0)
raindrops (0.13.0) raindrops (0.13.0)
rake (10.3.2) rake (10.4.2)
raphael-rails (2.1.2) raphael-rails (2.1.2)
rb-fsevent (0.9.3) rb-fsevent (0.9.3)
rb-inotify (0.9.2) rb-inotify (0.9.2)
...@@ -555,10 +553,10 @@ GEM ...@@ -555,10 +553,10 @@ GEM
multi_json (~> 1.0) multi_json (~> 1.0)
rack (~> 1.0) rack (~> 1.0)
tilt (~> 1.1, != 1.3.0) tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.1.3) sprockets-rails (2.2.4)
actionpack (>= 3.0) actionpack (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
sprockets (~> 2.8) sprockets (>= 2.8, < 4.0)
stamp (0.5.0) stamp (0.5.0)
state_machine (1.2.0) state_machine (1.2.0)
stringex (2.5.2) stringex (2.5.2)
...@@ -589,9 +587,6 @@ GEM ...@@ -589,9 +587,6 @@ GEM
multi_json (~> 1.7) multi_json (~> 1.7)
twitter-stream (~> 0.1) twitter-stream (~> 0.1)
tins (0.13.1) tins (0.13.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
turbolinks (2.0.0) turbolinks (2.0.0)
coffee-rails coffee-rails
twitter-stream (0.1.16) twitter-stream (0.1.16)
......
...@@ -25,13 +25,16 @@ class Admin::ProjectsController < Admin::ApplicationController ...@@ -25,13 +25,16 @@ class Admin::ProjectsController < Admin::ApplicationController
def transfer def transfer
::Projects::TransferService.new(@project, current_user, params.dup).execute ::Projects::TransferService.new(@project, current_user, params.dup).execute
redirect_to [:admin, @project.reload] @project.reload
redirect_to admin_namespace_project_path(@project.namespace, @project)
end end
protected protected
def project def project
@project = Project.find_with_namespace(params[:id]) @project = Project.find_with_namespace(
[params[:namespace_id], '/', params[:id]].join('')
)
@project || render_404 @project || render_404
end end
......
...@@ -93,6 +93,7 @@ class ApplicationController < ActionController::Base ...@@ -93,6 +93,7 @@ class ApplicationController < ActionController::Base
def project def project
unless @project unless @project
namespace = params[:namespace_id]
id = params[:project_id] || params[:id] id = params[:project_id] || params[:id]
# Redirect from # Redirect from
...@@ -104,7 +105,7 @@ class ApplicationController < ActionController::Base ...@@ -104,7 +105,7 @@ class ApplicationController < ActionController::Base
redirect_to request.original_url.gsub(/\.git\Z/, '') and return redirect_to request.original_url.gsub(/\.git\Z/, '') and return
end end
@project = Project.find_with_namespace(id) @project = Project.find_with_namespace("#{namespace}/#{id}")
if @project and can?(current_user, :read_project, @project) if @project and can?(current_user, :read_project, @project)
@project @project
...@@ -121,7 +122,8 @@ class ApplicationController < ActionController::Base ...@@ -121,7 +122,8 @@ class ApplicationController < ActionController::Base
def repository def repository
@repository ||= project.repository @repository ||= project.repository
rescue Grit::NoSuchPathError rescue Grit::NoSuchPathError(e)
log_exception(e)
nil nil
end end
......
...@@ -8,7 +8,8 @@ class Projects::ApplicationController < ApplicationController ...@@ -8,7 +8,8 @@ class Projects::ApplicationController < ApplicationController
# for non-signed users # for non-signed users
if !current_user if !current_user
id = params[:project_id] || params[:id] id = params[:project_id] || params[:id]
@project = Project.find_with_namespace(id) project_with_namespace = "#{params[:namespace_id]}/#{id}"
@project = Project.find_with_namespace(project_with_namespace)
return if @project && @project.public? return if @project && @project.public?
end end
...@@ -26,7 +27,10 @@ class Projects::ApplicationController < ApplicationController ...@@ -26,7 +27,10 @@ class Projects::ApplicationController < ApplicationController
def require_branch_head def require_branch_head
unless @repository.branch_names.include?(@ref) unless @repository.branch_names.include?(@ref)
redirect_to project_tree_path(@project, @ref), notice: "This action is not allowed unless you are on top of a branch" redirect_to(
namespace_project_tree_path(@project.namespace, @project, @ref),
notice: "This action is not allowed unless you are on top of a branch"
)
end end
end end
end end
...@@ -24,6 +24,6 @@ class Projects::AvatarsController < Projects::ApplicationController ...@@ -24,6 +24,6 @@ class Projects::AvatarsController < Projects::ApplicationController
@project.save @project.save
@project.reset_events_cache @project.reset_events_cache
redirect_to edit_project_path(@project) redirect_to edit_namespace_project_path(@project.namespace, @project)
end end
end end
...@@ -25,7 +25,7 @@ class Projects::BlobController < Projects::ApplicationController ...@@ -25,7 +25,7 @@ class Projects::BlobController < Projects::ApplicationController
if result[:status] == :success if result[:status] == :success
flash[:notice] = "Your changes have been successfully committed" flash[:notice] = "Your changes have been successfully committed"
redirect_to project_blob_path(@project, File.join(@ref, file_path)) redirect_to namespace_project_blob_path(@project.namespace, @project, File.join(@ref, file_path))
else else
flash[:alert] = result[:message] flash[:alert] = result[:message]
render :new render :new
...@@ -70,7 +70,8 @@ class Projects::BlobController < Projects::ApplicationController ...@@ -70,7 +70,8 @@ class Projects::BlobController < Projects::ApplicationController
if result[:status] == :success if result[:status] == :success
flash[:notice] = "Your changes have been successfully committed" flash[:notice] = "Your changes have been successfully committed"
redirect_to project_tree_path(@project, @ref) redirect_to namespace_project_tree_path(@project.namespace, @project,
@ref)
else else
flash[:alert] = result[:message] flash[:alert] = result[:message]
render :show render :show
...@@ -102,7 +103,7 @@ class Projects::BlobController < Projects::ApplicationController ...@@ -102,7 +103,7 @@ class Projects::BlobController < Projects::ApplicationController
else else
if tree = @repository.tree(@commit.id, @path) if tree = @repository.tree(@commit.id, @path)
if tree.entries.any? if tree.entries.any?
redirect_to project_tree_path(@project, File.join(@ref, @path)) and return redirect_to namespace_project_tree_path(@project.namespace, @project, File.join(@ref, @path)) and return
end end
end end
...@@ -128,10 +129,10 @@ class Projects::BlobController < Projects::ApplicationController ...@@ -128,10 +129,10 @@ class Projects::BlobController < Projects::ApplicationController
def after_edit_path def after_edit_path
@after_edit_path ||= @after_edit_path ||=
if from_merge_request if from_merge_request
diffs_project_merge_request_path(from_merge_request.target_project, from_merge_request) + diffs_namespace_project_merge_request_path(from_merge_request.target_project.namespace, from_merge_request.target_project, from_merge_request) +
"#file-path-#{hexdigest(@path)}" "#file-path-#{hexdigest(@path)}"
else else
project_blob_path(@project, @id) namespace_project_blob_path(@project.namespace, @project, @id)
end end
end end
......
...@@ -23,7 +23,8 @@ class Projects::BranchesController < Projects::ApplicationController ...@@ -23,7 +23,8 @@ class Projects::BranchesController < Projects::ApplicationController
if result[:status] == :success if result[:status] == :success
@branch = result[:branch] @branch = result[:branch]
redirect_to project_tree_path(@project, @branch.name) redirect_to namespace_project_tree_path(@project.namespace, @project,
@branch.name)
else else
@error = result[:message] @error = result[:message]
render action: 'new' render action: 'new'
...@@ -35,7 +36,10 @@ class Projects::BranchesController < Projects::ApplicationController ...@@ -35,7 +36,10 @@ class Projects::BranchesController < Projects::ApplicationController
@branch_name = params[:id] @branch_name = params[:id]
respond_to do |format| respond_to do |format|
format.html { redirect_to project_branches_path(@project) } format.html do
redirect_to namespace_project_branches_path(@project.namespace,
@project)
end
format.js format.js
end end
end end
......
...@@ -25,6 +25,7 @@ class Projects::CompareController < Projects::ApplicationController ...@@ -25,6 +25,7 @@ class Projects::CompareController < Projects::ApplicationController
end end
def create def create
redirect_to project_compare_path(@project, params[:from], params[:to]) redirect_to namespace_project_compare_path(@project.namespace, @project,
params[:from], params[:to])
end end
end end
...@@ -25,7 +25,8 @@ class Projects::DeployKeysController < Projects::ApplicationController ...@@ -25,7 +25,8 @@ class Projects::DeployKeysController < Projects::ApplicationController
@key = DeployKey.new(deploy_key_params) @key = DeployKey.new(deploy_key_params)
if @key.valid? && @project.deploy_keys << @key if @key.valid? && @project.deploy_keys << @key
redirect_to project_deploy_keys_path(@project) redirect_to namespace_project_deploy_keys_path(@project.namespace,
@project)
else else
render "new" render "new"
end end
...@@ -44,13 +45,15 @@ class Projects::DeployKeysController < Projects::ApplicationController ...@@ -44,13 +45,15 @@ class Projects::DeployKeysController < Projects::ApplicationController
def enable def enable
@project.deploy_keys << available_keys.find(params[:id]) @project.deploy_keys << available_keys.find(params[:id])
redirect_to project_deploy_keys_path(@project) redirect_to namespace_project_deploy_keys_path(@project.namespace,
@project)
end end
def disable def disable
@project.deploy_keys_projects.where(deploy_key_id: params[:id]).last.destroy @project.deploy_keys_projects.where(deploy_key_id: params[:id]).last.destroy
redirect_to project_deploy_keys_path(@project) redirect_to namespace_project_deploy_keys_path(@project.namespace,
@project)
end end
protected protected
......
...@@ -9,11 +9,14 @@ class Projects::ForksController < Projects::ApplicationController ...@@ -9,11 +9,14 @@ class Projects::ForksController < Projects::ApplicationController
end end
def create def create
namespace = Namespace.find(params[:namespace_id]) namespace = Namespace.find(params[:namespace_key])
@forked_project = ::Projects::ForkService.new(project, current_user, namespace: namespace).execute @forked_project = ::Projects::ForkService.new(project, current_user, namespace: namespace).execute
if @forked_project.saved? && @forked_project.forked? if @forked_project.saved? && @forked_project.forked?
redirect_to(@forked_project, notice: 'Project was successfully forked.') redirect_to(
namespace_project_path(@forked_project.namespace, @forked_project),
notice: 'Project was successfully forked.'
)
else else
@title = 'Fork project' @title = 'Fork project'
render :error render :error
......
...@@ -16,7 +16,7 @@ class Projects::HooksController < Projects::ApplicationController ...@@ -16,7 +16,7 @@ class Projects::HooksController < Projects::ApplicationController
@hook.save @hook.save
if @hook.valid? if @hook.valid?
redirect_to project_hooks_path(@project) redirect_to namespace_project_hooks_path(@project.namespace, @project)
else else
@hooks = @project.hooks.select(&:persisted?) @hooks = @project.hooks.select(&:persisted?)
render :index render :index
...@@ -43,7 +43,7 @@ class Projects::HooksController < Projects::ApplicationController ...@@ -43,7 +43,7 @@ class Projects::HooksController < Projects::ApplicationController
def destroy def destroy
hook.destroy hook.destroy
redirect_to project_hooks_path(@project) redirect_to namespace_project_hooks_path(@project.namespace, @project)
end end
private private
......
...@@ -20,7 +20,7 @@ class Projects::ImportsController < Projects::ApplicationController ...@@ -20,7 +20,7 @@ class Projects::ImportsController < Projects::ApplicationController
end end
end end
redirect_to project_import_path(@project) redirect_to namespace_project_import_path(@project.namespace, @project)
end end
def show def show
...@@ -28,7 +28,8 @@ class Projects::ImportsController < Projects::ApplicationController ...@@ -28,7 +28,8 @@ class Projects::ImportsController < Projects::ApplicationController
if @project.import_finished? if @project.import_finished?
redirect_to(@project) and return redirect_to(@project) and return
else else
redirect_to new_project_import_path(@project) and return redirect_to new_namespace_project_import_path(@project.namespace,
@project) && return
end end
end end
end end
...@@ -37,13 +38,14 @@ class Projects::ImportsController < Projects::ApplicationController ...@@ -37,13 +38,14 @@ class Projects::ImportsController < Projects::ApplicationController
def require_no_repo def require_no_repo
if @project.repository_exists? if @project.repository_exists?
redirect_to(@project) and return redirect_to(namespace_project_path(@project.namespace, @project)) and return
end end
end end
def redirect_if_progress def redirect_if_progress
if @project.import_in_progress? if @project.import_in_progress?
redirect_to project_import_path(@project) and return redirect_to namespace_project_import_path(@project.namespace, @project) &&
return
end end
end end
end end
...@@ -60,7 +60,8 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -60,7 +60,8 @@ class Projects::IssuesController < Projects::ApplicationController
respond_to do |format| respond_to do |format|
format.html do format.html do
if @issue.valid? if @issue.valid?
redirect_to project_issue_path(@project, @issue) redirect_to namespace_project_issue_path(@project.namespace,
@project, @issue)
else else
render :new render :new
end end
...@@ -78,7 +79,7 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -78,7 +79,7 @@ class Projects::IssuesController < Projects::ApplicationController
format.js format.js
format.html do format.html do
if @issue.valid? if @issue.valid?
redirect_to [@project, @issue] redirect_to [@project.namespace, @project, @issue]
else else
render :edit render :edit
end end
...@@ -128,7 +129,8 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -128,7 +129,8 @@ class Projects::IssuesController < Projects::ApplicationController
issue = @project.issues.find_by(id: params[:id]) issue = @project.issues.find_by(id: params[:id])
if issue if issue
redirect_to project_issue_path(@project, issue) redirect_to namespace_project_issue_path(@project.namespace, @project,
issue)
return return
else else
raise ActiveRecord::RecordNotFound.new raise ActiveRecord::RecordNotFound.new
......
...@@ -18,7 +18,7 @@ class Projects::LabelsController < Projects::ApplicationController ...@@ -18,7 +18,7 @@ class Projects::LabelsController < Projects::ApplicationController
@label = @project.labels.create(label_params) @label = @project.labels.create(label_params)
if @label.valid? if @label.valid?
redirect_to project_labels_path(@project) redirect_to namespace_project_labels_path(@project.namespace, @project)
else else
render 'new' render 'new'
end end
...@@ -29,7 +29,7 @@ class Projects::LabelsController < Projects::ApplicationController ...@@ -29,7 +29,7 @@ class Projects::LabelsController < Projects::ApplicationController
def update def update
if @label.update_attributes(label_params) if @label.update_attributes(label_params)
redirect_to project_labels_path(@project) redirect_to namespace_project_labels_path(@project.namespace, @project)
else else
render 'edit' render 'edit'
end end
...@@ -39,11 +39,12 @@ class Projects::LabelsController < Projects::ApplicationController ...@@ -39,11 +39,12 @@ class Projects::LabelsController < Projects::ApplicationController
Gitlab::IssuesLabels.generate(@project) Gitlab::IssuesLabels.generate(@project)
if params[:redirect] == 'issues' if params[:redirect] == 'issues'
redirect_to project_issues_path(@project) redirect_to namespace_project_issues_path(@project.namespace, @project)
elsif params[:redirect] == 'merge_requests' elsif params[:redirect] == 'merge_requests'
redirect_to project_merge_requests_path(@project) redirect_to namespace_project_merge_requests_path(@project.namespace,
@project)
else else
redirect_to project_labels_path(@project) redirect_to namespace_project_labels_path(@project.namespace, @project)
end end
end end
...@@ -51,7 +52,10 @@ class Projects::LabelsController < Projects::ApplicationController ...@@ -51,7 +52,10 @@ class Projects::LabelsController < Projects::ApplicationController
@label.destroy @label.destroy
respond_to do |format| respond_to do |format|
format.html { redirect_to project_labels_path(@project), notice: 'Label was removed' } format.html do
redirect_to(namespace_project_labels_path(@project.namespace, @project),
notice: 'Label was removed')
end
format.js format.js
end end
end end
......
...@@ -78,7 +78,12 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -78,7 +78,12 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@merge_request = MergeRequests::CreateService.new(project, current_user, merge_request_params).execute @merge_request = MergeRequests::CreateService.new(project, current_user, merge_request_params).execute
if @merge_request.valid? if @merge_request.valid?
redirect_to project_merge_request_path(@merge_request.target_project, @merge_request), notice: 'Merge request was successfully created.' redirect_to(
namespace_project_merge_request_path(@merge_request.target_project.namespace,
@merge_request.target_project,
@merge_request),
notice: 'Merge request was successfully created.'
)
else else
@source_project = @merge_request.source_project @source_project = @merge_request.source_project
@target_project = @merge_request.target_project @target_project = @merge_request.target_project
...@@ -93,7 +98,9 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -93,7 +98,9 @@ class Projects::MergeRequestsController < Projects::ApplicationController
respond_to do |format| respond_to do |format|
format.js format.js
format.html do format.html do
redirect_to [@merge_request.target_project, @merge_request], notice: 'Merge request was successfully updated.' redirect_to([@merge_request.target_project.namespace.becomes(Namespace),
@merge_request.target_project, @merge_request],
notice: 'Merge request was successfully updated.')
end end
end end
else else
......
...@@ -40,7 +40,8 @@ class Projects::MilestonesController < Projects::ApplicationController ...@@ -40,7 +40,8 @@ class Projects::MilestonesController < Projects::ApplicationController
@milestone = Milestones::CreateService.new(project, current_user, milestone_params).execute @milestone = Milestones::CreateService.new(project, current_user, milestone_params).execute
if @milestone.save if @milestone.save
redirect_to project_milestone_path(@project, @milestone) redirect_to namespace_project_milestone_path(@project.namespace,
@project, @milestone)
else else
render "new" render "new"
end end
...@@ -67,7 +68,7 @@ class Projects::MilestonesController < Projects::ApplicationController ...@@ -67,7 +68,7 @@ class Projects::MilestonesController < Projects::ApplicationController
@milestone.destroy @milestone.destroy
respond_to do |format| respond_to do |format|
format.html { redirect_to project_milestones_path } format.html { redirect_to namespace_project_milestones_path }
format.js { render nothing: true } format.js { render nothing: true }
end end
end end
......
...@@ -12,7 +12,8 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController ...@@ -12,7 +12,8 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController
def create def create
@project.protected_branches.create(protected_branch_params) @project.protected_branches.create(protected_branch_params)
redirect_to project_protected_branches_path(@project) redirect_to namespace_project_protected_branches_path(@project.namespace,
@project)
end end
def update def update
...@@ -37,7 +38,7 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController ...@@ -37,7 +38,7 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController
@project.protected_branches.find(params[:id]).destroy @project.protected_branches.find(params[:id]).destroy
respond_to do |format| respond_to do |format|
format.html { redirect_to project_protected_branches_path } format.html { redirect_to namespace_project_protected_branches_path }
format.js { render nothing: true } format.js { render nothing: true }
end end
end end
......
...@@ -9,13 +9,15 @@ class Projects::RefsController < Projects::ApplicationController ...@@ -9,13 +9,15 @@ class Projects::RefsController < Projects::ApplicationController
respond_to do |format| respond_to do |format|
format.html do format.html do
new_path = if params[:destination] == "tree" new_path = if params[:destination] == "tree"
project_tree_path(@project, (@id)) namespace_project_tree_path(@project.namespace, @project,
(@id))
elsif params[:destination] == "blob" elsif params[:destination] == "blob"
project_blob_path(@project, (@id)) namespace_project_blob_path(@project.namespace, @project,
(@id))
elsif params[:destination] == "graph" elsif params[:destination] == "graph"
project_network_path(@project, @id, @options) namespace_project_network_path(@project.namespace, @project, @id, @options)
else else
project_commits_path(@project, @id) namespace_project_commits_path(@project.namespace, @project, @id)
end end
redirect_to new_path redirect_to new_path
......
...@@ -7,7 +7,7 @@ class Projects::RepositoriesController < Projects::ApplicationController ...@@ -7,7 +7,7 @@ class Projects::RepositoriesController < Projects::ApplicationController
def create def create
@project.create_repository @project.create_repository
redirect_to @project redirect_to namespace_project_path(@project.namespace, @project)
end end
def archive def archive
......
...@@ -17,8 +17,11 @@ class Projects::ServicesController < Projects::ApplicationController ...@@ -17,8 +17,11 @@ class Projects::ServicesController < Projects::ApplicationController
def update def update
if @service.update_attributes(service_params) if @service.update_attributes(service_params)
redirect_to edit_project_service_path(@project, @service.to_param), redirect_to(
notice: 'Successfully updated.' edit_namespace_project_service_path(@project.namespace, @project,
@service.to_param, notice:
'Successfully updated.')
)
else else
render 'edit' render 'edit'
end end
......
...@@ -32,7 +32,8 @@ class Projects::SnippetsController < Projects::ApplicationController ...@@ -32,7 +32,8 @@ class Projects::SnippetsController < Projects::ApplicationController
@snippet.author = current_user @snippet.author = current_user
if @snippet.save if @snippet.save
redirect_to project_snippet_path(@project, @snippet) redirect_to namespace_project_snippet_path(@project.namespace, @project,
@snippet)
else else
respond_with(@snippet) respond_with(@snippet)
end end
...@@ -43,7 +44,7 @@ class Projects::SnippetsController < Projects::ApplicationController ...@@ -43,7 +44,7 @@ class Projects::SnippetsController < Projects::ApplicationController
def update def update
if @snippet.update_attributes(snippet_params) if @snippet.update_attributes(snippet_params)
redirect_to project_snippet_path(@project, @snippet) redirect_to namespace_project_snippet_path(@project.namespace, @project, @snippet)
else else
respond_with(@snippet) respond_with(@snippet)
end end
...@@ -60,7 +61,7 @@ class Projects::SnippetsController < Projects::ApplicationController ...@@ -60,7 +61,7 @@ class Projects::SnippetsController < Projects::ApplicationController
@snippet.destroy @snippet.destroy
redirect_to project_snippets_path(@project) redirect_to namespace_project_snippets_path(@project.namespace, @project)
end end
def raw def raw
......
...@@ -16,7 +16,7 @@ class Projects::TagsController < Projects::ApplicationController ...@@ -16,7 +16,7 @@ class Projects::TagsController < Projects::ApplicationController
if result[:status] == :success if result[:status] == :success
@tag = result[:tag] @tag = result[:tag]
redirect_to project_tags_path(@project) redirect_to namespace_project_tags_path(@project.namespace, @project)
else else
@error = result[:message] @error = result[:message]
render action: 'new' render action: 'new'
...@@ -31,7 +31,7 @@ class Projects::TagsController < Projects::ApplicationController ...@@ -31,7 +31,7 @@ class Projects::TagsController < Projects::ApplicationController
end end
respond_to do |format| respond_to do |format|
format.html { redirect_to project_tags_path } format.html { redirect_to namespace_project_tags_path }
format.js format.js
end end
end end
......
...@@ -21,7 +21,8 @@ class Projects::TeamMembersController < Projects::ApplicationController ...@@ -21,7 +21,8 @@ class Projects::TeamMembersController < Projects::ApplicationController
if params[:redirect_to] if params[:redirect_to]
redirect_to params[:redirect_to] redirect_to params[:redirect_to]
else else
redirect_to project_team_index_path(@project) redirect_to namespace_project_team_index_path(@project.namespace,
@project)
end end
end end
...@@ -32,7 +33,7 @@ class Projects::TeamMembersController < Projects::ApplicationController ...@@ -32,7 +33,7 @@ class Projects::TeamMembersController < Projects::ApplicationController
unless @user_project_relation.valid? unless @user_project_relation.valid?
flash[:alert] = "User should have at least one role" flash[:alert] = "User should have at least one role"
end end
redirect_to project_team_index_path(@project) redirect_to namespace_project_team_index_path(@project.namespace, @project)
end end
def destroy def destroy
...@@ -40,7 +41,10 @@ class Projects::TeamMembersController < Projects::ApplicationController ...@@ -40,7 +41,10 @@ class Projects::TeamMembersController < Projects::ApplicationController
@user_project_relation.destroy @user_project_relation.destroy
respond_to do |format| respond_to do |format|
format.html { redirect_to project_team_index_path(@project) } format.html do
redirect_to namespace_project_team_index_path(@project.namespace,
@project)
end
format.js { render nothing: true } format.js { render nothing: true }
end end
end end
...@@ -59,7 +63,8 @@ class Projects::TeamMembersController < Projects::ApplicationController ...@@ -59,7 +63,8 @@ class Projects::TeamMembersController < Projects::ApplicationController
status = @project.team.import(giver) status = @project.team.import(giver)
notice = status ? "Successfully imported" : "Import failed" notice = status ? "Successfully imported" : "Import failed"
redirect_to project_team_index_path(project), notice: notice redirect_to(namespace_project_team_index_path(project.namespace, project),
notice: notice)
end end
protected protected
......
...@@ -9,7 +9,10 @@ class Projects::TreeController < Projects::ApplicationController ...@@ -9,7 +9,10 @@ class Projects::TreeController < Projects::ApplicationController
def show def show
if tree.entries.empty? if tree.entries.empty?
if @repository.blob_at(@commit.id, @path) if @repository.blob_at(@commit.id, @path)
redirect_to project_blob_path(@project, File.join(@ref, @path)) and return redirect_to(
namespace_project_blob_path(@project.namespace, @project,
File.join(@ref, @path))
) and return
else else
return not_found! return not_found!
end end
......
...@@ -45,7 +45,7 @@ class Projects::WikisController < Projects::ApplicationController ...@@ -45,7 +45,7 @@ class Projects::WikisController < Projects::ApplicationController
return render('empty') unless can?(current_user, :write_wiki, @project) return render('empty') unless can?(current_user, :write_wiki, @project)
if @page.update(content, format, message) if @page.update(content, format, message)
redirect_to [@project, @page], notice: 'Wiki was successfully updated.' redirect_to [@project.namespace.becomes(Namespace), @project, @page], notice: 'Wiki was successfully updated.'
else else
render 'edit' render 'edit'
end end
...@@ -55,7 +55,10 @@ class Projects::WikisController < Projects::ApplicationController ...@@ -55,7 +55,10 @@ class Projects::WikisController < Projects::ApplicationController
@page = WikiPage.new(@project_wiki) @page = WikiPage.new(@project_wiki)
if @page.create(wiki_params) if @page.create(wiki_params)
redirect_to project_wiki_path(@project, @page), notice: 'Wiki was successfully updated.' redirect_to(
namespace_project_wiki_path(@project.namespace, @project, @page),
notice: 'Wiki was successfully updated.'
)
else else
render action: "edit" render action: "edit"
end end
...@@ -65,7 +68,10 @@ class Projects::WikisController < Projects::ApplicationController ...@@ -65,7 +68,10 @@ class Projects::WikisController < Projects::ApplicationController
@page = @project_wiki.find_page(params[:id]) @page = @project_wiki.find_page(params[:id])
unless @page unless @page
redirect_to(project_wiki_path(@project, :home), notice: "Page not found") redirect_to(
namespace_project_wiki_path(@project.namespace, @project, :home),
notice: "Page not found"
)
end end
end end
...@@ -73,7 +79,10 @@ class Projects::WikisController < Projects::ApplicationController ...@@ -73,7 +79,10 @@ class Projects::WikisController < Projects::ApplicationController
@page = @project_wiki.find_page(params[:id]) @page = @project_wiki.find_page(params[:id])
@page.delete if @page @page.delete if @page
redirect_to project_wiki_path(@project, :home), notice: "Page was successfully deleted" redirect_to(
namespace_project_wiki_path(@project.namespace, @project, :home),
notice: "Page was successfully deleted"
)
end end
def git_access def git_access
......
...@@ -22,7 +22,10 @@ class ProjectsController < ApplicationController ...@@ -22,7 +22,10 @@ class ProjectsController < ApplicationController
@project = ::Projects::CreateService.new(current_user, project_params).execute @project = ::Projects::CreateService.new(current_user, project_params).execute
if @project.saved? if @project.saved?
redirect_to project_path(@project), notice: 'Project was successfully created.' redirect_to(
namespace_project_path(@project.namespace, @project),
notice: 'Project was successfully created.'
)
else else
render 'new' render 'new'
end end
...@@ -34,7 +37,12 @@ class ProjectsController < ApplicationController ...@@ -34,7 +37,12 @@ class ProjectsController < ApplicationController
respond_to do |format| respond_to do |format|
if status if status
flash[:notice] = 'Project was successfully updated.' flash[:notice] = 'Project was successfully updated.'
format.html { redirect_to edit_project_path(@project), notice: 'Project was successfully updated.' } format.html do
redirect_to(
edit_namespace_project_path(@project.namespace, @project),
notice: 'Project was successfully updated.'
)
end
format.js format.js
else else
format.html { render 'edit', layout: 'project_settings' } format.html { render 'edit', layout: 'project_settings' }
...@@ -44,7 +52,8 @@ class ProjectsController < ApplicationController ...@@ -44,7 +52,8 @@ class ProjectsController < ApplicationController
end end
def transfer def transfer
::Projects::TransferService.new(project, current_user, project_params).execute transfer_params = params.permit(:new_namespace_id)
::Projects::TransferService.new(project, current_user, transfer_params).execute
if @project.errors[:namespace_id].present? if @project.errors[:namespace_id].present?
flash[:alert] = @project.errors[:namespace_id].first flash[:alert] = @project.errors[:namespace_id].first
end end
...@@ -52,7 +61,7 @@ class ProjectsController < ApplicationController ...@@ -52,7 +61,7 @@ class ProjectsController < ApplicationController
def show def show
if @project.import_in_progress? if @project.import_in_progress?
redirect_to project_import_path(@project) redirect_to namespace_project_import_path(@project.namespace, @project)
return return
end end
...@@ -93,7 +102,7 @@ class ProjectsController < ApplicationController ...@@ -93,7 +102,7 @@ class ProjectsController < ApplicationController
flash[:alert] = 'Project deleted.' flash[:alert] = 'Project deleted.'
if request.referer.include?('/admin') if request.referer.include?('/admin')
redirect_to admin_projects_path redirect_to admin_namespace_projects_path
else else
redirect_to projects_dashboard_path redirect_to projects_dashboard_path
end end
...@@ -124,7 +133,7 @@ class ProjectsController < ApplicationController ...@@ -124,7 +133,7 @@ class ProjectsController < ApplicationController
@project.archive! @project.archive!
respond_to do |format| respond_to do |format|
format.html { redirect_to @project } format.html { redirect_to namespace_project_path(@project.namespace, @project) }
end end
end end
...@@ -133,7 +142,7 @@ class ProjectsController < ApplicationController ...@@ -133,7 +142,7 @@ class ProjectsController < ApplicationController
@project.unarchive! @project.unarchive!
respond_to do |format| respond_to do |format|
format.html { redirect_to @project } format.html { redirect_to namespace_project_path(@project.namespace, @project) }
end end
end end
......
...@@ -61,7 +61,7 @@ module ApplicationHelper ...@@ -61,7 +61,7 @@ module ApplicationHelper
if project.avatar.present? if project.avatar.present?
image_tag project.avatar.url, options image_tag project.avatar.url, options
elsif project.avatar_in_git elsif project.avatar_in_git
image_tag project_avatar_path(project), options image_tag namespace_project_avatar_path(project.namespace, project), options
else # generated icon else # generated icon
project_identicon(project, options) project_identicon(project, options)
end end
......
...@@ -36,8 +36,12 @@ module BlobHelper ...@@ -36,8 +36,12 @@ module BlobHelper
link_opts[:from_merge_request_id] = from_mr if from_mr link_opts[:from_merge_request_id] = from_mr if from_mr
cls = 'btn btn-small' cls = 'btn btn-small'
if allowed_tree_edit?(project, ref) if allowed_tree_edit?(project, ref)
link_to text, project_edit_blob_path(project, tree_join(ref, path), link_to(text,
link_opts), class: cls namespace_project_edit_blob_path(project.namespace, project,
tree_join(ref, path),
link_opts),
class: cls
)
else else
content_tag :span, text, class: cls + ' disabled' content_tag :span, text, class: cls + ' disabled'
end + after.html_safe end + after.html_safe
......
...@@ -37,7 +37,10 @@ module CommitsHelper ...@@ -37,7 +37,10 @@ module CommitsHelper
# Add the root project link and the arrow icon # Add the root project link and the arrow icon
crumbs = content_tag(:li) do crumbs = content_tag(:li) do
link_to(@project.path, project_commits_path(@project, @ref)) link_to(
@project.path,
namespace_project_commits_path(@project.namespace, @project, @ref)
)
end end
if @path if @path
...@@ -46,7 +49,14 @@ module CommitsHelper ...@@ -46,7 +49,14 @@ module CommitsHelper
parts.each_with_index do |part, i| parts.each_with_index do |part, i|
crumbs << content_tag(:li) do crumbs << content_tag(:li) do
# The text is just the individual part, but the link needs all the parts before it # The text is just the individual part, but the link needs all the parts before it
link_to part, project_commits_path(@project, tree_join(@ref, parts[0..i].join('/'))) link_to(
part,
namespace_project_commits_path(
@project.namespace,
@project,
tree_join(@ref, parts[0..i].join('/'))
)
)
end end
end end
end end
...@@ -63,7 +73,9 @@ module CommitsHelper ...@@ -63,7 +73,9 @@ module CommitsHelper
# Returns the sorted alphabetically links to branches, separated by a comma # Returns the sorted alphabetically links to branches, separated by a comma
def commit_branches_links(project, branches) def commit_branches_links(project, branches)
branches.sort.map do |branch| branches.sort.map do |branch|
link_to(project_tree_path(project, branch)) do link_to(
namespace_project_tree_path(project.namespace, project, branch)
) do
content_tag :span, class: 'label label-gray' do content_tag :span, class: 'label label-gray' do
icon('code-fork') + ' ' + branch icon('code-fork') + ' ' + branch
end end
...@@ -75,7 +87,10 @@ module CommitsHelper ...@@ -75,7 +87,10 @@ module CommitsHelper
def commit_tags_links(project, tags) def commit_tags_links(project, tags)
sorted = VersionSorter.rsort(tags) sorted = VersionSorter.rsort(tags)
sorted.map do |tag| sorted.map do |tag|
link_to(project_commits_path(project, project.repository.find_tag(tag).name)) do link_to(
namespace_project_commits_path(project.namespace, project,
project.repository.find_tag(tag).name)
) do
content_tag :span, class: 'label label-gray' do content_tag :span, class: 'label label-gray' do
icon('tag') + ' ' + tag icon('tag') + ' ' + tag
end end
...@@ -86,12 +101,26 @@ module CommitsHelper ...@@ -86,12 +101,26 @@ module CommitsHelper
def link_to_browse_code(project, commit) def link_to_browse_code(project, commit)
if current_controller?(:projects, :commits) if current_controller?(:projects, :commits)
if @repo.blob_at(commit.id, @path) if @repo.blob_at(commit.id, @path)
return link_to "Browse File »", project_blob_path(project, tree_join(commit.id, @path)), class: "pull-right" return link_to(
"Browse File »",
namespace_project_blob_path(project.namespace, project,
tree_join(commit.id, @path)),
class: "pull-right"
)
elsif @path.present? elsif @path.present?
return link_to "Browse Dir »", project_tree_path(project, tree_join(commit.id, @path)), class: "pull-right" return link_to(
"Browse Dir »",
namespace_project_tree_path(project.namespace, project,
tree_join(commit.id, @path)),
class: "pull-right"
)
end end
end end
link_to "Browse Code »", project_tree_path(project, commit), class: "pull-right" link_to(
"Browse Code »",
namespace_project_tree_path(project.namespace, project, commit),
class: "pull-right"
)
end end
protected protected
...@@ -133,8 +162,11 @@ module CommitsHelper ...@@ -133,8 +162,11 @@ module CommitsHelper
end end
def view_file_btn(commit_sha, diff, project) def view_file_btn(commit_sha, diff, project)
link_to project_blob_path(project, tree_join(commit_sha, diff.new_path)), link_to(
class: 'btn btn-small view-file js-view-file' do namespace_project_blob_path(project.namespace, project,
tree_join(commit_sha, diff.new_path)),
class: 'btn btn-small view-file js-view-file'
) do
raw('View file @') + content_tag(:span, commit_sha[0..6], raw('View file @') + content_tag(:span, commit_sha[0..6],
class: 'commit-short-id') class: 'commit-short-id')
end end
......
...@@ -10,6 +10,13 @@ module CompareHelper ...@@ -10,6 +10,13 @@ module CompareHelper
end end
def compare_mr_path def compare_mr_path
new_project_merge_request_path(@project, merge_request: { source_branch: params[:to], target_branch: params[:from] }) new_namespace_project_merge_request_path(
@project.namespace,
@project,
merge_request: {
source_branch: params[:to],
target_branch: params[:from]
}
)
end end
end end
...@@ -74,17 +74,23 @@ module EventsHelper ...@@ -74,17 +74,23 @@ module EventsHelper
def event_feed_url(event) def event_feed_url(event)
if event.issue? if event.issue?
project_issue_url(event.project, event.issue) namespace_project_issue_url(event.project.namespace, event.project,
event.issue)
elsif event.merge_request? elsif event.merge_request?
project_merge_request_url(event.project, event.merge_request) namespace_project_merge_request_url(event.project.namespace,
event.project, event.merge_request)
elsif event.note? && event.note_commit? elsif event.note? && event.note_commit?
project_commit_url(event.project, event.note_target) namespace_project_commit_url(event.project.namespace, event.project,
event.note_target)
elsif event.note? elsif event.note?
if event.note_target if event.note_target
if event.note_commit? if event.note_commit?
project_commit_path(event.project, event.note_commit_id, anchor: dom_id(event.target)) namespace_project_commit_path(event.project.namespace, event.project,
event.note_commit_id,
anchor: dom_id(event.target))
elsif event.note_project_snippet? elsif event.note_project_snippet?
project_snippet_path(event.project, event.note_target) namespace_project_snippet_path(event.project.namespace,
event.project, event.note_target)
else else
event_note_target_path(event) event_note_target_path(event)
end end
...@@ -92,12 +98,16 @@ module EventsHelper ...@@ -92,12 +98,16 @@ module EventsHelper
elsif event.push? elsif event.push?
if event.push_with_commits? if event.push_with_commits?
if event.commits_count > 1 if event.commits_count > 1
project_compare_url(event.project, from: event.commit_from, to: event.commit_to) namespace_project_compare_url(event.project.namespace, event.project,
from: event.commit_from, to:
event.commit_to)
else else
project_commit_url(event.project, id: event.commit_to) namespace_project_commit_url(event.project.namespace, event.project,
id: event.commit_to)
end end
else else
project_commits_url(event.project, event.ref_name) namespace_project_commits_url(event.project.namespace, event.project,
event.ref_name)
end end
end end
end end
...@@ -116,20 +126,30 @@ module EventsHelper ...@@ -116,20 +126,30 @@ module EventsHelper
def event_note_target_path(event) def event_note_target_path(event)
if event.note? && event.note_commit? if event.note? && event.note_commit?
project_commit_path(event.project, event.note_target) namespace_project_commit_path(event.project.namespace, event.project,
event.note_target)
else else
polymorphic_path([event.project, event.note_target], anchor: dom_id(event.target)) polymorphic_path([event.project.namespace.becomes(Namespace),
event.project, event.note_target],
anchor: dom_id(event.target))
end end
end end
def event_note_title_html(event) def event_note_title_html(event)
if event.note_target if event.note_target
if event.note_commit? if event.note_commit?
link_to project_commit_path(event.project, event.note_commit_id, anchor: dom_id(event.target)), class: "commit_short_id" do link_to(
namespace_project_commit_path(event.project.namespace, event.project,
event.note_commit_id,
anchor: dom_id(event.target)),
class: "commit_short_id"
) do
"#{event.note_target_type} #{event.note_short_commit_id}" "#{event.note_target_type} #{event.note_short_commit_id}"
end end
elsif event.note_project_snippet? elsif event.note_project_snippet?
link_to(project_snippet_path(event.project, event.note_target)) do link_to(namespace_project_snippet_path(event.project.namespace,
event.project,
event.note_target)) do
"#{event.note_target_type} ##{truncate event.note_target_id}" "#{event.note_target_type} ##{truncate event.note_target_id}"
end end
else else
......
...@@ -93,8 +93,10 @@ module IssuesHelper ...@@ -93,8 +93,10 @@ module IssuesHelper
def issue_to_atom(xml, issue) def issue_to_atom(xml, issue)
xml.entry do xml.entry do
xml.id project_issue_url(issue.project, issue) xml.id namespace_project_issue_url(issue.project.namespace,
xml.link href: project_issue_url(issue.project, issue) issue.project, issue)
xml.link href: namespace_project_issue_url(issue.project.namespace,
issue.project, issue)
xml.title truncate(issue.title, length: 80) xml.title truncate(issue.title, length: 80)
xml.updated issue.created_at.strftime("%Y-%m-%dT%H:%M:%SZ") xml.updated issue.created_at.strftime("%Y-%m-%dT%H:%M:%SZ")
xml.media :thumbnail, width: "40", height: "40", url: avatar_icon(issue.author_email) xml.media :thumbnail, width: "40", height: "40", url: avatar_icon(issue.author_email)
......
module MergeRequestsHelper module MergeRequestsHelper
def new_mr_path_from_push_event(event) def new_mr_path_from_push_event(event)
target_project = event.project.forked_from_project || event.project target_project = event.project.forked_from_project || event.project
new_project_merge_request_path( new_namespace_project_merge_request_path(
event.project.namespace,
event.project, event.project,
new_mr_from_push_event(event, target_project) new_mr_from_push_event(event, target_project)
) )
end end
def new_mr_path_for_fork_from_push_event(event) def new_mr_path_for_fork_from_push_event(event)
new_project_merge_request_path( new_namespace_project_merge_request_path(
event.project.namespace,
event.project, event.project,
new_mr_from_push_event(event, event.project.forked_from_project) new_mr_from_push_event(event, event.project.forked_from_project)
) )
......
module MilestonesHelper module MilestonesHelper
def milestones_filter_path(opts = {}) def milestones_filter_path(opts = {})
if @project if @project
project_milestones_path(@project, opts) namespace_project_milestones_path(@project.namespace, @project, opts)
elsif @group elsif @group
group_milestones_path(@group, opts) group_milestones_path(@group, opts)
end end
......
...@@ -11,7 +11,11 @@ module NotesHelper ...@@ -11,7 +11,11 @@ module NotesHelper
def link_to_commit_diff_line_note(note) def link_to_commit_diff_line_note(note)
if note.for_commit_diff_line? if note.for_commit_diff_line?
link_to "#{note.diff_file_name}:L#{note.diff_new_line}", project_commit_path(@project, note.noteable, anchor: note.line_code) link_to(
"#{note.diff_file_name}:L#{note.diff_new_line}",
namespace_project_commit_path(@project.namespace, @project,
note.noteable, anchor: note.line_code)
)
end end
end end
......
...@@ -4,7 +4,7 @@ module ProjectsHelper ...@@ -4,7 +4,7 @@ module ProjectsHelper
end end
def link_to_project(project) def link_to_project(project)
link_to project do link_to [project.namespace.becomes(Namespace), project] do
title = content_tag(:span, project.name, class: 'project-name') title = content_tag(:span, project.name, class: 'project-name')
if project.namespace if project.namespace
...@@ -42,12 +42,20 @@ module ProjectsHelper ...@@ -42,12 +42,20 @@ module ProjectsHelper
def project_title(project) def project_title(project)
if project.group if project.group
content_tag :span do content_tag :span do
link_to(simple_sanitize(project.group.name), group_path(project.group)) + ' / ' + link_to(simple_sanitize(project.name), project_path(project)) link_to(
simple_sanitize(project.group.name), group_path(project.group)
) + ' / ' +
link_to(simple_sanitize(project.name),
namespace_project_path(project.namespace, project))
end end
else else
owner = project.namespace.owner owner = project.namespace.owner
content_tag :span do content_tag :span do
link_to(simple_sanitize(owner.name), user_path(owner)) + ' / ' + link_to(simple_sanitize(project.name), project_path(project)) link_to(
simple_sanitize(owner.name), user_path(owner)
) + ' / ' +
link_to(simple_sanitize(project.name),
namespace_project_path(project.namespace, project))
end end
end end
end end
...@@ -100,7 +108,10 @@ module ProjectsHelper ...@@ -100,7 +108,10 @@ module ProjectsHelper
content_tag 'span', class: starred ? 'turn-on' : 'turn-off' do content_tag 'span', class: starred ? 'turn-on' : 'turn-off' do
link_to toggle_star_project_path(@project), link_opts do link_to(
toggle_star_namespace_project_path(@project.namespace, @project),
link_opts
) do
toggle_html + ' ' + count_html toggle_html + ' ' + count_html
end end
end end
...@@ -222,7 +233,12 @@ module ProjectsHelper ...@@ -222,7 +233,12 @@ module ProjectsHelper
def contribution_guide_url(project) def contribution_guide_url(project)
if project && project.repository.contribution_guide if project && project.repository.contribution_guide
project_blob_path(project, tree_join(project.default_branch, project.repository.contribution_guide.name)) namespace_project_blob_path(
project.namespace,
project,
tree_join(project.default_branch,
project.repository.contribution_guide.name)
)
end end
end end
...@@ -236,7 +252,7 @@ module ProjectsHelper ...@@ -236,7 +252,7 @@ module ProjectsHelper
def project_wiki_path_with_version(proj, page, version, is_newest) def project_wiki_path_with_version(proj, page, version, is_newest)
url_params = is_newest ? {} : { version_id: version } url_params = is_newest ? {} : { version_id: version }
project_wiki_path(proj, page, url_params) namespace_project_wiki_path(proj.namespace, proj, page, url_params)
end end
def project_status_css_class(status) def project_status_css_class(status)
......
...@@ -52,16 +52,16 @@ module SearchHelper ...@@ -52,16 +52,16 @@ module SearchHelper
ref = @ref || @project.repository.root_ref ref = @ref || @project.repository.root_ref
[ [
{ label: "#{prefix} - Files", url: project_tree_path(@project, ref) }, { label: "#{prefix} - Files", url: namespace_project_tree_path(@project.namespace, @project, ref) },
{ label: "#{prefix} - Commits", url: project_commits_path(@project, ref) }, { label: "#{prefix} - Commits", url: namespace_project_commits_path(@project.namespace, @project, ref) },
{ label: "#{prefix} - Network", url: project_network_path(@project, ref) }, { label: "#{prefix} - Network", url: namespace_project_network_path(@project.namespace, @project, ref) },
{ label: "#{prefix} - Graph", url: project_graph_path(@project, ref) }, { label: "#{prefix} - Graph", url: namespace_project_graph_path(@project.namespace, @project, ref) },
{ label: "#{prefix} - Issues", url: project_issues_path(@project) }, { label: "#{prefix} - Issues", url: namespace_project_issues_path(@project.namespace, @project) },
{ label: "#{prefix} - Merge Requests", url: project_merge_requests_path(@project) }, { label: "#{prefix} - Merge Requests", url: namespace_project_merge_requests_path(@project.namespace, @project) },
{ label: "#{prefix} - Milestones", url: project_milestones_path(@project) }, { label: "#{prefix} - Milestones", url: namespace_project_milestones_path(@project.namespace, @project) },
{ label: "#{prefix} - Snippets", url: project_snippets_path(@project) }, { label: "#{prefix} - Snippets", url: namespace_project_snippets_path(@project.namespace, @project) },
{ label: "#{prefix} - Team", url: project_team_index_path(@project) }, { label: "#{prefix} - Team", url: namespace_project_team_index_path(@project.namespace, @project) },
{ label: "#{prefix} - Wiki", url: project_wikis_path(@project) }, { label: "#{prefix} - Wiki", url: namespace_project_wikis_path(@project.namespace, @project) },
] ]
else else
[] []
...@@ -84,7 +84,7 @@ module SearchHelper ...@@ -84,7 +84,7 @@ module SearchHelper
sorted_by_stars.non_archived.limit(limit).map do |p| sorted_by_stars.non_archived.limit(limit).map do |p|
{ {
label: "project: #{search_result_sanitize(p.name_with_namespace)}", label: "project: #{search_result_sanitize(p.name_with_namespace)}",
url: project_path(p) url: namespace_project_path(p.namespace, p)
} }
end end
end end
......
...@@ -11,7 +11,8 @@ module SnippetsHelper ...@@ -11,7 +11,8 @@ module SnippetsHelper
def reliable_snippet_path(snippet) def reliable_snippet_path(snippet)
if snippet.project_id? if snippet.project_id?
project_snippet_path(snippet.project, snippet) namespace_project_snippet_path(snippet.project.namespace,
snippet.project, snippet)
else else
snippet_path(snippet) snippet_path(snippet)
end end
......
...@@ -5,19 +5,22 @@ module SubmoduleHelper ...@@ -5,19 +5,22 @@ module SubmoduleHelper
def submodule_links(submodule_item, ref = nil) def submodule_links(submodule_item, ref = nil)
url = @repository.submodule_url_for(ref, submodule_item.path) url = @repository.submodule_url_for(ref, submodule_item.path)
return url, nil unless url =~ /([^\/:]+\/[^\/]+\.git)\Z/ return url, nil unless url =~ /([^\/:]+)\/([^\/]+\.git)\Z/
project = $1 namespace = $1
project = $2
project.chomp!('.git') project.chomp!('.git')
if self_url?(url, project) if self_url?(url, namespace, project)
return project_path(project), project_tree_path(project, submodule_item.id) return namespace_project_path(namespace, project),
namespace_project_tree_path(namespace, project,
submodule_item.id)
elsif relative_self_url?(url) elsif relative_self_url?(url)
relative_self_links(url, submodule_item.id) relative_self_links(url, submodule_item.id)
elsif github_dot_com_url?(url) elsif github_dot_com_url?(url)
standard_links('github.com', project, submodule_item.id) standard_links('github.com', namespace, project, submodule_item.id)
elsif gitlab_dot_com_url?(url) elsif gitlab_dot_com_url?(url)
standard_links('gitlab.com', project, submodule_item.id) standard_links('gitlab.com', namespace, project, submodule_item.id)
else else
return url, nil return url, nil
end end
...@@ -33,9 +36,10 @@ module SubmoduleHelper ...@@ -33,9 +36,10 @@ module SubmoduleHelper
url =~ /gitlab\.com[\/:][^\/]+\/[^\/]+\Z/ url =~ /gitlab\.com[\/:][^\/]+\/[^\/]+\Z/
end end
def self_url?(url, project) def self_url?(url, namespace, project)
return true if url == [ Gitlab.config.gitlab.url, '/', project, '.git' ].join('') return true if url == [ Gitlab.config.gitlab.url, '/', namespace, '/',
url == gitlab_shell.url_to_repo(project) project, '.git' ].join('')
url == gitlab_shell.url_to_repo([namespace, '/', project].join(''))
end end
def relative_self_url?(url) def relative_self_url?(url)
...@@ -43,8 +47,8 @@ module SubmoduleHelper ...@@ -43,8 +47,8 @@ module SubmoduleHelper
url =~ /^((\.\/)?(\.\.\/))(?!(\.\.)|(.*\/)).*\.git\Z/ || url =~ /^((\.\/)?(\.\.\/){2})(?!(\.\.))([^\/]*)\/(?!(\.\.)|(.*\/)).*\.git\Z/ url =~ /^((\.\/)?(\.\.\/))(?!(\.\.)|(.*\/)).*\.git\Z/ || url =~ /^((\.\/)?(\.\.\/){2})(?!(\.\.))([^\/]*)\/(?!(\.\.)|(.*\/)).*\.git\Z/
end end
def standard_links(host, project, commit) def standard_links(host, namespace, project, commit)
base = [ 'https://', host, '/', project ].join('') base = [ 'https://', host, '/', namespace, '/', project ].join('')
return base, [ base, '/tree/', commit ].join('') return base, [ base, '/tree/', commit ].join('')
end end
...@@ -54,6 +58,7 @@ module SubmoduleHelper ...@@ -54,6 +58,7 @@ module SubmoduleHelper
else else
base = [ @project.group.path, '/', url[/([^\/]*)\.git/, 1] ].join('') base = [ @project.group.path, '/', url[/([^\/]*)\.git/, 1] ].join('')
end end
return project_path(base), project_tree_path(base, commit) return namespace_project_path(base.namespace, base),
namespace_project_tree_path(base.namespace, base, commit)
end end
end end
...@@ -97,7 +97,8 @@ module TabHelper ...@@ -97,7 +97,8 @@ module TabHelper
def branches_tab_class def branches_tab_class
if current_controller?(:protected_branches) || if current_controller?(:protected_branches) ||
current_controller?(:branches) || current_controller?(:branches) ||
current_page?(project_repository_path(@project)) current_page?(namespace_project_repository_path(@project.namespace,
@project))
'active' 'active'
end end
end end
......
...@@ -3,7 +3,7 @@ module Emails ...@@ -3,7 +3,7 @@ module Emails
def new_issue_email(recipient_id, issue_id) def new_issue_email(recipient_id, issue_id)
@issue = Issue.find(issue_id) @issue = Issue.find(issue_id)
@project = @issue.project @project = @issue.project
@target_url = project_issue_url(@project, @issue) @target_url = namespace_project_issue_url(@project.namespace, @project, @issue)
mail_new_thread(@issue, mail_new_thread(@issue,
from: sender(@issue.author_id), from: sender(@issue.author_id),
to: recipient(recipient_id), to: recipient(recipient_id),
...@@ -14,7 +14,7 @@ module Emails ...@@ -14,7 +14,7 @@ module Emails
@issue = Issue.find(issue_id) @issue = Issue.find(issue_id)
@previous_assignee = User.find_by(id: previous_assignee_id) if previous_assignee_id @previous_assignee = User.find_by(id: previous_assignee_id) if previous_assignee_id
@project = @issue.project @project = @issue.project
@target_url = project_issue_url(@project, @issue) @target_url = namespace_project_issue_url(@project.namespace, @project, @issue)
mail_answer_thread(@issue, mail_answer_thread(@issue,
from: sender(updated_by_user_id), from: sender(updated_by_user_id),
to: recipient(recipient_id), to: recipient(recipient_id),
...@@ -25,7 +25,7 @@ module Emails ...@@ -25,7 +25,7 @@ module Emails
@issue = Issue.find issue_id @issue = Issue.find issue_id
@project = @issue.project @project = @issue.project
@updated_by = User.find updated_by_user_id @updated_by = User.find updated_by_user_id
@target_url = project_issue_url(@project, @issue) @target_url = namespace_project_issue_url(@project.namespace, @project, @issue)
mail_answer_thread(@issue, mail_answer_thread(@issue,
from: sender(updated_by_user_id), from: sender(updated_by_user_id),
to: recipient(recipient_id), to: recipient(recipient_id),
...@@ -37,7 +37,7 @@ module Emails ...@@ -37,7 +37,7 @@ module Emails
@issue_status = status @issue_status = status
@project = @issue.project @project = @issue.project
@updated_by = User.find updated_by_user_id @updated_by = User.find updated_by_user_id
@target_url = project_issue_url(@project, @issue) @target_url = namespace_project_issue_url(@project.namespace, @project, @issue)
mail_answer_thread(@issue, mail_answer_thread(@issue,
from: sender(updated_by_user_id), from: sender(updated_by_user_id),
to: recipient(recipient_id), to: recipient(recipient_id),
......
...@@ -3,7 +3,9 @@ module Emails ...@@ -3,7 +3,9 @@ module Emails
def new_merge_request_email(recipient_id, merge_request_id) def new_merge_request_email(recipient_id, merge_request_id)
@merge_request = MergeRequest.find(merge_request_id) @merge_request = MergeRequest.find(merge_request_id)
@project = @merge_request.project @project = @merge_request.project
@target_url = project_merge_request_url(@project, @merge_request) @target_url = namespace_project_merge_request_url(@project.namespace,
@project,
@merge_request)
mail_new_thread(@merge_request, mail_new_thread(@merge_request,
from: sender(@merge_request.author_id), from: sender(@merge_request.author_id),
to: recipient(recipient_id), to: recipient(recipient_id),
...@@ -14,7 +16,9 @@ module Emails ...@@ -14,7 +16,9 @@ module Emails
@merge_request = MergeRequest.find(merge_request_id) @merge_request = MergeRequest.find(merge_request_id)
@previous_assignee = User.find_by(id: previous_assignee_id) if previous_assignee_id @previous_assignee = User.find_by(id: previous_assignee_id) if previous_assignee_id
@project = @merge_request.project @project = @merge_request.project
@target_url = project_merge_request_url(@project, @merge_request) @target_url = namespace_project_merge_request_url(@project.namespace,
@project,
@merge_request)
mail_answer_thread(@merge_request, mail_answer_thread(@merge_request,
from: sender(updated_by_user_id), from: sender(updated_by_user_id),
to: recipient(recipient_id), to: recipient(recipient_id),
...@@ -25,7 +29,9 @@ module Emails ...@@ -25,7 +29,9 @@ module Emails
@merge_request = MergeRequest.find(merge_request_id) @merge_request = MergeRequest.find(merge_request_id)
@updated_by = User.find updated_by_user_id @updated_by = User.find updated_by_user_id
@project = @merge_request.project @project = @merge_request.project
@target_url = project_merge_request_url(@project, @merge_request) @target_url = namespace_project_merge_request_url(@project.namespace,
@project,
@merge_request)
mail_answer_thread(@merge_request, mail_answer_thread(@merge_request,
from: sender(updated_by_user_id), from: sender(updated_by_user_id),
to: recipient(recipient_id), to: recipient(recipient_id),
...@@ -35,7 +41,9 @@ module Emails ...@@ -35,7 +41,9 @@ module Emails
def merged_merge_request_email(recipient_id, merge_request_id, updated_by_user_id) def merged_merge_request_email(recipient_id, merge_request_id, updated_by_user_id)
@merge_request = MergeRequest.find(merge_request_id) @merge_request = MergeRequest.find(merge_request_id)
@project = @merge_request.project @project = @merge_request.project
@target_url = project_merge_request_url(@project, @merge_request) @target_url = namespace_project_merge_request_url(@project.namespace,
@project,
@merge_request)
mail_answer_thread(@merge_request, mail_answer_thread(@merge_request,
from: sender(updated_by_user_id), from: sender(updated_by_user_id),
to: recipient(recipient_id), to: recipient(recipient_id),
...@@ -47,7 +55,9 @@ module Emails ...@@ -47,7 +55,9 @@ module Emails
@mr_status = status @mr_status = status
@project = @merge_request.project @project = @merge_request.project
@updated_by = User.find updated_by_user_id @updated_by = User.find updated_by_user_id
@target_url = project_merge_request_url(@project, @merge_request) @target_url = namespace_project_merge_request_url(@project.namespace,
@project,
@merge_request)
set_reference("merge_request_#{merge_request_id}") set_reference("merge_request_#{merge_request_id}")
mail_answer_thread(@merge_request, mail_answer_thread(@merge_request,
from: sender(updated_by_user_id), from: sender(updated_by_user_id),
......
...@@ -4,7 +4,9 @@ module Emails ...@@ -4,7 +4,9 @@ module Emails
@note = Note.find(note_id) @note = Note.find(note_id)
@commit = @note.noteable @commit = @note.noteable
@project = @note.project @project = @note.project
@target_url = project_commit_url(@project, @commit, anchor: "note_#{@note.id}") @target_url = namespace_project_commit_url(@project.namespace, @project,
@commit, anchor:
"note_#{@note.id}")
mail_answer_thread(@commit, mail_answer_thread(@commit,
from: sender(@note.author_id), from: sender(@note.author_id),
to: recipient(recipient_id), to: recipient(recipient_id),
...@@ -15,7 +17,9 @@ module Emails ...@@ -15,7 +17,9 @@ module Emails
@note = Note.find(note_id) @note = Note.find(note_id)
@issue = @note.noteable @issue = @note.noteable
@project = @note.project @project = @note.project
@target_url = project_issue_url(@project, @issue, anchor: "note_#{@note.id}") @target_url = namespace_project_issue_url(@project.namespace, @project,
@issue, anchor:
"note_#{@note.id}")
mail_answer_thread(@issue, mail_answer_thread(@issue,
from: sender(@note.author_id), from: sender(@note.author_id),
to: recipient(recipient_id), to: recipient(recipient_id),
...@@ -26,7 +30,10 @@ module Emails ...@@ -26,7 +30,10 @@ module Emails
@note = Note.find(note_id) @note = Note.find(note_id)
@merge_request = @note.noteable @merge_request = @note.noteable
@project = @note.project @project = @note.project
@target_url = project_merge_request_url(@project, @merge_request, anchor: "note_#{@note.id}") @target_url = namespace_project_merge_request_url(@project.namespace,
@project,
@merge_request, anchor:
"note_#{@note.id}")
mail_answer_thread(@merge_request, mail_answer_thread(@merge_request,
from: sender(@note.author_id), from: sender(@note.author_id),
to: recipient(recipient_id), to: recipient(recipient_id),
......
...@@ -3,7 +3,7 @@ module Emails ...@@ -3,7 +3,7 @@ module Emails
def project_access_granted_email(user_project_id) def project_access_granted_email(user_project_id)
@project_member = ProjectMember.find user_project_id @project_member = ProjectMember.find user_project_id
@project = @project_member.project @project = @project_member.project
@target_url = project_url(@project) @target_url = namespace_project_url(@project.namespace, @project)
mail(to: @project_member.user.email, mail(to: @project_member.user.email,
subject: subject("Access to project was granted")) subject: subject("Access to project was granted"))
end end
...@@ -11,7 +11,7 @@ module Emails ...@@ -11,7 +11,7 @@ module Emails
def project_was_moved_email(project_id, user_id) def project_was_moved_email(project_id, user_id)
@user = User.find user_id @user = User.find user_id
@project = Project.find project_id @project = Project.find project_id
@target_url = project_url(@project) @target_url = namespace_project_url(@project.namespace, @project)
mail(to: @user.notification_email, mail(to: @user.notification_email,
subject: subject("Project was moved")) subject: subject("Project was moved"))
end end
...@@ -24,10 +24,14 @@ module Emails ...@@ -24,10 +24,14 @@ module Emails
@diffs = compare.diffs @diffs = compare.diffs
@branch = branch @branch = branch
if @commits.length > 1 if @commits.length > 1
@target_url = project_compare_url(@project, from: @commits.first, to: @commits.last) @target_url = namespace_project_compare_url(@project.namespace,
@project,
from: @commits.first,
to: @commits.last)
@subject = "#{@commits.length} new commits pushed to repository" @subject = "#{@commits.length} new commits pushed to repository"
else else
@target_url = project_commit_url(@project, @commits.first) @target_url = namespace_project_commit_url(@project.namespace,
@project, @commits.first)
@subject = @commits.first.title @subject = @commits.first.title
end end
......
...@@ -285,7 +285,7 @@ class Project < ActiveRecord::Base ...@@ -285,7 +285,7 @@ class Project < ActiveRecord::Base
end end
def to_param def to_param
namespace.path + '/' + path path
end end
def web_url def web_url
......
...@@ -27,14 +27,14 @@ class GitlabIssueTrackerService < IssueTrackerService ...@@ -27,14 +27,14 @@ class GitlabIssueTrackerService < IssueTrackerService
end end
def project_url def project_url
project_issues_path(project) namespace_project_issues_path(project.namespace, project)
end end
def new_issue_url def new_issue_url
new_project_issue_path project_id: project new_namespace_project_issue_path namespace_id: project.namespace, project_id: project
end end
def issue_url(iid) def issue_url(iid)
"#{Gitlab.config.gitlab.url}#{project_issue_path(project_id: project, id: iid)}" "#{Gitlab.config.gitlab.url}#{namespace_project_issue_path(namespace_id: project.namespace, project_id: project, id: iid)}"
end end
end end
...@@ -12,7 +12,7 @@ module Projects ...@@ -12,7 +12,7 @@ module Projects
class TransferError < StandardError; end class TransferError < StandardError; end
def execute def execute
namespace_id = params[:namespace_id] namespace_id = params[:new_namespace_id]
namespace = Namespace.find_by(id: namespace_id) namespace = Namespace.find_by(id: namespace_id)
if allowed_transfer?(current_user, project, namespace) if allowed_transfer?(current_user, project, namespace)
......
...@@ -85,10 +85,10 @@ ...@@ -85,10 +85,10 @@
.light-well .light-well
%h4 Projects %h4 Projects
.data .data
= link_to admin_projects_path do = link_to admin_namespaces_projects_path do
%h1= Project.count %h1= Project.count
%hr %hr
= link_to 'New Project', new_project_path, class: "btn btn-new" = link_to('New Project', new_project_path, class: "btn btn-new")
.col-sm-4 .col-sm-4
.light-well .light-well
%h4 Users %h4 Users
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
%hr %hr
- @projects.each do |project| - @projects.each do |project|
%p %p
= link_to project.name_with_namespace, [:admin, project], class: 'str-truncated' = link_to project.name_with_namespace, [:admin, project.namespace.becomes(Namespace), project], class: 'str-truncated'
%span.light.pull-right %span.light.pull-right
#{time_ago_with_tooltip(project.created_at)} #{time_ago_with_tooltip(project.created_at)}
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
- @projects.each do |project| - @projects.each do |project|
%li %li
%strong %strong
= link_to project.name_with_namespace, [:admin, project] = link_to project.name_with_namespace, [:admin, project.namespace.becomes(Namespace), project]
%span.label.label-gray %span.label.label-gray
= repository_size(project) = repository_size(project)
%span.pull-right.light %span.pull-right.light
......
.row .row
.col-md-3 .col-md-3
.admin-filter .admin-filter
= form_tag admin_projects_path, method: :get, class: '' do = form_tag admin_namespaces_projects_path, method: :get, class: '' do
.form-group .form-group
= label_tag :name, 'Name:' = label_tag :name, 'Name:'
= text_field_tag :name, params[:name], class: "form-control" = text_field_tag :name, params[:name], class: "form-control"
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
%hr %hr
= hidden_field_tag :sort, params[:sort] = hidden_field_tag :sort, params[:sort]
= button_tag "Search", class: "btn submit btn-primary" = button_tag "Search", class: "btn submit btn-primary"
= link_to "Reset", admin_projects_path, class: "btn btn-cancel" = link_to "Reset", admin_namespaces_projects_path, class: "btn btn-cancel"
.col-md-9 .col-md-9
.panel.panel-default .panel.panel-default
...@@ -51,15 +51,15 @@ ...@@ -51,15 +51,15 @@
%b.caret %b.caret
%ul.dropdown-menu %ul.dropdown-menu
%li %li
= link_to admin_projects_path(sort: sort_value_recently_created) do = link_to admin_namespaces_projects_path(sort: sort_value_recently_created) do
= sort_title_recently_created = sort_title_recently_created
= link_to admin_projects_path(sort: sort_value_oldest_created) do = link_to admin_namespaces_projects_path(sort: sort_value_oldest_created) do
= sort_title_oldest_created = sort_title_oldest_created
= link_to admin_projects_path(sort: sort_value_recently_updated) do = link_to admin_namespaces_projects_path(sort: sort_value_recently_updated) do
= sort_title_recently_updated = sort_title_recently_updated
= link_to admin_projects_path(sort: sort_value_oldest_updated) do = link_to admin_namespaces_projects_path(sort: sort_value_oldest_updated) do
= sort_title_oldest_updated = sort_title_oldest_updated
= link_to admin_projects_path(sort: sort_value_largest_repo) do = link_to admin_namespaces_projects_path(sort: sort_value_largest_repo) do
= sort_title_largest_repo = sort_title_largest_repo
= link_to 'New Project', new_project_path, class: "btn btn-new" = link_to 'New Project', new_project_path, class: "btn btn-new"
%ul.well-list %ul.well-list
...@@ -68,12 +68,12 @@ ...@@ -68,12 +68,12 @@
.list-item-name .list-item-name
%span{ class: visibility_level_color(project.visibility_level) } %span{ class: visibility_level_color(project.visibility_level) }
= visibility_level_icon(project.visibility_level) = visibility_level_icon(project.visibility_level)
= link_to project.name_with_namespace, [:admin, project] = link_to project.name_with_namespace, [:admin, project.namespace.becomes(Namespace), project]
.pull-right .pull-right
%span.label.label-gray %span.label.label-gray
= repository_size(project) = repository_size(project)
= link_to 'Edit', edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small" = link_to 'Edit', edit_namespace_project_path(project.namespace, project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
= link_to 'Destroy', [project], data: { confirm: remove_project_message(project) }, method: :delete, class: "btn btn-small btn-remove" = link_to 'Destroy', [project.namespace.becomes(Namespace), project], data: { confirm: remove_project_message(project) }, method: :delete, class: "btn btn-small btn-remove"
- if @projects.blank? - if @projects.blank?
.nothing-here-block 0 projects matches .nothing-here-block 0 projects matches
= paginate @projects, theme: "gitlab" = paginate @projects, theme: "gitlab"
%h3.page-title %h3.page-title
Project: #{@project.name_with_namespace} Project: #{@project.name_with_namespace}
= link_to edit_project_path(@project), class: "btn pull-right" do = link_to edit_namespace_project_path(@project.namespace, @project), class: "btn pull-right" do
%i.fa.fa-pencil-square-o %i.fa.fa-pencil-square-o
Edit Edit
%hr %hr
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
%li %li
%span.light Name: %span.light Name:
%strong %strong
= link_to @project.name, project_path(@project) = link_to @project.name, namespace_project_path(@project.namespace, @project)
%li %li
%span.light Namespace: %span.light Namespace:
%strong %strong
...@@ -79,11 +79,11 @@ ...@@ -79,11 +79,11 @@
.panel-heading .panel-heading
Transfer project Transfer project
.panel-body .panel-body
= form_for @project, url: transfer_admin_project_path(@project), method: :put, html: { class: 'form-horizontal' } do |f| = form_for @project, url: transfer_admin_namespace_project_path(@project.namespace, @project), method: :put, html: { class: 'form-horizontal' } do |f|
.form-group .form-group
= f.label :namespace_id, "Namespace", class: 'control-label' = f.label :new_namespace_id, "Namespace", class: 'control-label'
.col-sm-10 .col-sm-10
= namespace_select_tag :namespace_id, selected: params[:namespace_id], class: 'input-large' = namespace_select_tag :new_namespace_id, selected: params[:namespace_id], class: 'input-large'
.form-group .form-group
.col-sm-2 .col-sm-2
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
%small %small
(#{@project.users.count}) (#{@project.users.count})
.pull-right .pull-right
= link_to project_team_index_path(@project), class: "btn btn-tiny" do = link_to namespace_project_team_index_path(@project.namespace, @project), class: "btn btn-tiny" do
%i.fa.fa-pencil-square-o %i.fa.fa-pencil-square-o
Manage Access Manage Access
%ul.well-list.team_members %ul.well-list.team_members
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
%span.light Owner %span.light Owner
- else - else
%span.light= project_member.human_access %span.light= project_member.human_access
= link_to project_team_member_path(@project, user), data: { confirm: remove_from_project_team_message(@project, user)}, method: :delete, remote: true, class: "btn btn-small btn-remove" do = link_to namespace_project_team_member_path(@project.namespace, @project, user), data: { confirm: remove_from_project_team_message(@project, user)}, method: :delete, remote: true, class: "btn btn-small btn-remove" do
%i.fa.fa-times %i.fa.fa-times
.panel-footer .panel-footer
= paginate @project_members, param_name: 'project_members_page', theme: 'gitlab' = paginate @project_members, param_name: 'project_members_page', theme: 'gitlab'
...@@ -206,7 +206,7 @@ ...@@ -206,7 +206,7 @@
- tm = project.team.find_tm(@user.id) - tm = project.team.find_tm(@user.id)
%li.project_member %li.project_member
.list-item-name .list-item-name
= link_to admin_project_path(project), class: dom_class(project) do = link_to admin_namespace_project_path(project.namespace, project), class: dom_class(project) do
= project.name_with_namespace = project.name_with_namespace
- if tm - if tm
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
%span.light= tm.human_access %span.light= tm.human_access
- if tm.respond_to? :project - if tm.respond_to? :project
= link_to project_team_member_path(project, @user), data: { confirm: remove_from_project_team_message(project, @user) }, remote: true, method: :delete, class: "btn-tiny btn btn-remove", title: 'Remove user from project' do = link_to namespace_project_team_member_path(project.namespace, project, @user), data: { confirm: remove_from_project_team_message(project, @user) }, remote: true, method: :delete, class: "btn-tiny btn btn-remove", title: 'Remove user from project' do
%i.fa.fa-times %i.fa.fa-times
#ssh-keys.tab-pane #ssh-keys.tab-pane
= render 'profiles/keys/key_table', admin: true = render 'profiles/keys/key_table', admin: true
= link_to project_path(project), class: dom_class(project) do = link_to namespace_project_path(project.namespace, project), class: dom_class(project) do
.dash-project-avatar .dash-project-avatar
= project_icon(project, alt: '', class: 'avatar project-avatar s40') = project_icon(project, alt: '', class: 'avatar project-avatar s40')
.dash-project-access-icon .dash-project-access-icon
......
...@@ -20,6 +20,6 @@ ...@@ -20,6 +20,6 @@
%span.light %span.light
#{@projects_limit} of #{pluralize(@projects_count, 'project')} displayed. #{@projects_limit} of #{pluralize(@projects_count, 'project')} displayed.
.pull-right .pull-right
= link_to projects_dashboard_path do = link_to namespace_projects_dashboard_path do
Show all Show all
%i.fa.fa-angle-right %i.fa.fa-angle-right
...@@ -16,10 +16,10 @@ ...@@ -16,10 +16,10 @@
%li.my-project-row %li.my-project-row
%h4.project-title %h4.project-title
.pull-left .pull-left
= project_icon(project.to_param, alt: '', class: 'avatar project-avatar s60') = project_icon("#{project.namespace.to_param}/#{project.to_param}", alt: '', class: 'avatar project-avatar s60')
.project-access-icon .project-access-icon
= visibility_level_icon(project.visibility_level) = visibility_level_icon(project.visibility_level)
= link_to project_path(project), class: dom_class(project) do = link_to namespace_project_path(project.namespace, project), class: dom_class(project) do
%strong= project.name_with_namespace %strong= project.name_with_namespace
- if project.forked_from_project - if project.forked_from_project
...@@ -27,11 +27,11 @@ ...@@ -27,11 +27,11 @@
%small %small
%i.fa.fa-code-fork %i.fa.fa-code-fork
Forked from: Forked from:
= link_to project.forked_from_project.name_with_namespace, project_path(project.forked_from_project) = link_to project.forked_from_project.name_with_namespace, namespace_project_path(project.namespace, project.forked_from_project)
- if current_user.can_leave_project?(project) - if current_user.can_leave_project?(project)
.pull-right .pull-right
= link_to leave_project_team_members_path(project), data: { confirm: "Leave project?"}, method: :delete, remote: true, class: "btn-tiny btn remove-row", title: 'Leave project' do = link_to leave_namespace_project_team_members_path(project.namespace, project), data: { confirm: "Leave project?"}, method: :delete, remote: true, class: "btn-tiny btn remove-row", title: 'Leave project' do
%i.fa.fa-sign-out %i.fa.fa-sign-out
Leave Leave
......
%li.commit %li.commit
.commit-row-title .commit-row-title
= link_to truncate_sha(commit[:id]), project_commit_path(project, commit[:id]), class: "commit_short_id", alt: '' = link_to truncate_sha(commit[:id]), namespace_project_commit_path(project.namespace, project, commit[:id]), class: "commit_short_id", alt: ''
&nbsp; &nbsp;
= gfm event_commit_title(commit[:message]), project = gfm event_commit_title(commit[:message]), project
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.event-last-push .event-last-push
.event-last-push-text .event-last-push-text
%span You pushed to %span You pushed to
= link_to project_commits_path(event.project, event.ref_name) do = link_to namespace_project_commits_path(event.project.namespace, event.project, event.ref_name) do
%strong= event.ref_name %strong= event.ref_name
at at
%strong= link_to_project event.project %strong= link_to_project event.project
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
- event.commits.first(15).each do |commit| - event.commits.first(15).each do |commit|
%p %p
%strong= commit[:author][:name] %strong= commit[:author][:name]
= link_to "(##{truncate_sha(commit[:id])})", project_commit_path(event.project, id: commit[:id]) = link_to "(##{truncate_sha(commit[:id])})", namespace_project_commit_path(event.project.namespace, event.project, id: commit[:id])
%i %i
at at
= commit[:timestamp].to_time.to_s(:short) = commit[:timestamp].to_time.to_s(:short)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
= event_action_name(event) = event_action_name(event)
- if event.target - if event.target
%strong= link_to "##{event.target_iid}", [event.project, event.target] %strong= link_to "##{event.target_iid}", [event.project.namespace.becomes(Namespace), event.project, event.target]
at at
- if event.project - if event.project
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
- if event.rm_ref? - if event.rm_ref?
%strong= event.ref_name %strong= event.ref_name
- else - else
= link_to project_commits_path(event.project, event.ref_name) do = link_to namespace_project_commits_path(event.project.namespace, event.project, event.ref_name) do
%strong= event.ref_name %strong= event.ref_name
at at
= link_to_project event.project = link_to_project event.project
...@@ -21,5 +21,5 @@ ...@@ -21,5 +21,5 @@
%li.commits-stat %li.commits-stat
- if event.commits_count > 2 - if event.commits_count > 2
%span ... and #{event.commits_count - 2} more commits. %span ... and #{event.commits_count - 2} more commits.
= link_to project_compare_path(event.project, from: event.commit_from, to: event.commit_to) do = link_to namespace_project_compare_path(event.project.namespace, event.project, from: event.commit_from, to: event.commit_to) do
%strong Compare &rarr; #{truncate_sha(event.commit_from)}...#{truncate_sha(event.commit_to)} %strong Compare &rarr; #{truncate_sha(event.commit_from)}...#{truncate_sha(event.commit_to)}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
%h4.project-title %h4.project-title
.project-access-icon .project-access-icon
= visibility_level_icon(project.visibility_level) = visibility_level_icon(project.visibility_level)
= link_to project.name_with_namespace, project = link_to project.name_with_namespace, [project.namespace.becomes(Namespace), project]
%span.pull-right %span.pull-right
%i.fa.fa-star %i.fa.fa-star
= project.star_count = project.star_count
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
.repo-info .repo-info
- unless project.empty_repo? - unless project.empty_repo?
= link_to pluralize(project.repository.round_commit_count, 'commit'), project_commits_path(project, project.default_branch) = link_to pluralize(project.repository.round_commit_count, 'commit'), namespace_project_commits_path(project.namespace, project, project.default_branch)
&middot; &middot;
= link_to pluralize(project.repository.branch_names.count, 'branch'), project_branches_path(project) = link_to pluralize(project.repository.branch_names.count, 'branch'), namespace_project_branches_path(project.namespace, project)
&middot; &middot;
= link_to pluralize(project.repository.tag_names.count, 'tag'), project_tags_path(project) = link_to pluralize(project.repository.tag_names.count, 'tag'), namespace_project_tags_path(project.namespace, project)
- else - else
%i.fa.fa-exclamation-triangle %i.fa.fa-exclamation-triangle
Empty repository Empty repository
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
.nothing-here-block This group has no projects yet .nothing-here-block This group has no projects yet
- projects.each do |project| - projects.each do |project|
%li.project-row %li.project-row
= link_to project_path(project), class: dom_class(project) do = link_to namespace_project_path(project.namespace, project), class: dom_class(project) do
.dash-project-avatar .dash-project-avatar
= project_icon(project, alt: '', class: 'avatar s40') = project_icon(project, alt: '', class: 'avatar s40')
.dash-project-access-icon .dash-project-access-icon
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
%span.milestone-row %span.milestone-row
- project = issue.project - project = issue.project
%strong #{project.name} &middot; %strong #{project.name} &middot;
= link_to [project, issue] do = link_to [project.namespace.becomes(Namespace), project, issue] do
%span.cgray ##{issue.iid} %span.cgray ##{issue.iid}
= link_to_gfm issue.title, [project, issue], title: issue.title = link_to_gfm issue.title, [project.namespace.becomes(Namespace), project, issue], title: issue.title
.pull-right.assignee-icon .pull-right.assignee-icon
- if issue.assignee - if issue.assignee
= image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16" = image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16"
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
%span.milestone-row %span.milestone-row
- project = merge_request.project - project = merge_request.project
%strong #{project.name} &middot; %strong #{project.name} &middot;
= link_to [project, merge_request] do = link_to [project.namespace.becomes(Namespace), project, merge_request] do
%span.cgray ##{merge_request.iid} %span.cgray ##{merge_request.iid}
= link_to_gfm merge_request.title, [project, merge_request], title: merge_request.title = link_to_gfm merge_request.title, [project.namespace.becomes(Namespace), project, merge_request], title: merge_request.title
.pull-right.assignee-icon .pull-right.assignee-icon
- if merge_request.assignee - if merge_request.assignee
= image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16" = image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16"
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
- @group_milestone.milestones.each do |milestone| - @group_milestone.milestones.each do |milestone|
%tr %tr
%td %td
= link_to "#{milestone.project.name}", project_milestone_path(milestone.project, milestone) = link_to "#{milestone.project.name}", namespace_project_milestone_path(milestone.project.namespace, milestone.project, milestone)
%td %td
= milestone.issues.opened.count = milestone.issues.opened.count
%td %td
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
%span.label.label-gray %span.label.label-gray
= repository_size(project) = repository_size(project)
.pull-right .pull-right
= link_to 'Members', project_team_index_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small" = link_to 'Members', namespace_project_team_index_path(project.namespace, project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
= link_to 'Edit', edit_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small" = link_to 'Edit', edit_namespace_project_path(project.namespace, project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
= link_to 'Remove', project, data: { confirm: remove_project_message(project)}, method: :delete, class: "btn btn-small btn-remove" = link_to 'Remove', project, data: { confirm: remove_project_message(project)}, method: :delete, class: "btn btn-small btn-remove"
- if @projects.blank? - if @projects.blank?
.nothing-here-block This group has no projects yet .nothing-here-block This group has no projects yet
......
...@@ -23,6 +23,6 @@ ...@@ -23,6 +23,6 @@
= auto_discovery_link_tag :atom, projects_url(:atom, private_token: current_user.private_token), title: "Dashboard feed" = auto_discovery_link_tag :atom, projects_url(:atom, private_token: current_user.private_token), title: "Dashboard feed"
- if @project && !@project.new_record? - if @project && !@project.new_record?
- if current_controller?(:tree, :commits) - if current_controller?(:tree, :commits)
= auto_discovery_link_tag(:atom, project_commits_url(@project, @ref, format: :atom, private_token: current_user.private_token), title: "Recent commits to #{@project.name}:#{@ref}") = auto_discovery_link_tag(:atom, namespace_project_commits_url(@project.namespace, @project, @ref, format: :atom, private_token: current_user.private_token), title: "Recent commits to #{@project.name}:#{@ref}")
- if current_controller?(:issues) - if current_controller?(:issues)
= auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues") = auto_discovery_link_tag(:atom, namespace_project_issues_url(@project.namespace, @project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues")
:javascript :javascript
GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_project_path(@project, type: @noteable.class, type_id: params[:id])}" GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_namespace_project_path(@project.namespace, @project, type: @noteable.class, type_id: params[:id])}"
GitLab.GfmAutoComplete.setup(); GitLab.GfmAutoComplete.setup();
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
%span %span
Overview Overview
= nav_link(controller: :projects) do = nav_link(controller: :projects) do
= link_to admin_projects_path, title: 'Projects' do = link_to admin_namespaces_projects_path, title: 'Projects' do
%i.fa.fa-cube %i.fa.fa-cube
%span %span
Projects Projects
......
%ul.project-navigation.nav.nav-sidebar %ul.project-navigation.nav.nav-sidebar
- if @project_settings_nav - if @project_settings_nav
= nav_link do = nav_link do
= link_to project_path(@project), title: 'Back to project', class: "" do = link_to namespace_project_path(@project.namespace, @project), title: 'Back to project', class: "" do
%i.fa.fa-angle-left %i.fa.fa-angle-left
%span %span
Back to project Back to project
= nav_link(html_options: {class: "#{project_tab_class} separate-item"}) do = nav_link(html_options: {class: "#{project_tab_class} separate-item"}) do
= link_to edit_project_path(@project), title: 'Settings', class: "stat-tab tab no-highlight" do = link_to edit_namespace_project_path(@project.namespace, @project), title: 'Settings', class: "stat-tab tab no-highlight" do
%i.fa.fa-cogs %i.fa.fa-cogs
%span %span
Settings Settings
...@@ -17,40 +17,40 @@ ...@@ -17,40 +17,40 @@
- else - else
= nav_link(path: 'projects#show', html_options: {class: "home"}) do = nav_link(path: 'projects#show', html_options: {class: "home"}) do
= link_to project_path(@project), title: 'Project', class: 'shortcuts-project' do = link_to namespace_project_path(@project.namespace, @project), title: 'Project', class: 'shortcuts-project' do
%i.fa.fa-dashboard %i.fa.fa-dashboard
%span %span
Project Project
- if project_nav_tab? :files - if project_nav_tab? :files
= nav_link(controller: %w(tree blob blame edit_tree new_tree)) do = nav_link(controller: %w(tree blob blame edit_tree new_tree)) do
= link_to project_tree_path(@project, @ref || @repository.root_ref), title: 'Files', class: 'shortcuts-tree' do = link_to namespace_project_tree_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Files', class: 'shortcuts-tree' do
%i.fa.fa-files-o %i.fa.fa-files-o
%span %span
Files Files
- if project_nav_tab? :commits - if project_nav_tab? :commits
= nav_link(controller: %w(commit commits compare repositories tags branches)) do = nav_link(controller: %w(commit commits compare repositories tags branches)) do
= link_to project_commits_path(@project, @ref || @repository.root_ref), title: 'Commits', class: 'shortcuts-commits' do = link_to namespace_project_commits_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Commits', class: 'shortcuts-commits' do
%i.fa.fa-history %i.fa.fa-history
%span %span
Commits Commits
- if project_nav_tab? :network - if project_nav_tab? :network
= nav_link(controller: %w(network)) do = nav_link(controller: %w(network)) do
= link_to project_network_path(@project, @ref || @repository.root_ref), title: 'Network', class: 'shortcuts-network' do = link_to namespace_project_network_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Network', class: 'shortcuts-network' do
%i.fa.fa-code-fork %i.fa.fa-code-fork
%span %span
Network Network
- if project_nav_tab? :graphs - if project_nav_tab? :graphs
= nav_link(controller: %w(graphs)) do = nav_link(controller: %w(graphs)) do
= link_to project_graph_path(@project, @ref || @repository.root_ref), title: 'Graphs', class: 'shortcuts-graphs' do = link_to namespace_project_graph_path(@project.namespace, @project, @ref || @repository.root_ref), title: 'Graphs', class: 'shortcuts-graphs' do
%i.fa.fa-area-chart %i.fa.fa-area-chart
%span %span
Graphs Graphs
= nav_link(controller: :milestones) do = nav_link(controller: :milestones) do
= link_to project_milestones_path(@project), title: 'Milestones' do = link_to namespace_project_milestones_path(@project.namespace, @project), title: 'Milestones' do
%i.fa.fa-clock-o %i.fa.fa-clock-o
%span %span
Milestones Milestones
...@@ -66,35 +66,35 @@ ...@@ -66,35 +66,35 @@
- if project_nav_tab? :merge_requests - if project_nav_tab? :merge_requests
= nav_link(controller: :merge_requests) do = nav_link(controller: :merge_requests) do
= link_to project_merge_requests_path(@project), title: 'Merge Requests', class: 'shortcuts-merge_requests' do = link_to namespace_project_merge_requests_path(@project.namespace, @project), title: 'Merge Requests', class: 'shortcuts-merge_requests' do
%i.fa.fa-tasks %i.fa.fa-tasks
%span %span
Merge Requests Merge Requests
%span.count.merge_counter= @project.merge_requests.opened.count %span.count.merge_counter= @project.merge_requests.opened.count
= nav_link(controller: :labels) do = nav_link(controller: :labels) do
= link_to project_labels_path(@project), title: 'Labels' do = link_to namespace_project_labels_path(@project.namespace, @project), title: 'Labels' do
%i.fa.fa-tags %i.fa.fa-tags
%span %span
Labels Labels
- if project_nav_tab? :wiki - if project_nav_tab? :wiki
= nav_link(controller: :wikis) do = nav_link(controller: :wikis) do
= link_to project_wiki_path(@project, :home), title: 'Wiki', class: 'shortcuts-wiki' do = link_to namespace_project_wiki_path(@project.namespace, @project, :home), title: 'Wiki', class: 'shortcuts-wiki' do
%i.fa.fa-book %i.fa.fa-book
%span %span
Wiki Wiki
- if project_nav_tab? :snippets - if project_nav_tab? :snippets
= nav_link(controller: :snippets) do = nav_link(controller: :snippets) do
= link_to project_snippets_path(@project), title: 'Snippets', class: 'shortcuts-snippets' do = link_to namespace_project_snippets_path(@project.namespace, @project), title: 'Snippets', class: 'shortcuts-snippets' do
%i.fa.fa-file-text-o %i.fa.fa-file-text-o
%span %span
Snippets Snippets
- if project_nav_tab? :settings - if project_nav_tab? :settings
= nav_link(html_options: {class: "#{project_tab_class} separate-item"}) do = nav_link(html_options: {class: "#{project_tab_class} separate-item"}) do
= link_to edit_project_path(@project), title: 'Settings', class: "stat-tab tab no-highlight" do = link_to edit_namespace_project_path(@project.namespace, @project), title: 'Settings', class: "stat-tab tab no-highlight" do
%i.fa.fa-cogs %i.fa.fa-cogs
%span %span
Settings Settings
......
...@@ -28,4 +28,4 @@ ...@@ -28,4 +28,4 @@
#{link_to "View it on GitLab", @target_url} #{link_to "View it on GitLab", @target_url}
= email_action @target_url = email_action @target_url
- if @project - if @project
You're receiving this notification because you are a member of the #{link_to_unless @target_url, @project.name_with_namespace, project_url(@project)} project team. You're receiving this notification because you are a member of the #{link_to_unless @target_url, @project.name_with_namespace, namespace_project_url(@project.namespace, @project)} project team.
Reassigned <%= issuable.class.model_name.human.titleize %> <%= issuable.iid %> Reassigned <%= issuable.class.model_name.human.titleize %> <%= issuable.iid %>
<%= url_for([issuable.project, issuable, {only_path: false}]) %> <%= url_for([issuable.project.namespace.becomes(Namespace), issuable.project, issuable, {only_path: false}]) %>
Assignee changed <%= "from #{@previous_assignee.name}" if @previous_assignee -%> Assignee changed <%= "from #{@previous_assignee.name}" if @previous_assignee -%>
to <%= "#{issuable.assignee_id ? issuable.assignee_name : 'Unassigned'}" %> to <%= "#{issuable.assignee_id ? issuable.assignee_name : 'Unassigned'}" %>
= "Issue was closed by #{@updated_by.name}" = "Issue was closed by #{@updated_by.name}"
Issue ##{@issue.iid}: #{project_issue_url(@issue.project, @issue)} Issue ##{@issue.iid}: #{namespace_project_issue_url(@issue.project.namespace, @issue.project, @issue)}
= "Merge Request ##{@merge_request.iid} was closed by #{@updated_by.name}" = "Merge Request ##{@merge_request.iid} was closed by #{@updated_by.name}"
Merge Request url: #{project_merge_request_url(@merge_request.target_project, @merge_request)} Merge Request url: #{namespace_project_merge_request_url(@merge_request.target_project.namespace, @merge_request.target_project, @merge_request)}
= merge_path_description(@merge_request, 'to') = merge_path_description(@merge_request, 'to')
......
Issue was <%= @issue_status %> by <%= @updated_by.name %> Issue was <%= @issue_status %> by <%= @updated_by.name %>
Issue <%= @issue.iid %>: <%= url_for(project_issue_url(@issue.project, @issue)) %> Issue <%= @issue.iid %>: <%= url_for(namespace_project_issue_url(@issue.project.namespace, @issue.project, @issue)) %>
= "Merge Request ##{@merge_request.iid} was #{@mr_status} by #{@updated_by.name}" = "Merge Request ##{@merge_request.iid} was #{@mr_status} by #{@updated_by.name}"
Merge Request url: #{project_merge_request_url(@merge_request.target_project, @merge_request)} Merge Request url: #{namespace_project_merge_request_url(@merge_request.target_project.namespace, @merge_request.target_project, @merge_request)}
= merge_path_description(@merge_request, 'to') = merge_path_description(@merge_request, 'to')
......
= "Merge Request ##{@merge_request.iid} was merged" = "Merge Request ##{@merge_request.iid} was merged"
Merge Request Url: #{project_merge_request_url(@merge_request.target_project, @merge_request)} Merge Request Url: #{namespace_project_merge_request_url(@merge_request.target_project.namespace, @merge_request.target_project, @merge_request)}
= merge_path_description(@merge_request, 'to') = merge_path_description(@merge_request, 'to')
......
New Issue was created. New Issue was created.
Issue <%= @issue.iid %>: <%= url_for(project_issue_url(@issue.project, @issue)) %> Issue <%= @issue.iid %>: <%= url_for(namespace_project_issue_url(@issue.project.namespace, @issue.project, @issue)) %>
Author: <%= @issue.author_name %> Author: <%= @issue.author_name %>
Asignee: <%= @issue.assignee_name %> Asignee: <%= @issue.assignee_name %>
New Merge Request #<%= @merge_request.iid %> New Merge Request #<%= @merge_request.iid %>
<%= url_for(project_merge_request_url(@merge_request.target_project, @merge_request)) %> <%= url_for(namespace_project_merge_request_url(@merge_request.target_project.namespace, @merge_request.target_project, @merge_request)) %>
<%= merge_path_description(@merge_request, 'to') %> <%= merge_path_description(@merge_request, 'to') %>
Author: <%= @merge_request.author_name %> Author: <%= @merge_request.author_name %>
......
New comment for Commit <%= @commit.short_id %> New comment for Commit <%= @commit.short_id %>
<%= url_for(project_commit_url(@note.project, id: @commit.id, anchor: "note_#{@note.id}")) %> <%= url_for(namespace_project_commit_url(@note.project.namespace, @note.project, id: @commit.id, anchor: "note_#{@note.id}")) %>
Author: <%= @note.author_name %> Author: <%= @note.author_name %>
......
New comment for Issue <%= @issue.iid %> New comment for Issue <%= @issue.iid %>
<%= url_for(project_issue_url(@issue.project, @issue, anchor: "note_#{@note.id}")) %> <%= url_for(namespace_project_issue_url(@issue.project.namespace, @issue.project, @issue, anchor: "note_#{@note.id}")) %>
Author: <%= @note.author_name %> Author: <%= @note.author_name %>
......
New comment for Merge Request <%= @merge_request.iid %> New comment for Merge Request <%= @merge_request.iid %>
<%= url_for(project_merge_request_url(@merge_request.target_project, @merge_request, anchor: "note_#{@note.id}")) %> <%= url_for(namespace_project_merge_request_url(@merge_request.target_project.namespace, @merge_request.target_project, @merge_request, anchor: "note_#{@note.id}")) %>
<%= @note.author_name %> <%= @note.author_name %>
......
%p %p
= "You have been granted #{@project_member.human_access} access to project" = "You have been granted #{@project_member.human_access} access to project"
%p %p
= link_to project_url(@project) do = link_to namespace_project_url(@project.namespace, @project) do
= @project.name_with_namespace = @project.name_with_namespace
You have been granted <%= @project_member.human_access %> access to project <%= @project.name_with_namespace %> You have been granted <%= @project_member.human_access %> access to project <%= @project.name_with_namespace %>
<%= url_for(project_url(@project)) %> <%= url_for(namespace_project_url(@project.namespace, @project)) %>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Project was moved to another location Project was moved to another location
%p %p
The project is now located under The project is now located under
= link_to project_url(@project) do = link_to namespace_project_url(@project.namespace, @project) do
= @project.name_with_namespace = @project.name_with_namespace
%p %p
To update the remote url in your local repository run (for ssh): To update the remote url in your local repository run (for ssh):
......
Project was moved to another location Project was moved to another location
The project is now located under The project is now located under
<%= project_url(@project) %> <%= namespace_project_url(@project.namespace, @project) %>
To update the remote url in your local repository run (for ssh): To update the remote url in your local repository run (for ssh):
......
%h3 #{@author.name} pushed to #{@branch} at #{link_to @project.name_with_namespace, project_url(@project)} %h3 #{@author.name} pushed to #{@branch} at #{link_to @project.name_with_namespace, namespace_project_url(@project.namespace, @project)}
%h4 Commits: %h4 Commits:
%ul %ul
- @commits.each do |commit| - @commits.each do |commit|
%li %li
%strong #{link_to commit.short_id, project_commit_url(@project, commit)} %strong #{link_to commit.short_id, namespace_project_commit_url(@project.namespace, @project, commit)}
%div %div
%span by #{commit.author_name} %span by #{commit.author_name}
%i at #{commit.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ")} %i at #{commit.committed_date.strftime("%Y-%m-%dT%H:%M:%SZ")}
......
#{@author.name} pushed to #{@branch} at #{link_to @project.name_with_namespace, project_url(@project)} #{@author.name} pushed to #{@branch} at #{link_to @project.name_with_namespace, namespace_project_url(@project.namespace, @project)}
\ \
Commits: Commits:
- @commits.each do |commit| - @commits.each do |commit|
#{link_to commit.short_id, project_commit_url(@project, commit)} by #{commit.author_name} #{link_to commit.short_id, namespace_project_commit_url(@project.namespace, @project, commit)} by #{commit.author_name}
#{commit.safe_message} #{commit.safe_message}
\- - - - - \- - - - -
\ \
......
...@@ -9,24 +9,24 @@ ...@@ -9,24 +9,24 @@
New issue New issue
- if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project) - if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project)
%li %li
= link_to new_project_merge_request_path(@project), title: "New Merge Request" do = link_to new_namespace_project_merge_request_path(@project.namespace, @project), title: "New Merge Request" do
New merge request New merge request
- if @project.snippets_enabled && can?(current_user, :write_snippet, @project) - if @project.snippets_enabled && can?(current_user, :write_snippet, @project)
%li %li
= link_to new_project_snippet_path(@project), title: "New Snippet" do = link_to new_namespace_project_snippet_path(@project.namespace, @project), title: "New Snippet" do
New snippet New snippet
- if can?(current_user, :admin_team_member, @project) - if can?(current_user, :admin_team_member, @project)
%li %li
= link_to new_project_team_member_path(@project), title: "New project member" do = link_to new_namespace_project_team_member_path(@project.namespace, @project), title: "New project member" do
New project member New project member
- if can? current_user, :push_code, @project - if can? current_user, :push_code, @project
%li.divider %li.divider
%li %li
= link_to new_project_branch_path(@project) do = link_to new_namespace_project_branch_path(@project.namespace, @project) do
%i.fa.fa-code-fork %i.fa.fa-code-fork
Git branch Git branch
%li %li
= link_to new_project_tag_path(@project) do = link_to new_namespace_project_tag_path(@project.namespace, @project) do
%i.fa.fa-tag %i.fa.fa-tag
Git tag Git tag
......
...@@ -8,21 +8,21 @@ ...@@ -8,21 +8,21 @@
= escaped_autolink(@project.description) = escaped_autolink(@project.description)
- if can?(current_user, :admin_project, @project) - if can?(current_user, :admin_project, @project)
&ndash; &ndash;
= link_to 'Edit', edit_project_path = link_to 'Edit', edit_namespace_project_path
- elsif !@project.empty_repo? && @repository.readme - elsif !@project.empty_repo? && @repository.readme
- readme = @repository.readme - readme = @repository.readme
&ndash; &ndash;
= link_to project_blob_path(@project, tree_join(@repository.root_ref, readme.name)) do = link_to namespace_project_blob_path(@project.namespace, @project, tree_join(@repository.root_ref, readme.name)) do
= readme.name = readme.name
.star-fork-buttons .star-fork-buttons
- unless @project.empty_repo? - unless @project.empty_repo?
.fork-buttons .fork-buttons
- if current_user && can?(current_user, :fork_project, @project) && @project.namespace != current_user.namespace - if current_user && can?(current_user, :fork_project, @project) && @project.namespace != current_user.namespace
- if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2 - if current_user.already_forked?(@project) && current_user.manageable_namespaces.size < 2
= link_to project_path(current_user.fork_of(@project)), title: 'Go to my fork' do = link_to namespace_project_path(current_user, current_user.fork_of(@project)), title: 'Go to my fork' do
= link_to_toggle_fork = link_to_toggle_fork
- else - else
= link_to new_project_fork_path(@project), title: "Fork project" do = link_to new_namespace_project_fork_path(@project.namespace, @project), title: "Fork project" do
= link_to_toggle_fork = link_to_toggle_fork
.star-buttons .star-buttons
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
%span.light No open milestones available. %span.light No open milestones available.
&nbsp; &nbsp;
- if can? current_user, :admin_milestone, issuable.project - if can? current_user, :admin_milestone, issuable.project
= link_to 'Create new milestone', new_project_milestone_path(issuable.project), target: :blank = link_to 'Create new milestone', new_namespace_project_milestone_path(issuable.project.namespace, issuable.project), target: :blank
.form-group .form-group
= f.label :label_ids, class: 'control-label' do = f.label :label_ids, class: 'control-label' do
%i.fa.fa-tag %i.fa.fa-tag
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
%span.light No labels yet. %span.light No labels yet.
&nbsp; &nbsp;
- if can? current_user, :admin_label, issuable.project - if can? current_user, :admin_label, issuable.project
= link_to 'Create new label', new_project_label_path(issuable.project), target: :blank = link_to 'Create new label', new_namespace_project_label_path(issuable.project.namespace, issuable.project), target: :blank
.form-actions .form-actions
- if !issuable.project.empty_repo? && contribution_guide_url(issuable.project) && !issuable.persisted? - if !issuable.project.empty_repo? && contribution_guide_url(issuable.project) && !issuable.persisted?
...@@ -82,4 +82,4 @@ ...@@ -82,4 +82,4 @@
- cancel_project = issuable.source_project - cancel_project = issuable.source_project
- else - else
- cancel_project = issuable.project - cancel_project = issuable.project
= link_to 'Cancel', [cancel_project, issuable], class: 'btn btn-cancel' = link_to 'Cancel', [cancel_project.namespace.becomes(Namespace), cancel_project, issuable], class: 'btn btn-cancel'
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
Write Write
%li %li
= link_to '#md-preview-holder', class: 'js-md-preview-button', = link_to '#md-preview-holder', class: 'js-md-preview-button',
data: { url: markdown_preview_project_path(@project) } do data: { url: markdown_preview_namespace_project_path(@project.namespace, @project) } do
Preview Preview
%div %div
.md-write-holder .md-write-holder
......
%ul.project-settings-nav.sidebar-subnav %ul.project-settings-nav.sidebar-subnav
= nav_link(path: 'projects#edit') do = nav_link(path: 'projects#edit') do
= link_to edit_project_path(@project), title: 'Project', class: "stat-tab tab " do = link_to edit_namespace_project_path(@project.namespace, @project), title: 'Project', class: "stat-tab tab " do
%i.fa.fa-pencil-square-o %i.fa.fa-pencil-square-o
%span %span
Project Project
= nav_link(controller: [:team_members, :teams]) do = nav_link(controller: [:team_members, :teams]) do
= link_to project_team_index_path(@project), title: 'Members', class: "team-tab tab" do = link_to namespace_project_team_index_path(@project.namespace, @project), title: 'Members', class: "team-tab tab" do
%i.fa.fa-users %i.fa.fa-users
%span %span
Members Members
= nav_link(controller: :deploy_keys) do = nav_link(controller: :deploy_keys) do
= link_to project_deploy_keys_path(@project), title: 'Deploy Keys' do = link_to namespace_project_deploy_keys_path(@project.namespace, @project), title: 'Deploy Keys' do
%i.fa.fa-key %i.fa.fa-key
%span %span
Deploy Keys Deploy Keys
= nav_link(controller: :hooks) do = nav_link(controller: :hooks) do
= link_to project_hooks_path(@project), title: 'Web Hooks' do = link_to namespace_project_hooks_path(@project.namespace, @project), title: 'Web Hooks' do
%i.fa.fa-link %i.fa.fa-link
%span %span
Web Hooks Web Hooks
= nav_link(controller: :services) do = nav_link(controller: :services) do
= link_to project_services_path(@project), title: 'Services' do = link_to namespace_project_services_path(@project.namespace, @project), title: 'Services' do
%i.fa.fa-cogs %i.fa.fa-cogs
%span %span
Services Services
= nav_link(controller: :protected_branches) do = nav_link(controller: :protected_branches) do
= link_to project_protected_branches_path(@project), title: 'Protected Branches' do = link_to namespace_project_protected_branches_path(@project.namespace, @project), title: 'Protected Branches' do
%i.fa.fa-lock %i.fa.fa-lock
%span %span
Protected branches Protected branches
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
%tr %tr
%td.blame-commit %td.blame-commit
%span.commit %span.commit
= link_to commit.short_id, project_commit_path(@project, commit), class: "commit_short_id" = link_to commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit), class: "commit_short_id"
&nbsp; &nbsp;
= commit_author_link(commit, avatar: true, size: 16) = commit_author_link(commit, avatar: true, size: 16)
&nbsp; &nbsp;
= link_to_gfm truncate(commit.title, length: 20), project_commit_path(@project, commit.id), class: "row_title" = link_to_gfm truncate(commit.title, length: 20), namespace_project_commit_path(@project.namespace, @project, commit.id), class: "row_title"
%td.lines.blame-numbers %td.lines.blame-numbers
%pre %pre
- (since...(since + lines.count)).each do |i| - (since...(since + lines.count)).each do |i|
......
.btn-group.tree-btn-group .btn-group.tree-btn-group
= edit_blob_link(@project, @ref, @path) = edit_blob_link(@project, @ref, @path)
= link_to 'Raw', project_raw_path(@project, @id), = link_to 'Raw', namespace_project_raw_path(@project.namespace, @project, @id),
class: 'btn btn-small', target: '_blank' class: 'btn btn-small', target: '_blank'
-# only show normal/blame view links for text files -# only show normal/blame view links for text files
- if @blob.text? - if @blob.text?
- if current_page? project_blame_path(@project, @id) - if current_page? namespace_project_blame_path(@project.namespace, @project, @id)
= link_to 'Normal View', project_blob_path(@project, @id), = link_to 'Normal View', namespace_project_blob_path(@project.namespace, @project, @id),
class: 'btn btn-small' class: 'btn btn-small'
- else - else
= link_to 'Blame', project_blame_path(@project, @id), = link_to 'Blame', namespace_project_blame_path(@project.namespace, @project, @id),
class: 'btn btn-small' unless @blob.empty? class: 'btn btn-small' unless @blob.empty?
= link_to 'History', project_commits_path(@project, @id), = link_to 'History', namespace_project_commits_path(@project.namespace, @project, @id),
class: 'btn btn-small' class: 'btn btn-small'
- if @ref != @commit.sha - if @ref != @commit.sha
= link_to 'Permalink', project_blob_path(@project, = link_to 'Permalink', namespace_project_blob_path(@project.namespace, @project,
tree_join(@commit.sha, @path)), class: 'btn btn-small' tree_join(@commit.sha, @path)), class: 'btn btn-small'
- if allowed_tree_edit? - if allowed_tree_edit?
......
%ul.breadcrumb.repo-breadcrumb %ul.breadcrumb.repo-breadcrumb
%li %li
%i.fa.fa-angle-right %i.fa.fa-angle-right
= link_to project_tree_path(@project, @ref) do = link_to namespace_project_tree_path(@project.namespace, @project, @ref) do
= @project.path = @project.path
- tree_breadcrumbs(@tree, 6) do |title, path| - tree_breadcrumbs(@tree, 6) do |title, path|
%li %li
- if path - if path
- if path.end_with?(@path) - if path.end_with?(@path)
= link_to project_blob_path(@project, path) do = link_to namespace_project_blob_path(@project.namespace, @project, path) do
%strong %strong
= truncate(title, length: 40) = truncate(title, length: 40)
- else - else
= link_to truncate(title, length: 40), project_tree_path(@project, path) = link_to truncate(title, length: 40), namespace_project_tree_path(@project.namespace, @project, path)
- else - else
= link_to title, '#' = link_to title, '#'
......
.file-content.blob_file.blob-no-preview .file-content.blob_file.blob-no-preview
.center .center
= link_to project_raw_path(@project, @id) do = link_to namespace_project_raw_path(@project.namespace, @project, @id) do
%h1.light %h1.light
%i.fa.fa-download %i.fa.fa-download
%h4 %h4
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
%strong= @ref %strong= @ref
.modal-body .modal-body
= form_tag project_blob_path(@project, @id), method: :delete, class: 'form-horizontal' do = form_tag namespace_project_blob_path(@project.namespace, @project, @id), method: :delete, class: 'form-horizontal' do
= render 'shared/commit_message_container', params: params, = render 'shared/commit_message_container', params: params,
placeholder: 'Removed this file because...' placeholder: 'Removed this file because...'
.form-group .form-group
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
Edit file Edit file
%li %li
= link_to '#preview', 'data-preview-url' => project_preview_blob_path(@project, @id) do = link_to '#preview', 'data-preview-url' => namespace_project_preview_blob_path(@project.namespace, @project, @id) do
%i.fa.fa-eye %i.fa.fa-eye
= editing_preview_title(@blob.name) = editing_preview_title(@blob.name)
= form_tag(project_update_blob_path(@project, @id), method: :put, class: "form-horizontal") do = form_tag(namespace_project_update_blob_path(@project.namespace, @project, @id), method: :put, class: "form-horizontal") do
= render 'projects/blob/editor', ref: @ref, path: @path, blob_data: @blob.data = render 'projects/blob/editor', ref: @ref, path: @path, blob_data: @blob.data
= render 'shared/commit_message_container', params: params, = render 'shared/commit_message_container', params: params,
placeholder: "Update #{@blob.name}" placeholder: "Update #{@blob.name}"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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