Commit f38a6d6e authored by Phil Hughes's avatar Phil Hughes

Added LFS badge to indicate LFS tracked files

Closes #15567
parent 12d33b88
......@@ -396,3 +396,8 @@ span.idiff {
.file-fork-suggestion-note {
margin-right: 1.5em;
}
.label-lfs {
color: $common-gray-light;
border: 1px solid $common-gray-light;
}
......@@ -26,6 +26,7 @@ class Projects::TreeController < Projects::ApplicationController
respond_to do |format|
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
end
......
......@@ -8,3 +8,6 @@
%small
= number_to_human_size(blob.raw_size)
- if blob.stored_externally?
%span.label.label-lfs.append-right-5 LFS
- is_lfs_blob = @lfs_blobs.select{|b| b.id === blob_item.id }.any?
%tr{ class: "tree-item #{tree_hex_class(blob_item)}" }
%td.tree-item-file-name
= tree_icon(type, blob_item.mode, 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
%span= file_name
- if is_lfs_blob
%span.label.label-lfs.prepend-left-5 LFS
%td.hidden-xs.tree-commit
%td.tree-time-ago.cgray.text-right
= render 'projects/tree/spinner'
---
title: Added badge to tree & blob views to indicate LFS tracked files
merge_request:
author:
type: added
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment