diff options
author | Bartlomiej Swiecki <byo.spoon@gmail.com> | 2015-01-21 21:56:25 +0100 |
---|---|---|
committer | Bartlomiej Swiecki <bartlomiej.swiecki@micazook.com> | 2015-02-05 23:25:37 +0100 |
commit | 5bc3f8372a8337d7d0c87a845dd9ed552e07b00a (patch) | |
tree | 3939411016dbb42d2c3c3b191d672ab5c94f3e47 /app/helpers | |
parent | e5cfac699a00b343d5368fde753a044d3abd411e (diff) | |
download | gitlab-ci-5bc3f8372a8337d7d0c87a845dd9ed552e07b00a.tar.gz |
Disable turbolink on links pointing to gitlab
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/gitlab_helper.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/helpers/gitlab_helper.rb b/app/helpers/gitlab_helper.rb index 7910a04..32e2be8 100644 --- a/app/helpers/gitlab_helper.rb +++ b/app/helpers/gitlab_helper.rb @@ -1,20 +1,24 @@ module GitlabHelper + def no_turbolink + { :"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 + 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 + 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 Commit.truncate_sha(sha), gitlab_url + link_to Commit.truncate_sha(sha), gitlab_url, no_turbolink end end |