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 | |
parent | e5cfac699a00b343d5368fde753a044d3abd411e (diff) | |
download | gitlab-ci-5bc3f8372a8337d7d0c87a845dd9ed552e07b00a.tar.gz |
Disable turbolink on links pointing to gitlab
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/gitlab_helper.rb | 10 | ||||
-rw-r--r-- | app/views/layouts/project.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/_gitlab.html.haml | 2 | ||||
-rw-r--r-- | app/views/user_sessions/new.html.haml | 4 |
4 files changed, 11 insertions, 7 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 diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index 1154897..495dc6c 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -14,7 +14,7 @@ - if @project.gitlab_url.present? .pull-right - = link_to 'View on GitLab', @project.gitlab_url, class: 'btn btn-small' + = link_to 'View on GitLab', @project.gitlab_url, no_turbolink.merge( class: 'btn btn-small' ) %hr .container - if current_user && current_user.can_manage_project?(@project.gitlab_id) diff --git a/app/views/projects/_gitlab.html.haml b/app/views/projects/_gitlab.html.haml index 9d20d22..d11d850 100644 --- a/app/views/projects/_gitlab.html.haml +++ b/app/views/projects/_gitlab.html.haml @@ -1,6 +1,6 @@ .clearfix.light .pull-left.fetch-status - Fetched from GitLab (#{link_to current_user.url, current_user.url}) #{time_ago_in_words(current_user.sync_at)} ago. + Fetched from GitLab (#{link_to current_user.url, current_user.url, no_turbolink}) #{time_ago_in_words(current_user.sync_at)} ago. = link_to gitlab_projects_path(reset_cache: true), remote: true, class: 'sync-now btn btn-small btn-default' do %i.icon-refresh Sync now diff --git a/app/views/user_sessions/new.html.haml b/app/views/user_sessions/new.html.haml index 2b91742..d54232b 100644 --- a/app/views/user_sessions/new.html.haml +++ b/app/views/user_sessions/new.html.haml @@ -2,7 +2,7 @@ %h2 Login using GitLab account %p.light Make sure you have account on GitLab server - = link_to GitlabCi.config.gitlab_server.url, GitlabCi.config.gitlab_server.url + = link_to GitlabCi.config.gitlab_server.url, GitlabCi.config.gitlab_server.url, no_turbolink %hr - = link_to "Login with GitLab", auth_user_sessions_path, class: 'btn btn-login btn-create' + = link_to "Login with GitLab", auth_user_sessions_path, no_turbolink.merge( class: 'btn btn-login btn-create' ) |