Skip to content
Snippets Groups Projects
Commit 7f8e8ecd authored by Douwe Maan's avatar Douwe Maan
Browse files

Remove redundant URL helpers.

parent d7f5f634
No related branches found
No related tags found
No related merge requests found
module BuildsHelper
def build_ref_link build
gitlab_ref_link build.project, build.ref
end
def build_commit_link build
gitlab_commit_link build.project, build.short_sha
end
def build_url(build)
namespace_project_build_path(build.gl_project, build.project, build)
end
end
Loading
Loading
@@ -4,25 +4,6 @@ module Ci
{ :"data-no-turbolink" => "data-no-turbolink" }
end
 
def gitlab_ref_link project, ref
gitlab_url = project.gitlab_url.dup
gitlab_url << "/commits/#{ref}"
link_to ref, gitlab_url, no_turbolink
end
def gitlab_compare_link project, before, after
gitlab_url = project.gitlab_url.dup
gitlab_url << "/compare/#{before}...#{after}"
link_to "#{before}...#{after}", gitlab_url, no_turbolink
end
def gitlab_commit_link project, sha
gitlab_url = project.gitlab_url.dup
gitlab_url << "/commit/#{sha}"
link_to Ci::Commit.truncate_sha(sha), gitlab_url, no_turbolink
end
def yaml_web_editor_link(project)
commits = project.commits
 
Loading
Loading
Loading
Loading
@@ -7,7 +7,7 @@
= @project.name
 
%p
Commit link: #{gitlab_commit_link(@project, @build.commit.short_sha)}
Commit: #{link_to @build.short_sha, namespace_project_commit_path(@build.gl_project.namespace, @build.gl_project, @build.sha)}
%p
Author: #{@build.commit.git_author_name}
%p
Loading
Loading
@@ -16,4 +16,4 @@
Message: #{@build.commit.git_commit_message}
 
%p
Url: #{link_to @build.short_sha, namespace_project_build_url(@build.gl_project.namespace, @build.gl_project, @build)}
Build details: #{link_to "Build #{@build.id}", namespace_project_build_url(@build.gl_project.namespace, @build.gl_project, @build)}
Loading
Loading
@@ -8,7 +8,7 @@
= @project.name
 
%p
Commit link: #{gitlab_commit_link(@project, @build.commit.short_sha)}
Commit: #{link_to @build.short_sha, namespace_project_commit_path(@build.gl_project.namespace, @build.gl_project, @build.sha)}
%p
Author: #{@build.commit.git_author_name}
%p
Loading
Loading
@@ -17,4 +17,4 @@
Message: #{@build.commit.git_commit_message}
 
%p
Url: #{link_to @build.short_sha, namespace_project_build_url(@build.gl_project.namespace, @build.gl_project, @build)}
Build details: #{link_to "Build #{@build.id}", namespace_project_build_url(@build.gl_project.namespace, @build.gl_project, @build)}
Loading
Loading
@@ -6,7 +6,7 @@
= ci_commit.status
 
= link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit_short_id"
= link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message"
= link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit), class: "commit-row-message"
&middot;
#{time_ago_with_tooltip(commit.committed_date, skip_js: true)} by
= commit_author_link(commit, avatar: true, size: 24)
Loading
Loading
@@ -112,7 +112,7 @@
%p
%span.attr-name Runner:
- if @build.runner && current_user && current_user.admin
\#{link_to "##{@build.runner.id}", ci_admin_runner_path(@build.runner.id)}
= link_to "##{@build.runner.id}", ci_admin_runner_path(@build.runner.id)
- elsif @build.runner
\##{@build.runner.id}
 
Loading
Loading
@@ -137,10 +137,11 @@
%h4.title
Commit
.pull-right
%small #{build_commit_link @build}
%small
= link_to @build.commit.short_sha, ci_status_path(@build.commit), class: "monospace"
%p
%span.attr-name Branch:
#{build_ref_link @build}
= link_to @build.ref, namespace_project_commits_path(@project.namespace, @project, @build.ref)
%p
%span.attr-name Author:
#{@build.commit.git_author_name}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment