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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
f38a6d6e
Commit
f38a6d6e
authored
Dec 11, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added LFS badge to indicate LFS tracked files
Closes #15567
parent
12d33b88
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
0 deletions
+17
-0
app/assets/stylesheets/framework/files.scss
app/assets/stylesheets/framework/files.scss
+5
-0
app/controllers/projects/tree_controller.rb
app/controllers/projects/tree_controller.rb
+1
-0
app/views/projects/blob/_header_content.html.haml
app/views/projects/blob/_header_content.html.haml
+3
-0
app/views/projects/tree/_blob_item.html.haml
app/views/projects/tree/_blob_item.html.haml
+3
-0
changelogs/unreleased/lfs-badge.yml
changelogs/unreleased/lfs-badge.yml
+5
-0
No files found.
app/assets/stylesheets/framework/files.scss
View file @
f38a6d6e
...
@@ -396,3 +396,8 @@ span.idiff {
...
@@ -396,3 +396,8 @@ span.idiff {
.file-fork-suggestion-note
{
.file-fork-suggestion-note
{
margin-right
:
1
.5em
;
margin-right
:
1
.5em
;
}
}
.label-lfs
{
color
:
$common-gray-light
;
border
:
1px
solid
$common-gray-light
;
}
app/controllers/projects/tree_controller.rb
View file @
f38a6d6e
...
@@ -26,6 +26,7 @@ class Projects::TreeController < Projects::ApplicationController
...
@@ -26,6 +26,7 @@ class Projects::TreeController < Projects::ApplicationController
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
do
format
.
html
do
@lfs_blobs
=
Gitlab
::
Git
::
Blob
.
batch_lfs_pointers
(
@project
.
repository
,
@tree
.
blobs
.
map
(
&
:id
))
@last_commit
=
@repository
.
last_commit_for_path
(
@commit
.
id
,
@tree
.
path
)
||
@commit
@last_commit
=
@repository
.
last_commit_for_path
(
@commit
.
id
,
@tree
.
path
)
||
@commit
end
end
...
...
app/views/projects/blob/_header_content.html.haml
View file @
f38a6d6e
...
@@ -8,3 +8,6 @@
...
@@ -8,3 +8,6 @@
%small
%small
=
number_to_human_size
(
blob
.
raw_size
)
=
number_to_human_size
(
blob
.
raw_size
)
-
if
blob
.
stored_externally?
%span
.label.label-lfs.append-right-5
LFS
app/views/projects/tree/_blob_item.html.haml
View file @
f38a6d6e
-
is_lfs_blob
=
@lfs_blobs
.
select
{
|
b
|
b
.
id
===
blob_item
.
id
}.
any?
%tr
{
class:
"tree-item #{tree_hex_class(blob_item)}"
}
%tr
{
class:
"tree-item #{tree_hex_class(blob_item)}"
}
%td
.tree-item-file-name
%td
.tree-item-file-name
=
tree_icon
(
type
,
blob_item
.
mode
,
blob_item
.
name
)
=
tree_icon
(
type
,
blob_item
.
mode
,
blob_item
.
name
)
-
file_name
=
blob_item
.
name
-
file_name
=
blob_item
.
name
=
link_to
project_blob_path
(
@project
,
tree_join
(
@id
||
@commit
.
id
,
blob_item
.
name
)),
class:
'str-truncated'
,
title:
file_name
do
=
link_to
project_blob_path
(
@project
,
tree_join
(
@id
||
@commit
.
id
,
blob_item
.
name
)),
class:
'str-truncated'
,
title:
file_name
do
%span
=
file_name
%span
=
file_name
-
if
is_lfs_blob
%span
.label.label-lfs.prepend-left-5
LFS
%td
.hidden-xs.tree-commit
%td
.hidden-xs.tree-commit
%td
.tree-time-ago.cgray.text-right
%td
.tree-time-ago.cgray.text-right
=
render
'projects/tree/spinner'
=
render
'projects/tree/spinner'
changelogs/unreleased/lfs-badge.yml
0 → 100644
View file @
f38a6d6e
---
title
:
Added badge to tree & blob views to indicate LFS tracked files
merge_request
:
author
:
type
:
added
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