_tree_item.html.haml 733 Bytes
Newer Older
Dmitriy Zaporozhets's avatar
v1.0  
Dmitriy Zaporozhets committed
1
- file = params[:path] ? File.join(params[:path], content.name) : content.name
Dmitriy Zaporozhets's avatar
1.0.1  
Dmitriy Zaporozhets committed
2
- content_commit = @project.repo.log(@commit.id, file, :max_count => 1).last
Dmitriy Zaporozhets's avatar
v1.0  
Dmitriy Zaporozhets committed
3 4 5 6 7 8 9
- return unless content_commit
%tr{ :class => "tree-item", :url => tree_file_project_path(@project, @commit.id, file) }
  %td.tree-item-file-name
    - if content.is_a?(Grit::Blob)
      = image_tag "txt.png"
    - else
      = image_tag "dir.png"
Dmitriy Zaporozhets's avatar
1.0.1  
Dmitriy Zaporozhets committed
10
    = link_to truncate(content.name, :length => 40), tree_file_project_path(@project, @commit.id, file, :branch => @branch, :tag => @tag), :remote => :true
Dmitriy Zaporozhets's avatar
v1.0  
Dmitriy Zaporozhets committed
11 12 13 14
  %td
    = time_ago_in_words(content_commit.committed_date)
    ago
  %td
15
    = link_to content_commit.truncated_message(40), project_commit_path(@project, content_commit)