Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
8842ee40
Commit
8842ee40
authored
May 03, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove duplicated methods
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
53e2b450
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
31 deletions
+0
-31
app/helpers/blob_helper.rb
app/helpers/blob_helper.rb
+0
-31
No files found.
app/helpers/blob_helper.rb
View file @
8842ee40
...
...
@@ -264,35 +264,4 @@ module BlobHelper
options
end
def
blob_render_error_reason
(
viewer
)
case
viewer
.
render_error
when
:too_large
max_size
=
if
viewer
.
absolutely_too_large?
viewer
.
absolute_max_size
elsif
viewer
.
too_large?
viewer
.
max_size
end
"it is larger than
#{
number_to_human_size
(
max_size
)
}
"
when
:server_side_but_stored_in_lfs
"it is stored in LFS"
end
end
def
blob_render_error_options
(
viewer
)
options
=
[]
if
viewer
.
render_error
==
:too_large
&&
viewer
.
can_override_max_size?
options
<<
link_to
(
'load it anyway'
,
url_for
(
params
.
merge
(
viewer:
viewer
.
type
,
override_max_size:
true
,
format:
nil
)))
end
if
viewer
.
rich?
&&
viewer
.
blob
.
rendered_as_text?
options
<<
link_to
(
'view the source'
,
'#'
,
class:
'js-blob-viewer-switch-btn'
,
data:
{
viewer:
'simple'
})
end
options
<<
link_to
(
'download it'
,
blob_raw_url
,
target:
'_blank'
,
rel:
'noopener noreferrer'
)
options
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment