Commit 76aad9b7 authored by Vinnie Okada's avatar Vinnie Okada

Upgrade to Rails 4.1.9

Make the following changes to deal with new behavior in Rails 4.1.2:

* Use nested resources to avoid slashes in arguments to path helpers.
parent 5725b6da
......@@ -53,6 +53,7 @@ v 7.8.0 (unreleased)
- Show assignees in merge request index page (Kelvin Mutuma)
- Link head panel titles to relevant root page.
- Allow users that signed up via OAuth to set their password in order to use Git over HTTP(S).
- Upgrade Rails gem to version 4.1.9.
v 7.7.2
- Update GitLab Shell to version 2.4.2 that fixes a bug when developers can push to protected branch
......
......@@ -3,31 +3,31 @@ GEM
specs:
RedCloth (4.2.9)
ace-rails-ap (2.0.1)
actionmailer (4.1.1)
actionpack (= 4.1.1)
actionview (= 4.1.1)
mail (~> 2.5.4)
actionpack (4.1.1)
actionview (= 4.1.1)
activesupport (= 4.1.1)
actionmailer (4.1.9)
actionpack (= 4.1.9)
actionview (= 4.1.9)
mail (~> 2.5, >= 2.5.4)
actionpack (4.1.9)
actionview (= 4.1.9)
activesupport (= 4.1.9)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
actionview (4.1.1)
activesupport (= 4.1.1)
actionview (4.1.9)
activesupport (= 4.1.9)
builder (~> 3.1)
erubis (~> 2.7.0)
activemodel (4.1.1)
activesupport (= 4.1.1)
activemodel (4.1.9)
activesupport (= 4.1.9)
builder (~> 3.1)
activerecord (4.1.1)
activemodel (= 4.1.1)
activesupport (= 4.1.1)
activerecord (4.1.9)
activemodel (= 4.1.9)
activesupport (= 4.1.9)
arel (~> 5.0.0)
activeresource (4.0.0)
activemodel (~> 4.0)
activesupport (~> 4.0)
rails-observers (~> 0.1.1)
activesupport (4.1.1)
activesupport (4.1.9)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
......@@ -303,9 +303,8 @@ GEM
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
lumberjack (1.0.4)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mail (2.6.3)
mime-types (>= 1.16, < 3)
method_source (0.8.2)
mime-types (1.25.1)
mini_portile (0.6.1)
......@@ -372,7 +371,6 @@ GEM
cliver (~> 0.3.1)
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
polyglot (0.3.4)
posix-spawn (0.3.9)
powerpack (0.0.9)
pry (0.9.12.4)
......@@ -403,30 +401,30 @@ GEM
rack (>= 1.1)
rack-protection (1.5.1)
rack
rack-test (0.6.2)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.1.1)
actionmailer (= 4.1.1)
actionpack (= 4.1.1)
actionview (= 4.1.1)
activemodel (= 4.1.1)
activerecord (= 4.1.1)
activesupport (= 4.1.1)
rails (4.1.9)
actionmailer (= 4.1.9)
actionpack (= 4.1.9)
actionview (= 4.1.9)
activemodel (= 4.1.9)
activerecord (= 4.1.9)
activesupport (= 4.1.9)
bundler (>= 1.3.0, < 2.0)
railties (= 4.1.1)
railties (= 4.1.9)
sprockets-rails (~> 2.0)
rails-observers (0.1.2)
activemodel (~> 4.0)
rails_autolink (1.1.6)
rails (> 3.1)
railties (4.1.1)
actionpack (= 4.1.1)
activesupport (= 4.1.1)
railties (4.1.9)
actionpack (= 4.1.9)
activesupport (= 4.1.9)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.0.0)
raindrops (0.13.0)
rake (10.3.2)
rake (10.4.2)
raphael-rails (2.1.2)
rb-fsevent (0.9.3)
rb-inotify (0.9.2)
......@@ -553,10 +551,10 @@ GEM
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.1.3)
sprockets-rails (2.2.4)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
sprockets (>= 2.8, < 4.0)
stamp (0.5.0)
state_machine (1.2.0)
stringex (2.5.2)
......@@ -587,9 +585,6 @@ GEM
multi_json (~> 1.7)
twitter-stream (~> 0.1)
tins (0.13.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
turbolinks (2.0.0)
coffee-rails
twitter-stream (0.1.16)
......
......@@ -25,13 +25,16 @@ class Admin::ProjectsController < Admin::ApplicationController
def transfer
::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
protected
def project
@project = Project.find_with_namespace(params[:id])
@project = Project.find_with_namespace(
[params[:namespace_id], '/', params[:id]].join('')
)
@project || render_404
end
......
......@@ -93,6 +93,7 @@ class ApplicationController < ActionController::Base
def project
unless @project
namespace = params[:namespace_id]
id = params[:project_id] || params[:id]
# Redirect from
......@@ -104,7 +105,7 @@ class ApplicationController < ActionController::Base
redirect_to request.original_url.gsub(/\.git\Z/, '') and return
end
@project = Project.find_with_namespace(id)
@project = Project.find_with_namespace("#{namespace}/#{id}")
if @project and can?(current_user, :read_project, @project)
@project
......@@ -121,7 +122,8 @@ class ApplicationController < ActionController::Base
def repository
@repository ||= project.repository
rescue Grit::NoSuchPathError
rescue Grit::NoSuchPathError(e)
log_exception(e)
nil
end
......
......@@ -8,7 +8,8 @@ class Projects::ApplicationController < ApplicationController
# for non-signed users
if !current_user
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?
end
......@@ -26,7 +27,10 @@ class Projects::ApplicationController < ApplicationController
def require_branch_head
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
......@@ -24,6 +24,6 @@ class Projects::AvatarsController < Projects::ApplicationController
@project.save
@project.reset_events_cache
redirect_to edit_project_path(@project)
redirect_to edit_namespace_project_path(@project.namespace, @project)
end
end
......@@ -25,7 +25,7 @@ class Projects::BlobController < Projects::ApplicationController
if result[:status] == :success
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
flash[:alert] = result[:message]
render :new
......@@ -70,7 +70,8 @@ class Projects::BlobController < Projects::ApplicationController
if result[:status] == :success
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
flash[:alert] = result[:message]
render :show
......@@ -102,7 +103,7 @@ class Projects::BlobController < Projects::ApplicationController
else
if tree = @repository.tree(@commit.id, @path)
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
......@@ -128,10 +129,10 @@ class Projects::BlobController < Projects::ApplicationController
def after_edit_path
@after_edit_path ||=
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)}"
else
project_blob_path(@project, @id)
namespace_project_blob_path(@project.namespace, @project, @id)
end
end
......
......@@ -24,7 +24,8 @@ class Projects::BranchesController < Projects::ApplicationController
if result[:status] == :success
@branch = result[:branch]
redirect_to project_tree_path(@project, @branch.name)
redirect_to namespace_project_tree_path(@project.namespace, @project,
@branch.name)
else
@error = result[:message]
render action: 'new'
......@@ -36,7 +37,10 @@ class Projects::BranchesController < Projects::ApplicationController
@branch_name = params[:id]
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
end
end
......
......@@ -25,6 +25,7 @@ class Projects::CompareController < Projects::ApplicationController
end
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
......@@ -25,7 +25,8 @@ class Projects::DeployKeysController < Projects::ApplicationController
@key = DeployKey.new(deploy_key_params)
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
render "new"
end
......@@ -44,13 +45,15 @@ class Projects::DeployKeysController < Projects::ApplicationController
def enable
@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
def disable
@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
protected
......
......@@ -9,11 +9,14 @@ class Projects::ForksController < Projects::ApplicationController
end
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
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
@title = 'Fork project'
render :error
......
......@@ -16,7 +16,7 @@ class Projects::HooksController < Projects::ApplicationController
@hook.save
if @hook.valid?
redirect_to project_hooks_path(@project)
redirect_to namespace_project_hooks_path(@project.namespace, @project)
else
@hooks = @project.hooks.select(&:persisted?)
render :index
......@@ -43,7 +43,7 @@ class Projects::HooksController < Projects::ApplicationController
def destroy
hook.destroy
redirect_to project_hooks_path(@project)
redirect_to namespace_project_hooks_path(@project.namespace, @project)
end
private
......
......@@ -20,7 +20,7 @@ class Projects::ImportsController < Projects::ApplicationController
end
end
redirect_to project_import_path(@project)
redirect_to namespace_project_import_path(@project.namespace, @project)
end
def show
......@@ -28,7 +28,8 @@ class Projects::ImportsController < Projects::ApplicationController
if @project.import_finished?
redirect_to(@project) and return
else
redirect_to new_project_import_path(@project) and return
redirect_to new_namespace_project_import_path(@project.namespace,
@project) && return
end
end
end
......@@ -37,13 +38,14 @@ class Projects::ImportsController < Projects::ApplicationController
def require_no_repo
if @project.repository_exists?
redirect_to(@project) and return
redirect_to(namespace_project_path(@project.namespace, @project)) and return
end
end
def redirect_if_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
......@@ -60,7 +60,8 @@ class Projects::IssuesController < Projects::ApplicationController
respond_to do |format|
format.html do
if @issue.valid?
redirect_to project_issue_path(@project, @issue)
redirect_to namespace_project_issue_path(@project.namespace,
@project, @issue)
else
render :new
end
......@@ -78,7 +79,7 @@ class Projects::IssuesController < Projects::ApplicationController
format.js
format.html do
if @issue.valid?
redirect_to [@project, @issue]
redirect_to [@project.namespace, @project, @issue]
else
render :edit
end
......@@ -128,7 +129,8 @@ class Projects::IssuesController < Projects::ApplicationController
issue = @project.issues.find_by(id: params[:id])
if issue
redirect_to project_issue_path(@project, issue)
redirect_to namespace_project_issue_path(@project.namespace, @project,
issue)
return
else
raise ActiveRecord::RecordNotFound.new
......
......@@ -18,7 +18,7 @@ class Projects::LabelsController < Projects::ApplicationController
@label = @project.labels.create(label_params)
if @label.valid?
redirect_to project_labels_path(@project)
redirect_to namespace_project_labels_path(@project.namespace, @project)
else
render 'new'
end
......@@ -29,7 +29,7 @@ class Projects::LabelsController < Projects::ApplicationController
def update
if @label.update_attributes(label_params)
redirect_to project_labels_path(@project)
redirect_to namespace_project_labels_path(@project.namespace, @project)
else
render 'edit'
end
......@@ -39,11 +39,12 @@ class Projects::LabelsController < Projects::ApplicationController
Gitlab::IssuesLabels.generate(@project)
if params[:redirect] == 'issues'
redirect_to project_issues_path(@project)
redirect_to namespace_project_issues_path(@project.namespace, @project)
elsif params[:redirect] == 'merge_requests'
redirect_to project_merge_requests_path(@project)
redirect_to namespace_project_merge_requests_path(@project.namespace,
@project)
else
redirect_to project_labels_path(@project)
redirect_to namespace_project_labels_path(@project.namespace, @project)
end
end
......@@ -51,7 +52,10 @@ class Projects::LabelsController < Projects::ApplicationController
@label.destroy
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
end
end
......
......@@ -78,7 +78,12 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@merge_request = MergeRequests::CreateService.new(project, current_user, merge_request_params).execute
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
@source_project = @merge_request.source_project
@target_project = @merge_request.target_project
......@@ -93,7 +98,9 @@ class Projects::MergeRequestsController < Projects::ApplicationController
respond_to do |format|
format.js
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
else
......
......@@ -40,7 +40,8 @@ class Projects::MilestonesController < Projects::ApplicationController
@milestone = Milestones::CreateService.new(project, current_user, milestone_params).execute
if @milestone.save
redirect_to project_milestone_path(@project, @milestone)
redirect_to namespace_project_milestone_path(@project.namespace,
@project, @milestone)
else
render "new"
end
......@@ -67,7 +68,7 @@ class Projects::MilestonesController < Projects::ApplicationController
@milestone.destroy
respond_to do |format|
format.html { redirect_to project_milestones_path }
format.html { redirect_to namespace_project_milestones_path }
format.js { render nothing: true }
end
end
......
......@@ -12,7 +12,8 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController
def create
@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
def update
......@@ -37,7 +38,7 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController
@project.protected_branches.find(params[:id]).destroy
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 }
end
end
......
......@@ -9,13 +9,15 @@ class Projects::RefsController < Projects::ApplicationController
respond_to do |format|
format.html do
new_path = if params[:destination] == "tree"
project_tree_path(@project, (@id))
namespace_project_tree_path(@project.namespace, @project,
(@id))
elsif params[:destination] == "blob"
project_blob_path(@project, (@id))
namespace_project_blob_path(@project.namespace, @project,
(@id))
elsif params[:destination] == "graph"
project_network_path(@project, @id, @options)
namespace_project_network_path(@project.namespace, @project, @id, @options)
else
project_commits_path(@project, @id)
namespace_project_commits_path(@project.namespace, @project, @id)
end
redirect_to new_path
......
......@@ -7,7 +7,7 @@ class Projects::RepositoriesController < Projects::ApplicationController
def create
@project.create_repository
redirect_to @project
redirect_to namespace_project_path(@project.namespace, @project)
end
def archive
......
......@@ -17,8 +17,11 @@ class Projects::ServicesController < Projects::ApplicationController
def update
if @service.update_attributes(service_params)
redirect_to edit_project_service_path(@project, @service.to_param),
notice: 'Successfully updated.'
redirect_to(
edit_namespace_project_service_path(@project.namespace, @project,
@service.to_param, notice:
'Successfully updated.')
)
else
render 'edit'
end
......
......@@ -32,7 +32,8 @@ class Projects::SnippetsController < Projects::ApplicationController
@snippet.author = current_user
if @snippet.save
redirect_to project_snippet_path(@project, @snippet)
redirect_to namespace_project_snippet_path(@project.namespace, @project,
@snippet)
else
respond_with(@snippet)
end
......@@ -43,7 +44,7 @@ class Projects::SnippetsController < Projects::ApplicationController
def update
if @snippet.update_attributes(snippet_params)
redirect_to project_snippet_path(@project, @snippet)
redirect_to namespace_project_snippet_path(@project.namespace, @project, @snippet)
else
respond_with(@snippet)
end
......@@ -60,7 +61,7 @@ class Projects::SnippetsController < Projects::ApplicationController
@snippet.destroy
redirect_to project_snippets_path(@project)
redirect_to namespace_project_snippets_path(@project.namespace, @project)
end
def raw
......
......@@ -16,7 +16,7 @@ class Projects::TagsController < Projects::ApplicationController
if result[:status] == :success
@tag = result[:tag]
redirect_to project_tags_path(@project)
redirect_to namespace_project_tags_path(@project.namespace, @project)
else
@error = result[:message]
render action: 'new'
......@@ -31,7 +31,7 @@ class Projects::TagsController < Projects::ApplicationController
end
respond_to do |format|
format.html { redirect_to project_tags_path }
format.html { redirect_to namespace_project_tags_path }
format.js
end
end
......
......@@ -21,7 +21,8 @@ class Projects::TeamMembersController < Projects::ApplicationController
if params[:redirect_to]
redirect_to params[:redirect_to]
else
redirect_to project_team_index_path(@project)
redirect_to namespace_project_team_index_path(@project.namespace,
@project)
end
end
......@@ -32,7 +33,7 @@ class Projects::TeamMembersController < Projects::ApplicationController
unless @user_project_relation.valid?
flash[:alert] = "User should have at least one role"
end
redirect_to project_team_index_path(@project)
redirect_to namespace_project_team_index_path(@project.namespace, @project)
end
def destroy
......@@ -40,7 +41,10 @@ class Projects::TeamMembersController < Projects::ApplicationController
@user_project_relation.destroy
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 }
end
end
......@@ -59,7 +63,8 @@ class Projects::TeamMembersController < Projects::ApplicationController
status = @project.team.import(giver)
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
protected
......
......@@ -9,7 +9,10 @@ class Projects::TreeController < Projects::ApplicationController
def show
if tree.entries.empty?
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
return not_found!
end
......
......@@ -45,7 +45,7 @@ class Projects::WikisController < Projects::ApplicationController
return render('empty') unless can?(current_user, :write_wiki, @project)
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
render 'edit'
end
......@@ -55,7 +55,10 @@ class Projects::WikisController < Projects::ApplicationController
@page = WikiPage.new(@project_wiki)
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
render action: "edit"
end
......@@ -65,7 +68,10 @@ class Projects::WikisController < Projects::ApplicationController
@page = @project_wiki.find_page(params[:id])
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
......@@ -73,7 +79,10 @@ class Projects::WikisController < Projects::ApplicationController
@page = @project_wiki.find_page(params[:id])
@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
def git_access
......
......@@ -21,7 +21,10 @@ class ProjectsController < ApplicationController
@project = ::Projects::CreateService.new(current_user, project_params).execute
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
render 'new'
end
......@@ -33,7 +36,12 @@ class ProjectsController < ApplicationController
respond_to do |format|
if status
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
else
format.html { render 'edit', layout: 'project_settings' }
......@@ -43,7 +51,8 @@ class ProjectsController < ApplicationController
end
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?
flash[:alert] = @project.errors[:namespace_id].first
end
......@@ -51,7 +60,7 @@ class ProjectsController < ApplicationController
def show
if @project.import_in_progress?
redirect_to project_import_path(@project)
redirect_to namespace_project_import_path(@project.namespace, @project)
return
end
......@@ -90,7 +99,7 @@ class ProjectsController < ApplicationController
flash[:alert] = 'Project deleted.'
if request.referer.include?('/admin')
redirect_to admin_projects_path
redirect_to admin_namespace_projects_path
else
redirect_to projects_dashboard_path
end
......@@ -121,7 +130,7 @@ class ProjectsController < ApplicationController
@project.archive!
respond_to do |format|
format.html { redirect_to @project }
format.html { redirect_to namespace_project_path(@project.namespace, @project) }
end
end
......@@ -130,7 +139,7 @@ class ProjectsController < ApplicationController
@project.unarchive!
respond_to do |format|
format.html { redirect_to @project }
format.html { redirect_to namespace_project_path(@project.namespace, @project) }
end
end
......
......@@ -55,7 +55,7 @@ module ApplicationHelper
if project.avatar.present?
image_tag project.avatar.url, options
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
project_identicon(project, options)
end
......
......@@ -36,8 +36,12 @@ module BlobHelper
link_opts[:from_merge_request_id] = from_mr if from_mr
cls = 'btn btn-small'
if allowed_tree_edit?(project, ref)
link_to text, project_edit_blob_path(project, tree_join(ref, path),
link_opts), class: cls
link_to(text,
namespace_project_edit_blob_path(project.namespace, project,
tree_join(ref, path),
link_opts),
class: cls
)
else
content_tag :span, text, class: cls + ' disabled'
end + after.html_safe
......
......@@ -37,7 +37,10 @@ module CommitsHelper
# Add the root project link and the arrow icon
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
if @path
......@@ -46,7 +49,14 @@ module CommitsHelper
parts.each_with_index do |part, i|
crumbs << content_tag(:li) do
# 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
......@@ -63,7 +73,9 @@ module CommitsHelper
# Returns the sorted alphabetically links to branches, separated by a comma
def commit_branches_links(project, branches)
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
icon('code-fork') + ' ' + branch
end
......@@ -75,7 +87,10 @@ module CommitsHelper
def commit_tags_links(project, tags)
sorted = VersionSorter.rsort(tags)
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
icon('tag') + ' ' + tag
end
......@@ -86,12 +101,26 @@ module CommitsHelper
def link_to_browse_code(project, commit)
if current_controller?(:projects, :commits)
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?
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
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
protected
......@@ -133,8 +162,11 @@ module CommitsHelper
end
def view_file_btn(commit_sha, diff, project)
link_to project_blob_path(project, tree_join(commit_sha, diff.new_path)),
class: 'btn btn-small view-file js-view-file' do
link_to(
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],
class: 'commit-short-id')
end
......
......@@ -10,6 +10,13 @@ module CompareHelper
end
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
......@@ -61,17 +61,23 @@ module EventsHelper
def event_feed_url(event)
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?
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?
project_commit_url(event.project, event.note_target)
namespace_project_commit_url(event.project.namespace, event.project,
event.note_target)
elsif event.note?
if event.note_target
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?
project_snippet_path(event.project, event.note_target)
namespace_project_snippet_path(event.project.namespace,
event.project, event.note_target)
else
event_note_target_path(event)
end
......@@ -79,12 +85,16 @@ module EventsHelper
elsif event.push?
if event.push_with_commits?
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
project_commit_url(event.project, id: event.commit_to)
namespace_project_commit_url(event.project.namespace, event.project,
id: event.commit_to)
end
else
project_commits_url(event.project, event.ref_name)
namespace_project_commits_url(event.project.namespace, event.project,
event.ref_name)
end
end
end
......@@ -105,20 +115,30 @@ module EventsHelper
def event_note_target_path(event)
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
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
def event_note_title_html(event)
if event.note_target
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}"
end
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}"
end
else
......
......@@ -93,8 +93,10 @@ module IssuesHelper
def issue_to_atom(xml, issue)
xml.entry do
xml.id project_issue_url(issue.project, issue)
xml.link href: project_issue_url(issue.project, issue)
xml.id namespace_project_issue_url(issue.project.namespace,
issue.project, issue)
xml.link href: namespace_project_issue_url(issue.project.namespace,
issue.project, issue)
xml.title truncate(issue.title, length: 80)
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)
......
module MergeRequestsHelper
def new_mr_path_from_push_event(event)
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,
new_mr_from_push_event(event, target_project)
)
end
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,
new_mr_from_push_event(event, event.project.forked_from_project)
)
......
module MilestonesHelper
def milestones_filter_path(opts = {})
if @project
project_milestones_path(@project, opts)
namespace_project_milestones_path(@project.namespace, @project, opts)
elsif @group
group_milestones_path(@group, opts)
end
......
......@@ -11,7 +11,11 @@ module NotesHelper
def link_to_commit_diff_line_note(note)
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
......
......@@ -4,7 +4,7 @@ module ProjectsHelper
end
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')
if project.namespace
......@@ -42,12 +42,20 @@ module ProjectsHelper
def project_title(project)
if project.group
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
else
owner = project.namespace.owner
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
......@@ -100,7 +108,10 @@ module ProjectsHelper
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
end
end
......@@ -222,7 +233,12 @@ module ProjectsHelper
def contribution_guide_url(project)
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
......@@ -236,7 +252,7 @@ module ProjectsHelper
def project_wiki_path_with_version(proj, page, version, is_newest)
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
def project_status_css_class(status)
......
......@@ -52,16 +52,16 @@ module SearchHelper
ref = @ref || @project.repository.root_ref
[
{ label: "#{prefix} - Files", url: project_tree_path(@project, ref) },
{ label: "#{prefix} - Commits", url: project_commits_path(@project, ref) },
{ label: "#{prefix} - Network", url: project_network_path(@project, ref) },
{ label: "#{prefix} - Graph", url: project_graph_path(@project, ref) },
{ label: "#{prefix} - Issues", url: project_issues_path(@project) },
{ label: "#{prefix} - Merge Requests", url: project_merge_requests_path(@project) },
{ label: "#{prefix} - Milestones", url: project_milestones_path(@project) },
{ label: "#{prefix} - Snippets", url: project_snippets_path(@project) },
{ label: "#{prefix} - Team", url: project_team_index_path(@project) },
{ label: "#{prefix} - Wiki", url: project_wikis_path(@project) },
{ label: "#{prefix} - Files", url: namespace_project_tree_path(@project.namespace, @project, ref) },
{ label: "#{prefix} - Commits", url: namespace_project_commits_path(@project.namespace, @project, ref) },
{ label: "#{prefix} - Network", url: namespace_project_network_path(@project.namespace, @project, ref) },
{ label: "#{prefix} - Graph", url: namespace_project_graph_path(@project.namespace, @project, ref) },
{ label: "#{prefix} - Issues", url: namespace_project_issues_path(@project.namespace, @project) },
{ label: "#{prefix} - Merge Requests", url: namespace_project_merge_requests_path(@project.namespace, @project) },
{ label: "#{prefix} - Milestones", url: namespace_project_milestones_path(@project.namespace, @project) },
{ label: "#{prefix} - Snippets", url: namespace_project_snippets_path(@project.namespace, @project) },
{ label: "#{prefix} - Team", url: namespace_project_team_index_path(@project.namespace, @project) },
{ label: "#{prefix} - Wiki", url: namespace_project_wikis_path(@project.namespace, @project) },
]
else
[]
......@@ -84,7 +84,7 @@ module SearchHelper
sorted_by_stars.non_archived.limit(limit).map do |p|
{
label: "project: #{search_result_sanitize(p.name_with_namespace)}",
url: project_path(p)
url: namespace_project_path(p.namespace, p)
}
end
end
......
......@@ -11,7 +11,8 @@ module SnippetsHelper
def reliable_snippet_path(snippet)
if snippet.project_id?
project_snippet_path(snippet.project, snippet)
namespace_project_snippet_path(snippet.project.namespace,
snippet.project, snippet)
else
snippet_path(snippet)
end
......
......@@ -5,19 +5,22 @@ module SubmoduleHelper
def submodule_links(submodule_item, ref = nil)
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')
if self_url?(url, project)
return project_path(project), project_tree_path(project, submodule_item.id)
if self_url?(url, namespace, project)
return namespace_project_path(namespace, project),
namespace_project_tree_path(namespace, project,
submodule_item.id)
elsif relative_self_url?(url)
relative_self_links(url, submodule_item.id)
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)
standard_links('gitlab.com', project, submodule_item.id)
standard_links('gitlab.com', namespace, project, submodule_item.id)
else
return url, nil
end
......@@ -33,9 +36,10 @@ module SubmoduleHelper
url =~ /gitlab\.com[\/:][^\/]+\/[^\/]+\Z/
end
def self_url?(url, project)
return true if url == [ Gitlab.config.gitlab.url, '/', project, '.git' ].join('')
url == gitlab_shell.url_to_repo(project)
def self_url?(url, namespace, project)
return true if url == [ Gitlab.config.gitlab.url, '/', namespace, '/',
project, '.git' ].join('')
url == gitlab_shell.url_to_repo([namespace, '/', project].join(''))
end
def relative_self_url?(url)
......@@ -43,8 +47,8 @@ module SubmoduleHelper
url =~ /^((\.\/)?(\.\.\/))(?!(\.\.)|(.*\/)).*\.git\Z/ || url =~ /^((\.\/)?(\.\.\/){2})(?!(\.\.))([^\/]*)\/(?!(\.\.)|(.*\/)).*\.git\Z/
end
def standard_links(host, project, commit)
base = [ 'https://', host, '/', project ].join('')
def standard_links(host, namespace, project, commit)
base = [ 'https://', host, '/', namespace, '/', project ].join('')
return base, [ base, '/tree/', commit ].join('')
end
......@@ -54,6 +58,7 @@ module SubmoduleHelper
else
base = [ @project.group.path, '/', url[/([^\/]*)\.git/, 1] ].join('')
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
......@@ -97,7 +97,8 @@ module TabHelper
def branches_tab_class
if current_controller?(:protected_branches) ||
current_controller?(:branches) ||
current_page?(project_repository_path(@project))
current_page?(namespace_project_repository_path(@project.namespace,
@project))
'active'
end
end
......
......@@ -3,7 +3,7 @@ module Emails
def new_issue_email(recipient_id, issue_id)
@issue = Issue.find(issue_id)
@project = @issue.project
@target_url = project_issue_url(@project, @issue)
@target_url = namespace_project_issue_url(@project.namespace, @project, @issue)
mail_new_thread(@issue,
from: sender(@issue.author_id),
to: recipient(recipient_id),
......@@ -14,7 +14,7 @@ module Emails
@issue = Issue.find(issue_id)
@previous_assignee = User.find_by(id: previous_assignee_id) if previous_assignee_id
@project = @issue.project
@target_url = project_issue_url(@project, @issue)
@target_url = namespace_project_issue_url(@project.namespace, @project, @issue)
mail_answer_thread(@issue,
from: sender(updated_by_user_id),
to: recipient(recipient_id),
......@@ -25,7 +25,7 @@ module Emails
@issue = Issue.find issue_id
@project = @issue.project
@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,
from: sender(updated_by_user_id),
to: recipient(recipient_id),
......@@ -37,7 +37,7 @@ module Emails
@issue_status = status
@project = @issue.project
@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,
from: sender(updated_by_user_id),
to: recipient(recipient_id),
......
......@@ -3,7 +3,9 @@ module Emails
def new_merge_request_email(recipient_id, merge_request_id)
@merge_request = MergeRequest.find(merge_request_id)
@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,
from: sender(@merge_request.author_id),
to: recipient(recipient_id),
......@@ -14,7 +16,9 @@ module Emails
@merge_request = MergeRequest.find(merge_request_id)
@previous_assignee = User.find_by(id: previous_assignee_id) if previous_assignee_id
@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,
from: sender(updated_by_user_id),
to: recipient(recipient_id),
......@@ -25,7 +29,9 @@ module Emails
@merge_request = MergeRequest.find(merge_request_id)
@updated_by = User.find updated_by_user_id
@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,
from: sender(updated_by_user_id),
to: recipient(recipient_id),
......@@ -35,7 +41,9 @@ module Emails
def merged_merge_request_email(recipient_id, merge_request_id, updated_by_user_id)
@merge_request = MergeRequest.find(merge_request_id)
@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,
from: sender(updated_by_user_id),
to: recipient(recipient_id),
......@@ -47,7 +55,9 @@ module Emails
@mr_status = status
@project = @merge_request.project
@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}")
mail_answer_thread(@merge_request,
from: sender(updated_by_user_id),
......
......@@ -4,7 +4,9 @@ module Emails
@note = Note.find(note_id)
@commit = @note.noteable
@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,
from: sender(@note.author_id),
to: recipient(recipient_id),
......@@ -15,7 +17,9 @@ module Emails
@note = Note.find(note_id)
@issue = @note.noteable
@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,
from: sender(@note.author_id),
to: recipient(recipient_id),
......@@ -26,7 +30,10 @@ module Emails
@note = Note.find(note_id)
@merge_request = @note.noteable
@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,
from: sender(@note.author_id),
to: recipient(recipient_id),
......
......@@ -3,7 +3,7 @@ module Emails
def project_access_granted_email(user_project_id)
@project_member = ProjectMember.find user_project_id
@project = @project_member.project
@target_url = project_url(@project)
@target_url = namespace_project_url(@project.namespace, @project)
mail(to: @project_member.user.email,
subject: subject("Access to project was granted"))
end
......@@ -11,7 +11,7 @@ module Emails
def project_was_moved_email(project_id, user_id)
@user = User.find user_id
@project = Project.find project_id
@target_url = project_url(@project)
@target_url = namespace_project_url(@project.namespace, @project)
mail(to: @user.notification_email,
subject: subject("Project was moved"))
end
......@@ -24,10 +24,14 @@ module Emails
@diffs = compare.diffs
@branch = branch
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"
else
@target_url = project_commit_url(@project, @commits.first)
@target_url = namespace_project_commit_url(@project.namespace,
@project, @commits.first)
@subject = @commits.first.title
end
......
......@@ -285,7 +285,7 @@ class Project < ActiveRecord::Base
end
def to_param
namespace.path + '/' + path
path
end
def web_url
......
......@@ -27,14 +27,14 @@ class GitlabIssueTrackerService < IssueTrackerService
end
def project_url
project_issues_path(project)
namespace_project_issues_path(project.namespace, project)
end
def new_issue_url
new_project_issue_path project_id: project
new_namespace_project_issue_path namespace_id: project.namespace, project_id: project
end
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
......@@ -12,7 +12,7 @@ module Projects
class TransferError < StandardError; end
def execute
namespace_id = params[:namespace_id]
namespace_id = params[:new_namespace_id]
namespace = Namespace.find_by(id: namespace_id)
if allowed_transfer?(current_user, project, namespace)
......
......@@ -85,10 +85,10 @@
.light-well
%h4 Projects
.data
= link_to admin_projects_path do
= link_to admin_namespaces_projects_path do
%h1= Project.count
%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
.light-well
%h4 Users
......@@ -112,7 +112,7 @@
%hr
- @projects.each do |project|
%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
#{time_ago_with_tooltip(project.created_at)}
......
......@@ -41,7 +41,7 @@
- @projects.each do |project|
%li
%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
= repository_size(project)
%span.pull-right.light
......
.row
.col-md-3
.admin-filter
= form_tag admin_projects_path, method: :get, class: '' do
= form_tag admin_namespaces_projects_path, method: :get, class: '' do
.form-group
= label_tag :name, 'Name:'
= text_field_tag :name, params[:name], class: "form-control"
......@@ -36,7 +36,7 @@
%hr
= hidden_field_tag :sort, params[:sort]
= 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
.panel.panel-default
......@@ -53,15 +53,15 @@
%b.caret
%ul.dropdown-menu
%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
= 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
= 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
= 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
= 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
= link_to 'New Project', new_project_path, class: "btn btn-new"
%ul.well-list
......@@ -70,12 +70,12 @@
.list-item-name
%span{ class: visibility_level_color(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
%span.label.label-gray
= repository_size(project)
= link_to 'Edit', edit_project_path(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 'Edit', edit_namespace_project_path(project.namespace, project), id: "edit_#{dom_id(project)}", class: "btn btn-small"
= 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?
.nothing-here-block 0 projects matches
= paginate @projects, theme: "gitlab"
%h3.page-title
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
Edit
%hr
......@@ -13,7 +13,7 @@
%li
%span.light Name:
%strong
= link_to @project.name, project_path(@project)
= link_to @project.name, namespace_project_path(@project.namespace, @project)
%li
%span.light Namespace:
%strong
......@@ -79,11 +79,11 @@
.panel-heading
Transfer project
.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
= f.label :namespace_id, "Namespace", class: 'control-label'
= f.label :new_namespace_id, "Namespace", class: 'control-label'
.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
.col-sm-2
......@@ -111,7 +111,7 @@
%small
(#{@project.users.count})
.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
Manage Access
%ul.well-list.team_members
......@@ -126,7 +126,7 @@
%span.light Owner
- else
%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
.panel-footer
= paginate @project_members, param_name: 'project_members_page', theme: 'gitlab'
......@@ -206,7 +206,7 @@
- tm = project.team.find_tm(@user.id)
%li.project_member
.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
- if tm
......@@ -217,7 +217,7 @@
%span.light= tm.human_access
- 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
#ssh-keys.tab-pane
= 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
= project_icon(project.to_param, alt: '', class: 'avatar project-avatar s40')
= project_icon("#{project.namespace.to_param}/#{project.to_param}", alt: '', class: 'avatar project-avatar s40')
.dash-project-access-icon
= visibility_level_icon(project.visibility_level)
%span.str-truncated
......
......@@ -20,6 +20,6 @@
%span.light
#{@projects_limit} of #{pluralize(@projects_count, 'project')} displayed.
.pull-right
= link_to projects_dashboard_path do
= link_to namespace_projects_dashboard_path do
Show all
%i.fa.fa-angle-right
......@@ -16,10 +16,10 @@
%li.my-project-row
%h4.project-title
.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
= 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
= project.name_with_namespace
- if project.forked_from_project
......@@ -27,11 +27,11 @@
%small
%i.fa.fa-code-fork
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)
.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
Leave
......
%li.commit
.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;
= gfm event_commit_title(commit[:message]), project
......@@ -2,7 +2,7 @@
.event-last-push
.event-last-push-text
%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
at
%strong= link_to_project event.project
......
......@@ -2,7 +2,7 @@
- event.commits.first(15).each do |commit|
%p
%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
at
= commit[:timestamp].to_time.to_s(:short)
......
......@@ -2,7 +2,7 @@
%span.author_name= link_to_author event
%span.event_label{class: event.action_name}= event_action_name(event)
- 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]
- else
%strong= gfm event.target_title
at
......
......@@ -4,7 +4,7 @@
- if event.rm_ref?
%strong= event.ref_name
- 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
at
= link_to_project event.project
......@@ -21,5 +21,5 @@
%li.commits-stat
- if event.commits_count > 2
%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)}
......@@ -2,7 +2,7 @@
%h4.project-title
.project-access-icon
= visibility_level_icon(project.visibility_level)
= link_to project.name_with_namespace, project
= link_to project.name_with_namespace, [project.namespace.becomes(Namespace), project]
- if current_page?(starred_explore_projects_path)
%strong.pull-right
......@@ -16,11 +16,11 @@
.repo-info
- 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;
= 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;
= 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
%i.fa.fa-exclamation-triangle
Empty repository
......@@ -11,9 +11,9 @@
.nothing-here-block This group has no projects yet
- projects.each do |project|
%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
= project_icon(project.to_param, alt: '', class: 'avatar s40')
= project_icon("#{project.namespace.to_param}/#{project.to_param}", alt: '', class: 'avatar s40')
.dash-project-access-icon
= visibility_level_icon(project.visibility_level)
%span.str-truncated
......
......@@ -2,9 +2,9 @@
%span.milestone-row
- project = issue.project
%strong #{project.name} &middot;
= link_to [project, issue] do
= link_to [project.namespace.becomes(Namespace), project, issue] do
%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
- if issue.assignee
= image_tag avatar_icon(issue.assignee.email, 16), class: "avatar s16"
......@@ -2,9 +2,9 @@
%span.milestone-row
- project = merge_request.project
%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}
= 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
- if merge_request.assignee
= image_tag avatar_icon(merge_request.assignee.email, 16), class: "avatar s16"
......@@ -28,7 +28,7 @@
- @group_milestone.milestones.each do |milestone|
%tr
%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
= milestone.issues.opened.count
%td
......
......@@ -16,8 +16,8 @@
%span.label.label-gray
= repository_size(project)
.pull-right
= link_to 'Members', project_team_index_path(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 'Members', namespace_project_team_index_path(project.namespace, 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"
- if @projects.blank?
.nothing-here-block This group has no projects yet
......
......@@ -30,6 +30,6 @@
= auto_discovery_link_tag :atom, projects_url(:atom, private_token: current_user.private_token), title: "Dashboard feed"
- if @project && !@project.new_record?
- 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)
= 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
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();
......@@ -5,7 +5,7 @@
%span
Overview
= 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
%span
Projects
......
%ul.project-navigation.nav.nav-sidebar
- if @project_settings_nav
= 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
%span
Back to project
= 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
%span
Settings
......@@ -17,34 +17,34 @@
- else
= 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
%span
Project
- if project_nav_tab? :files
= 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
%span
Files
- if project_nav_tab? :commits
= 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
%span
Commits
- if project_nav_tab? :network
= 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
%span
Network
- if project_nav_tab? :graphs
= 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
%span
Graphs
......@@ -60,7 +60,7 @@
- if project_nav_tab? :merge_requests
= 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
%span
Merge Requests
......@@ -68,21 +68,21 @@
- if project_nav_tab? :wiki
= 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
%span
Wiki
- if project_nav_tab? :snippets
= 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
%span
Snippets
- if project_nav_tab? :settings
= 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
%span
Settings
......
......@@ -28,4 +28,4 @@
#{link_to "View it on GitLab", @target_url}
= email_action @target_url
- 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 %>
<%= 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 -%>
to <%= "#{issuable.assignee_id ? issuable.assignee_name : 'Unassigned'}" %>
= "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 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')
......
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 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 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')
......
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 %>
Asignee: <%= @issue.assignee_name %>
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') %>
Author: <%= @merge_request.author_name %>
......
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 %>
......
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 %>
......
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 %>
......
%p
= "You have been granted #{@project_member.human_access} access to project"
%p
= link_to project_url(@project) do
= link_to namespace_project_url(@project.namespace, @project) do
= @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 @@
Project was moved to another location
%p
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
%p
To update the remote url in your local repository run (for ssh):
......
Project was moved to another location
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):
......
%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:
%ul
- @commits.each do |commit|
%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
%span by #{commit.author_name}
%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.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}
\- - - - -
\
......
......@@ -9,24 +9,24 @@
New issue
- if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project)
%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
- if @project.snippets_enabled && can?(current_user, :write_snippet, @project)
%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
- if can?(current_user, :admin_team_member, @project)
%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
- if can? current_user, :push_code, @project
%li.divider
%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
Git branch
%li
= link_to new_project_tag_path(@project) do
= link_to new_namespace_project_tag_path(@project.namespace, @project) do
%i.fa.fa-tag
Git tag
......
- empty_repo = @project.empty_repo?
.project-home-panel{:class => ("empty-project" if empty_repo)}
.project-identicon-holder
= project_icon(@project.to_param, alt: '', class: 'avatar project-avatar')
= project_icon("#{@project.namespace.to_param}/#{@project.to_param}", alt: '', class: 'avatar project-avatar')
.project-home-row
.project-home-desc
- if @project.description.present?
= escaped_autolink(@project.description)
- if can?(current_user, :admin_project, @project)
&ndash;
= link_to 'Edit', edit_project_path
= link_to 'Edit', edit_namespace_project_path
- elsif !@project.empty_repo? && @repository.readme
- readme = @repository.readme
&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
.star-fork-buttons
- unless @project.empty_repo?
.fork-buttons
- 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
= 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
- 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
.star-buttons
......
......@@ -53,7 +53,7 @@
%span.light No open milestones available.
&nbsp;
- 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
= f.label :label_ids, class: 'control-label' do
%i.fa.fa-tag
......@@ -66,7 +66,7 @@
%span.light No labels yet.
&nbsp;
- 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
- if !issuable.project.empty_repo? && contribution_guide_url(issuable.project) && !issuable.persisted?
......@@ -82,4 +82,4 @@
- cancel_project = issuable.source_project
- else
- 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'
%ul.nav.nav-tabs
- if project_nav_tab? :issues
= nav_link(controller: :issues) do
= link_to project_issues_path(@project), class: "tab" do
= link_to namespace_project_issues_path(@project.namespace, @project), class: "tab" do
%i.fa.fa-exclamation-circle
Issues
- if project_nav_tab? :merge_requests
= nav_link(controller: :merge_requests) do
= link_to project_merge_requests_path(@project), class: "tab" do
= link_to namespace_project_merge_requests_path(@project.namespace, @project), class: "tab" do
%i.fa.fa-tasks
Merge Requests
= nav_link(controller: :milestones) do
= link_to project_milestones_path(@project), class: "tab" do
= link_to namespace_project_milestones_path(@project.namespace, @project), class: "tab" do
%i.fa.fa-clock-o
Milestones
= nav_link(controller: :labels) do
= link_to project_labels_path(@project), class: "tab" do
= link_to namespace_project_labels_path(@project.namespace, @project), class: "tab" do
%i.fa.fa-tags
Labels
......@@ -22,13 +22,13 @@
- if current_controller?(:issues)
- if current_user
%li.hidden-xs
= link_to project_issues_path(@project, :atom, { private_token: current_user.private_token }) do
= link_to namespace_project_issues_path(@project.namespace, @project, :atom, { private_token: current_user.private_token }) do
%i.fa.fa-rss
%li.pull-right
.pull-right
.pull-left
= form_tag project_issues_path(@project), method: :get, id: "issue_search_form", class: 'pull-left issue-search-form' do
= form_tag namespace_project_issues_path(@project.namespace, @project), method: :get, id: "issue_search_form", class: 'pull-left issue-search-form' do
.append-right-10.hidden-xs.hidden-sm
= search_field_tag :issue_search, params[:issue_search], { placeholder: 'Filter by title or description', class: 'form-control issue_search search-text-input input-mn-300' }
= hidden_field_tag :state, params['state']
......@@ -38,7 +38,7 @@
= hidden_field_tag :label_id, params['label_id']
- if can? current_user, :write_issue, @project
= link_to new_project_issue_path(@project, issue: { assignee_id: params[:assignee_id], milestone_id: params[:milestone_id]}), class: "btn btn-new pull-left", title: "New Issue", id: "new_issue_link" do
= link_to new_namespace_project_issue_path(@project.namespace, @project, issue: { assignee_id: params[:assignee_id], milestone_id: params[:milestone_id]}), class: "btn btn-new pull-left", title: "New Issue", id: "new_issue_link" do
%i.fa.fa-plus
New Issue
......@@ -46,6 +46,6 @@
%li.pull-right
.pull-right
- if can? current_user, :write_merge_request, @project
= link_to new_project_merge_request_path(@project), class: "btn btn-new pull-left", title: "New Merge Request" do
= link_to new_namespace_project_merge_request_path(@project.namespace, @project), class: "btn btn-new pull-left", title: "New Merge Request" do
%i.fa.fa-plus
New Merge Request
......@@ -4,7 +4,7 @@
Write
%li
= 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
%div
.md-write-holder
......
%ul.project-settings-nav.sidebar-subnav
= 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
%span
Project
= 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
%span
Members
= 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
%span
Deploy Keys
= 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
%span
Web Hooks
= 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
%span
Services
= 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
%span
Protected branches
......@@ -15,11 +15,11 @@
%tr
%td.blame-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;
= commit_author_link(commit, avatar: true, size: 16)
&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
%pre
- (since...(since + lines.count)).each do |i|
......
.btn-group.tree-btn-group
= 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'
-# only show normal/blame view links for text files
- if @blob.text?
- if current_page? project_blame_path(@project, @id)
= link_to 'Normal View', project_blob_path(@project, @id),
- if current_page? namespace_project_blame_path(@project.namespace, @project, @id)
= link_to 'Normal View', namespace_project_blob_path(@project.namespace, @project, @id),
class: 'btn btn-small'
- 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?
= link_to 'History', project_commits_path(@project, @id),
= link_to 'History', namespace_project_commits_path(@project.namespace, @project, @id),
class: 'btn btn-small'
- 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'
- if allowed_tree_edit?
......
%ul.breadcrumb.repo-breadcrumb
%li
%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
- tree_breadcrumbs(@tree, 6) do |title, path|
%li
- if 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
= truncate(title, length: 40)
- 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
= link_to title, '#'
......
.file-content.blob_file.blob-no-preview
.center
= link_to project_raw_path(@project, @id) do
= link_to namespace_project_raw_path(@project.namespace, @project, @id) do
%h1.light
%i.fa.fa-download
%h4
......
......@@ -9,7 +9,7 @@
%strong= @ref
.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,
placeholder: 'Removed this file because...'
.form-group
......
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