diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-12-11 17:23:29 +0100 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-12-12 09:48:06 +0100 |
commit | e8d0d6ba9eeedf3d895ceb5e679866d4889cbf36 (patch) | |
tree | 6db6475389fba0c53fe4500df63ab1466e967ed1 /app/views/projects | |
parent | fb47f2a7459f4c413f3fe496bcdb1b40d81d73a4 (diff) | |
download | gitlab-ce-e8d0d6ba9eeedf3d895ceb5e679866d4889cbf36.tar.gz |
Use app host instead of asset host when rendering image blob or diffdm-image-blob-diff-full-url
Diffstat (limited to 'app/views/projects')
-rw-r--r-- | app/views/projects/blob/viewers/_image.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/diffs/_replaced_image_diff.html.haml | 16 | ||||
-rw-r--r-- | app/views/projects/diffs/_single_image_diff.html.haml | 6 |
3 files changed, 13 insertions, 12 deletions
diff --git a/app/views/projects/blob/viewers/_image.html.haml b/app/views/projects/blob/viewers/_image.html.haml index 26ea028c5d7..2a8cefac005 100644 --- a/app/views/projects/blob/viewers/_image.html.haml +++ b/app/views/projects/blob/viewers/_image.html.haml @@ -1,2 +1,3 @@ .file-content.image_file - = image_tag(blob_raw_path, alt: viewer.blob.name) + -# Uses the full URL rather than the path, to prevent it from getting prefixed with the asset host. + = image_tag(blob_raw_url, alt: viewer.blob.name) diff --git a/app/views/projects/diffs/_replaced_image_diff.html.haml b/app/views/projects/diffs/_replaced_image_diff.html.haml index 8fc232b464e..6dffc7c4390 100644 --- a/app/views/projects/diffs/_replaced_image_diff.html.haml +++ b/app/views/projects/diffs/_replaced_image_diff.html.haml @@ -1,7 +1,7 @@ - blob = diff_file.blob - old_blob = diff_file.old_blob -- blob_raw_path = diff_file_blob_raw_path(diff_file) -- old_blob_raw_path = diff_file_old_blob_raw_path(diff_file) +- blob_raw_url = diff_file_blob_raw_url(diff_file) +- old_blob_raw_url = diff_file_old_blob_raw_url(diff_file) - click_to_comment = local_assigns.fetch(:click_to_comment, true) - diff_view_data = local_assigns.fetch(:diff_view_data, '') - class_name = '' @@ -13,7 +13,7 @@ .two-up.view .wrap .frame.deleted - = image_tag(old_blob_raw_path, alt: diff_file.old_path, lazy: false) + = image_tag(old_blob_raw_url, alt: diff_file.old_path, lazy: false) %p.image-info.hide %span.meta-filesize= number_to_human_size(old_blob.size) | @@ -23,7 +23,7 @@ %strong H: %span.meta-height .wrap - = render partial: "projects/diffs/image_diff_frame", locals: { class_name: "added js-image-frame #{class_name}", position: position, note_type: DiffNote.name, image_path: blob_raw_path, alt: diff_file.new_path } + = render partial: "projects/diffs/image_diff_frame", locals: { class_name: "added js-image-frame #{class_name}", position: position, note_type: DiffNote.name, image_path: blob_raw_url, alt: diff_file.new_path } %p.image-info.hide %span.meta-filesize= number_to_human_size(blob.size) | @@ -36,9 +36,9 @@ .swipe.view.hide .swipe-frame .frame.deleted - = image_tag(old_blob_raw_path, alt: diff_file.old_path, lazy: false) + = image_tag(old_blob_raw_url, alt: diff_file.old_path, lazy: false) .swipe-wrap - = render partial: "projects/diffs/image_diff_frame", locals: { class_name: "added js-image-frame #{class_name}", position: position, note_type: DiffNote.name, image_path: blob_raw_path, alt: diff_file.new_path } + = render partial: "projects/diffs/image_diff_frame", locals: { class_name: "added js-image-frame #{class_name}", position: position, note_type: DiffNote.name, image_path: blob_raw_url, alt: diff_file.new_path } %span.swipe-bar %span.top-handle %span.bottom-handle @@ -46,8 +46,8 @@ .onion-skin.view.hide .onion-skin-frame .frame.deleted - = image_tag(old_blob_raw_path, alt: diff_file.old_path, lazy: false) - = render partial: "projects/diffs/image_diff_frame", locals: { class_name: "added js-image-frame #{class_name}", position: position, note_type: DiffNote.name, image_path: blob_raw_path, alt: diff_file.new_path } + = image_tag(old_blob_raw_url, alt: diff_file.old_path, lazy: false) + = render partial: "projects/diffs/image_diff_frame", locals: { class_name: "added js-image-frame #{class_name}", position: position, note_type: DiffNote.name, image_path: blob_raw_url, alt: diff_file.new_path } .controls .transparent .drag-track diff --git a/app/views/projects/diffs/_single_image_diff.html.haml b/app/views/projects/diffs/_single_image_diff.html.haml index 6b0c6bbe48f..12be8beab39 100644 --- a/app/views/projects/diffs/_single_image_diff.html.haml +++ b/app/views/projects/diffs/_single_image_diff.html.haml @@ -1,7 +1,7 @@ - blob = diff_file.blob - old_blob = diff_file.old_blob -- blob_raw_path = diff_file_blob_raw_path(diff_file) -- old_blob_raw_path = diff_file_old_blob_raw_path(diff_file) +- blob_raw_url = diff_file_blob_raw_url(diff_file) +- old_blob_raw_url = diff_file_old_blob_raw_url(diff_file) - click_to_comment = local_assigns.fetch(:click_to_comment, true) - diff_view_data = local_assigns.fetch(:diff_view_data, '') - class_name = '' @@ -12,5 +12,5 @@ .image.js-single-image{ data: diff_view_data } .wrap - single_class_name = diff_file.deleted_file? ? 'deleted' : 'added' - = render partial: "projects/diffs/image_diff_frame", locals: { class_name: "#{single_class_name} #{class_name} js-image-frame", position: position, note_type: DiffNote.name, image_path: blob_raw_path, alt: diff_file.file_path } + = render partial: "projects/diffs/image_diff_frame", locals: { class_name: "#{single_class_name} #{class_name} js-image-frame", position: position, note_type: DiffNote.name, image_path: blob_raw_url, alt: diff_file.file_path } %p.image-info= number_to_human_size(blob.size) |