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
bc39218b
Commit
bc39218b
authored
Aug 07, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show warning for big files.
parent
7572aaf3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
5 deletions
+31
-5
app/assets/javascripts/repo/components/repo_edit_button.vue
app/assets/javascripts/repo/components/repo_edit_button.vue
+1
-1
app/assets/javascripts/repo/components/repo_preview.vue
app/assets/javascripts/repo/components/repo_preview.vue
+6
-1
app/assets/javascripts/repo/helpers/repo_helper.js
app/assets/javascripts/repo/helpers/repo_helper.js
+9
-3
app/assets/stylesheets/framework/layout.scss
app/assets/stylesheets/framework/layout.scss
+8
-0
app/assets/stylesheets/pages/repo.scss
app/assets/stylesheets/pages/repo.scss
+7
-0
No files found.
app/assets/javascripts/repo/components/repo_edit_button.vue
View file @
bc39218b
...
...
@@ -42,7 +42,7 @@ export default {
</
script
>
<
template
>
<button
class=
"btn btn-default"
@
click.prevent=
"editClicked"
v-cloak
v-if=
"isCommitable"
:disabled=
"binary"
>
<button
class=
"btn btn-default"
@
click.prevent=
"editClicked"
v-cloak
v-if=
"isCommitable
&& !activeFile.render_error
"
:disabled=
"binary"
>
<i
:class=
"buttonIcon"
></i>
<span>
{{
buttonLabel
}}
</span>
</button>
...
...
app/assets/javascripts/repo/components/repo_preview.vue
View file @
bc39218b
...
...
@@ -23,5 +23,10 @@ export default {
</
script
>
<
template
>
<div
v-html=
"activeFile.html"
></div>
<div>
<div
v-if=
"!activeFile.render_error"
v-html=
"activeFile.html"
></div>
<div
v-if=
"activeFile.render_error"
class=
"vertical-center render-error"
>
<p
class=
"text-center"
>
The source could not be displayed because it is too large. You can
<a
:href=
"activeFile.raw_path"
>
download
</a>
it instead.
</p>
</div>
</div>
</
template
>
app/assets/javascripts/repo/helpers/repo_helper.js
View file @
bc39218b
...
...
@@ -154,16 +154,19 @@ const RepoHelper = {
RepoHelper
.
setBinaryDataAsBase64
(
data
);
Store
.
setViewToPreview
();
}
else
if
(
!
Store
.
isPreviewView
())
{
Service
.
getRaw
(
data
.
raw_path
)
if
(
!
data
.
render_error
){
Service
.
getRaw
(
data
.
raw_path
)
.
then
((
rawResponse
)
=>
{
Store
.
blobRaw
=
rawResponse
.
data
;
data
.
plain
=
rawResponse
.
data
;
RepoHelper
.
setFile
(
data
,
file
);
}).
catch
(
RepoHelper
.
loadingError
);
}
}
if
(
Store
.
isPreviewView
())
RepoHelper
.
setFile
(
data
,
file
);
if
(
Store
.
isPreviewView
()){
RepoHelper
.
setFile
(
data
,
file
);
}
// if the file tree is empty
if
(
Store
.
files
.
length
===
0
)
{
...
...
@@ -187,6 +190,9 @@ const RepoHelper = {
newFile
.
url
=
file
.
url
||
location
.
pathname
;
newFile
.
url
=
file
.
url
;
if
(
newFile
.
render_error
===
'
too_large
'
){
newFile
.
tooLarge
=
true
;
}
newFile
.
newContent
=
''
;
Store
.
addToOpenedFiles
(
newFile
);
...
...
app/assets/stylesheets/framework/layout.scss
View file @
bc39218b
...
...
@@ -128,3 +128,11 @@ of the body element here, we negate cascading side effects but allow momentum sc
[
v-cloak
]
{
display
:
none
;
}
.vertical-center
{
min-height
:
100%
;
min-height
:
100vh
;
display
:
flex
;
align-items
:
center
;
}
\ No newline at end of file
app/assets/stylesheets/pages/repo.scss
View file @
bc39218b
...
...
@@ -369,6 +369,13 @@
}
}
.render-error
{
min-height
:
calc
(
100vh
-
63px
);
p
{
width
:
100%
;
}
}
@keyframes
blockTextShine
{
0
%
{
transform
:
translateX
(
-468px
);
...
...
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