Commit b1dffe67 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'disable-turbolink-on-ci-links' into 'master'

Disable turbolink on links pointing out to CI services

### What does this MR do?

This MR adds 'data-no-turbolink' attribute into all links pointing to CI services.

### Are there points in the code the reviewer needs to double check?

No

### Why was this MR needed?

In rare cases where gitlab and CI service is installed on the same host, turbolink will be used for links between those two. This may result in corrupted css and javascript.

This change is harmless for installations that do not share the domain name for GitLab and CI system - in such case, all links modified are already pointing out outside of the domain so turbolink won't handle them.

### What are the relevant issue numbers / Feature requests?

I consider this a small fix, no issue has been added.

See merge request !305
parents e49b6364 47e06146
......@@ -3,21 +3,21 @@
%i.fa.fa-check
%span CI build passed
for #{@merge_request.last_commit_short_sha}.
= link_to "Build page", ci_build_details_path(@merge_request)
= link_to "Build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
.ci_widget.ci-failed{style: "display:none"}
%i.fa.fa-times
%span CI build failed
for #{@merge_request.last_commit_short_sha}.
= link_to "Build page", ci_build_details_path(@merge_request)
= link_to "Build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
- [:running, :pending].each do |status|
.ci_widget{class: "ci-#{status}", style: "display:none"}
%i.fa.fa-clock-o
%span CI build #{status}
for #{@merge_request.last_commit_short_sha}.
= link_to "Build page", ci_build_details_path(@merge_request)
= link_to "Build page", ci_build_details_path(@merge_request), :"data-no-turbolink" => "data-no-turbolink"
.ci_widget
%i.fa.fa-spinner
......
......@@ -68,11 +68,11 @@
- @project.ci_services.each do |ci_service|
- if ci_service.active? && ci_service.respond_to?(:builds_path)
- if ci_service.respond_to?(:status_img_path)
= link_to ci_service.builds_path do
= link_to ci_service.builds_path, :'data-no-turbolink' => 'data-no-turbolink' do
= image_tag ci_service.status_img_path, alt: "build status"
- else
%span.light CI provided by
= link_to ci_service.title, ci_service.builds_path
= link_to ci_service.title, ci_service.builds_path, :'data-no-turbolink' => 'data-no-turbolink'
- if readme
.tab-pane#tab-readme
......
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