gitlab-org--gitlab-foss/app/views/projects/blob/_image.html.haml

16 lines
780 B
Text
Raw Normal View History

.file-content.image_file
- if blob.svg?
- if blob.size_within_svg_limits?
2017-01-16 09:57:33 -05:00
-# We need to scrub SVG but we cannot do so in the RawController: it would
-# be wrong/strange if RawController modified the data.
- blob.load_all_data!(@repository)
- blob = sanitize_svg(blob)
%img{ src: "data:#{blob.mime_type};base64,#{Base64.encode64(blob.data)}", alt: "#{blob.name}" }
- else
.nothing-here-block
The SVG could not be displayed as it is too large, you can
#{link_to('view the raw file', namespace_project_raw_path(@project.namespace, @project, @id), target: '_blank')}
instead.
2016-02-16 11:01:25 -05:00
- else
%img{ src: namespace_project_raw_path(@project.namespace, @project, tree_join(@commit.id, blob.path)), alt: "#{blob.name}" }