2013-07-13 02:52:47 -04:00
|
|
|
.file-content.image_file
|
2016-02-18 18:19:43 -05:00
|
|
|
- if blob.svg?
|
2016-08-12 11:19:17 -04:00
|
|
|
- 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.
|
2016-08-12 11:19:17 -04:00
|
|
|
- blob.load_all_data!(@repository)
|
|
|
|
- blob = sanitize_svg(blob)
|
2016-12-26 05:47:16 -05:00
|
|
|
%img{ src: "data:#{blob.mime_type};base64,#{Base64.encode64(blob.data)}", alt: "#{blob.name}" }
|
2016-08-12 11:19:17 -04:00
|
|
|
- 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
|
2016-12-26 05:47:16 -05:00
|
|
|
%img{ src: namespace_project_raw_path(@project.namespace, @project, tree_join(@commit.id, blob.path)), alt: "#{blob.name}" }
|